Centos – Kernel Panic – not syncing: attempted to kill init (for VM image from a physical machine)

centosgrubkernelredhat

I had a CentOS 5.4 x86_64 machine where I imaged the primary partition with the following command so that I could run it in a VM on my local machine for testing.

#dd bs=1024 count=10482412 if/dev/sda of/mnt/storage/sda.img

Then I converted the image on my local machine with the command:

#VBoxManage convertdd sda.img sda.vmdk --format VMDK --variant Standard

I created a new VM and loaded this image as the hard disk. I booted with a Cent OS 5.4 x85_64 installation DVD into rescue mode. I chrooted into the image and reinstalled grub by doing the following:

#mount --bind /proc /mnt/disks/sda1/proc
#mount --bind /dev /mnt/disks/sda1/dev
#mount --bind /sys /mnt/disks/sda1/sys
#chroot /mnt/disks/sda1
#grub-install hd0

Then I rebooted the VM and grub displayed 3 selections. I've tried all 3 of them and I get a kernel panic every time. It starts booting and then I get the following message from each of the 3 choices:
"Kernel Panic – not syncing: Attempted to kill init!"

I'm not sure what to do to get it to boot properly…

Best Answer

Most probably the initrd image is not valid, there must be a problem with the paths when the image makes the switchroot. A common cause is that all drivers are not loaded in the initrd and thus the hard drive is not detected. Can you provide:

a) the grub.conf output

b) the content of the /etc/modprobe.conf on your virtual disk ? The remedy I would suggest is to repeat your

#mount --bind /proc /mnt/disks/sda1/proc
#mount --bind /dev /mnt/disks/sda1/dev
#mount --bind /sys /mnt/disks/sda1/sys
#chroot /mnt/disks/sda1

operation and then run mkinitrd from chrooted environnement, but with a fixed alias scsi_hostadapter xxxx line in your modprobe.conf file.

Related Topic