VMware Cloud Community
clubbing80s
Contributor
Contributor

CentOS 5.3 , Kernel Panic - mount: could not find filesystem '/dev/root'

Hi.

I am trying to convert a machine based on CentOS 5.3 , I keep getting "kernel panic" on boot.

mount: could not find filesystem '/dev/root'

setuproot: moving /dev failed: No such file or directory

setuproot: error mounting /proc  failed: No such file or directory

setuproot: error mounting /sys failed: No such file or directory

switchroot: mount failed: No such file or directory

Kernel panic - not syncing: Attempted to kill init!-220000

I have followed the instructions on fixing this :

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100240...

http://blog.edgoad.com/2010/03/vmware-no-volume-groups-found.html

but I still get "Kernel Panic"

I have re-installed the CentOS kernel but that didn't make any difference.

I have tried installing disk labels but that didn't make any difference.

I have tried VMware Standalone converter 5.5 and 5.0 with the same results.

I have confirmed the presence of /dev, /sys and /proc directories.

I have tried this : echo "DMRAID=no" > /etc/sysconfig/mkinitrd/noraid chmod 755 /etc/sysconfig/mkinitrd/noraid as suggested here :
http://tech.lanesnotes.com/2009/05/converting-physical-linux-system-to.html

I was advised to change the disks to IDE , but I can't see anyway to do this in ESXi 5.1 .

I'm at a loss at this point , I'm open to suggestions.

Here are my configs as shown when using a rescue disk and chroot into /mnt/sysimage


[root@localhost /]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 console=ttyS0,9600n8 console=tty0
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
# (removed by Converter) title Memtest86+ (1.65)
# (removed by Converter)        root (hd0,0)
# (removed by Converter)        kernel /memtest86+-1.65 ro root=/dev/VolGroup00/LogVol00 rhgb quiet

title CentOS (2.6.18-128.7.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-128.7.1.el5 ro root=/dev/sdb1 rhgb quiet
#       kernel /vmlinuz-2.6.18-128.7.1.el5 ro root=LABEL=/
        initrd /initrd-2.6.18-128.7.1.el5.img

#title CustomKernel (2.6.18-128.7.1.el5)
#       root (hd0,0)
#       kernel /vmlinuz-2.6.18-128.7.1.el5 ro root=/dev/sdb1 rhgb quiet
#       initrd /initrd-2.6.18-128.7.1.el5.img
[root@localhost /]#

[root@localhost /]# cat /boot/grub/device.map
(hd0)   /dev/sda
(hd1)   /dev/sdb
[root@localhost /]#

[root@localhost /]# cat /etc/fstab
/dev/sdb1       /               ext3    defaults,noatime        1 2
#LABEL=/                /               ext3    defaults,noatime        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
[root@localhost /]#

[root@localhost /]# fdisk -l /dev/sda

Disk /dev/sda: 108 MB, 108134400 bytes
4 heads, 32 sectors/track, 1650 cylinders
Units = cylinders of 128 * 512 = 65536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           2        1633      104448   83  Linux
[root@localhost /]# fdisk -l /dev/sdb

Disk /dev/sdb: 159.9 GB, 159921602560 bytes
143 heads, 28 sectors/track, 78008 cylinders
Units = cylinders of 4004 * 512 = 2050048 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       78009   156172288   83  Linux
[root@localhost /]#


[root@localhost /]# mount
/dev/sdb1 on / type ext3 (rw,noatime)
/dev/sda1 on /boot type ext3 (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /dev/shm type tmpfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
[root@localhost /]#

Thank you.

0 Kudos
3 Replies
patanassov
VMware Employee
VMware Employee

Hi

I am impressed how deep you have dived.

There is a line in grub.conf:

#(removed by Converter)        kernel /memtest86+-1.65 ro root=/dev/VolGroup00/LogVol00 rhgb quiet

While fstab reads:

/dev/sdb1   /           ext3 defaults,noatime    1  2

Is the source machine's root volume a logical one? If yes, and LVM has been preserved during conversion, I suppose this could cause such an effect.

Besides the new grub entry is:

title CentOS (2.6.18-128.7.1.el5)

        root (hd0,0)

        kernel /vmlinuz-2.6.18-128.7.1.el5 ro root=/dev/sdb1 rhgb quiet

        initrd /initrd-2.6.18-128.7.1.el5.img

the 'root' should point to the /boot partition, probably /dev/sda1, which by the way is not present in fstab

Edit /etc/fstab while in rescue mode so that / gets mounted on the logical volume, and /boot to /dev/sda1, and run grub-install again.

HTH

Plamen

0 Kudos
clubbing80s
Contributor
Contributor

Hi.

Thanks for taking time to advise.

I used the "advanced" option to clone the disks as "Basic" rather than LVM , as the last machine failed with LVM and all that I read said to used "Basic" . On the source machine /boot and  / are on the separate partitions on the same disk. Convert creates separate disk with a partition of /boot (sda1) and another disk with a partition / (sdb1) . I have yet to figure out how to get it done in once disk. I have tried editing the disk layout with no luck. Also the swap partition is missing from all the machines that have been created.

I'm busy investigating your recommendations and will give feedback.

Thank you.

0 Kudos
patanassov
VMware Employee
VMware Employee

Hi

Converter makes a simplification when cloning sources with LVM. It creates a separate virtual disk per volume group and puts all its logical volumes inside. If you select 'to basic' this limitation is no more valid and you can move volumes around in the wizard (thought they would be on separate disks by default).

Regards,

Plamen

0 Kudos