mount: mounting /dev/sda2 on /sysroot failed: No such device

Após usar o "VMware vCenter Converter 6.1.1" para virtualizar uma máquina com Centos 5 tive o seguinte problema ao inicializar o linux:

* Mounting /dev/sda2 on /sysroot

mount: mounting /dev/sda2 on /sysroot failed: No such device

mount: mounting /dev on /sysroot/dev failed: No such file or directory

* Switching / to /sysroot

Kernel panic - not syncing: Attempted to kill init!

Coloquei o cd com o boot do centos "CentOS-6.5-x86_64-minimal.iso" e selecionei o modo de recuperação.

Depois fiz um chroot no sistema do hd.

# chroot /mnt/sysimage

Conferir o arquivo do grub "/boot/grub/grub.conf" e verifiquei que tinha algumas linhas comentadas com "(removed by Converter)". Mas nada que impactou no problema.

# chroot /mnt/sysimage

# more /boot/grub/grub.conf

Tentei recompilar o arquivo initrd com o comando abaixo, mas sem sucesso:

# chroot /mnt/sysimage

# cd /boot

# mv initrd-2.6.18-194.32.1.el5gc4PAE.img initrd-2.6.18-194.32.1.el5gc4PAE.img.old

# mkinitrd /boot/initrd-2.6.18-194.32.1.el5gc4PAE.img 2.6.18-194.32.1.el5gc4PAE

Então fiz a recompilação desse mesmo arquivo initrd passando alguns módulos, ai sim funcionou.

# chroot /mnt/sysimage

# cd /boot

# mv initrd-2.6.18-194.32.1.el5gc4PAE.img initrd-2.6.18-194.32.1.el5gc4PAE.img.old

# mkinitrd -f -v --with=scsi_mod --with=sd_mod --with=mptbase --with=mptspi --with=mptsas --with=mptscsih /boot/initrd-2.6.18-194.32.1.el5gc4PAE.img 2.6.18-194.32.1.el5gc4PAE

# exit

# reboot

Uma outra solução que eu não cheguei a testar é fazer um backup desse arquivo e depois restaurar na máquina virtual.

* Antes de converter a máquina, crie uma cópia do seu arquivo initrd.img do /boot

# cp /boot/initrd.img-2.6.26-2-amd64 /boot/initrd.img-2.6.26-2-amd64.bkp

* Converter a máquina

* Dê um boot com o Live CD em modo recuperação

* Mounte o /boot em um caminho tipo /root/boot/

# mount /dev/sda1 /root/boot/

* Recupere o arquivo de backup do initrd.

# mv /root/boot/initrd.img-2.6.26-2-amd64 /root/boot/initrd.img-2.6.26-2-amd64.bkp2

# mv /root/boot/initrd.img-2.6.26-2-amd64.bkp /root/boot/initrd.img-2.6.26-2-amd64