VMware Cloud Community
Hulk007
Contributor
Contributor

" Error loading operating system" - P2V convertion of CentOS 5.3

Hi! All,

I have a physical CentOS 5.3 server which I converted to a VM using the vmware converter standard 4.01. edition.

The convertion succeded. However, when I try to power on the VM - I get a message

" Error loading operating system"

I see from various other forums and threads that I have to boot from a live cd and perform some operations. Not sure the steps I need to follow.

I entered "linux rescue" at the boot and it prompted me to setup "Setup Networking" - I selected "NO"

The next screen messsage:

"The rescue environment will now attempt to find your linux installation and mount it under the directory /mnt/sysimage. You can them make any changes to the system. If you want to proceed with this step choose 'continue'. You can also choose to mount your file system read-only instead of read-write by choosing 'read-only'. If for some reason this process fails you can choose 'skip' and this step will be skipped and you will go directly to a command shell"

I selected "CONTINUE"

The next screen message:

"Your system has been mounted under /mnt/sysimage. Press to get a shell. If you would like to make your system the root environment, run the command chroot /mnt/sysimage.

The system will reboot automatically when you exit from the shell."

I selected "OK" and Iam presented with the prompt

sh-3.2#

Appreciate if someone can help me on how to proceed further and make this vmdk bootable. Pl let me know if you need more info.

Many thanks

Ven

0 Kudos
7 Replies
Hulk007
Contributor
Contributor

Please some help is appreciated...............

0 Kudos
athlon_crazy
Virtuoso
Virtuoso

Okay, probably you may or may not having two problems here :

  1. "Error loading operating system" could be caused when there is no boot loader detected on your MBR or maybe your grub installed and configured but it was corrupted. Reinstallation boot loader should able to resolve this issue. just try $chroot /mnt/sysimage then $grub-install hdX where "X" you must give your correct hardisk number.

  2. Second even when your boot loader installed successfuly you may later have a problem with "kernel panic". This normally happened when no mpt_scsih driver loaded into your Centos initrd. Double check your scsi adapter whether you use Bus_logic or LSI_logic (edit setting VM -> scsi adapter). You can start the VM with Bus_logic otherwise, recompile kernel before P2V is necessary if you still insist to use LSI_logic adapter.

vcbMC-1.0.6 Beta

vcbMC-1.0.7 Lite

http://www.no-x.org

http://www.no-x.org
0 Kudos
Hulk007
Contributor
Contributor

Thank you for your reply.

I booted via the live cd and at the prompt:

sh-3.2# chroot /mnt/sysimage

and then I typed df -H and the output is:

Filesystem Size Used Avail Use% Mounted on

/dev/sda2 70 g 46g 21g 70% /

/dev/sda1 104mb 20mb 80mb 20% /boot

/dev/sda3 1.1gb 705mb 280 mb 72% /home

I presume you wanted me to specify the /boot, so I entered;

sh-2.05b# grub-install /dev/sda1

Output :

Installation finished. No error reported.

This is the contents of the device map /boot/grub/device.map.

Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script 'grub-install'.

  1. this device map was generated by anaconda

(fd0) /dev/fd0

(hd0) /dev/hda

(hd2) /dev/sda

I rebooted the server........... then I get this msg:

Booting ' CentOS-3 (2.4.21-32.ELsmp)'

root (hd2,0)

Error 21: Selected disk does not exist

Press any key to continue..........

Next scren gives me 3 options

CentOS (2.4.21-32.ELcustom)

CentOS-3 (2.4.21-32.ELsmp)

CentOS-3-up (2.4.21-32.EL)

I get the same message as above when I select any of the options.

Appreciate your thoughts on this and thank you once again for your inputs.

0 Kudos
athlon_crazy
Virtuoso
Virtuoso

when you chroot /boot/sysimage, verify all Centos kernel images (vmlinuz-xxxx) are there similar to what you got in /boot/grub/device.map

Once okay, reinstall again grub $grub-install /dev/sda

if you r not sure, copy paste your :

  • /boot/grub/device.map entry &

  • ls -l /boot

vcbMC-1.0.6 Beta

vcbMC-1.0.7 Lite

http://www.no-x.org
0 Kudos
Hulk007
Contributor
Contributor

Hi! Thanks for the reply,

device.map entry:

(hd0) /dev/sda

The file listing for /boot is attached via screenshots, pl refer and advice. Appreciate your help.

Many thanks

Ven

0 Kudos
athlon_crazy
Virtuoso
Virtuoso

have u try $grub-install /dev/sda






vcbMC-1.0.6 Beta

vcbMC-1.0.7 Lite

http://www.no-x.org

http://www.no-x.org
0 Kudos
Hulk007
Contributor
Contributor

Hi! , yes I did - now I have a kernel panic error and the machine hangs. Attached is the screenshot, pl take a look

Many thanks

0 Kudos