0

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...

David Spillett
  • 22,534
  • 42
  • 66
Bill D
  • 3
  • 1
  • 3
  • My first guess would be that something is off in translating the drive geometry to an image, but I'm not a drive expert. If you run Testdisk from a boot disc on the image drive, does it find anything it can repair? In the advanced tools it may even see whether the contents of the drive are readable. – Bart Silverstrim Oct 21 '10 at 13:33

2 Answers2

1

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.

Tom O'Connor
  • 27,440
  • 10
  • 72
  • 148
Olivier S
  • 2,719
  • 1
  • 12
  • 14
0

Does the VM host definitely support 64-bit guests? VMWare at least doesn't support 64-bit guests on older AMD CPUs and Intel CPUs that are not VT-capable (and some fairly recent Intel chips do not have VT). You can check for support using Intel's list at http://ark.intel.com/VTList.aspx or by using a tool like CPU-Z.

I would expect the boot to fail very early on if this is the cause of your problem though. It would be a good idea to indicate in your question the last few things that were displayed before the error.

David Spillett
  • 22,534
  • 42
  • 66