Thursday 15 January 2009

After Converting Physical RHEL4 System to a Virtual Machine, System Cannot See Hard Disks and Kernel Panics

vmware official document. KB Article 1002402 Updated Sep. 12, 2008

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1002402&sliceId=2&docTypeID=DT_KB_1_1&dialogID=14730726&stateId=0%200%204678181


After Converting Physical RHEL4 System to a Virtual Machine, System Cannot See Hard Disks and Kernel Panics
KB Article1002402
UpdatedSep. 12, 2008
Products
VMware Converter
Details
After using VMware Converter to convert a physical RHEL4 host into a virtual machine running on ESX Server 3.0.x, the RHEL4 guest operating system fails to boot. The following error message is returned:

No volume groups found


Followed by:


Kernel panic - not syncing: Attempted to kill init!


Note: This issue might also apply to other Linux distributions.

Solution

The issue occure because the initial ramdisk image does not include the drivers or modules for the LSILogic virtual SCSI adapter in an ESX Server 3.0.x virtual machine. These modules are not in the initial ramdisk image because the image is originally created on a system that does not use this hardware. To fix this issue, you must replace the existing initial ramdisk image with a new one that includes the proper drivers.


Note: Before you begin modifying the guest operating system, ensure the SCSI host adapter for the virtual machine is set to LSI Logic. For more information, see Changing the type of SCSI controller used in a Hosted virtual machine (1216).


Here are the steps required to do this:



  1. Remember to make a snapshot of your virtual machine before starting, and create a backup copy of any files to be edited.



  2. Because the RHEL4 installation in the virtual machine is not currently bootable, boot the virtual machine from the first RHEL4 installation disk.



  3. At the first prompt, type

    linux rescue

    and press Enter to boot into rescue mode.



  4. Enter the following command to change root to the mounted RHEL installation:

    chroot /mnt/sysimage



  5. If the physical host was IDE-based, check the following files for any cases of /dev/hda, and replace with /dev/sda:

    /etc/fstab

    /boot/grub/device.map

    /boot/grub/grub.conf




  6. Ensure that grub is installed properly with the following command:

    grub-install



  7. Edit the file /etc/modules.conf and remove anything it contains. This should be an empty file. If the file does not exist, that is OK (you do not need to create it).



  8. Edit the file /etc/modprobe.conf, remove all existing lines, and replace them with the following 3 lines:

    alias eth0 pcnet32

    alias scsi_hostadapter mptbase

    alias scsi_hostadapter1 mptscsih




  9. Determine the full path to the initial ramdisk image you are going to rebuild. The initial ramdisk will be located in /boot. List the directory:

    ls /boot

    You see a file with a name similar to initrd-2.6.9-42.EL.img. In this case, the full path to this file is /boot/initrd-2.6.9-42.EL.img.



  10. Determine the kernel version to use for rebuilding the initial ramdisk image. Each installed kernel has their own folder in /lib/modules. List the directory:

    ls /lib/modules

    You see a folder with a name similar to 2.6.9-42.EL.



  11. Rebuild the ramdisk with the following command (replacing the path to the initial ramdisk image, and the kernel version with the ones you determined in the previous two steps. If there were multiple options, choose the newest ones, or check /etc/grub.conf to see which version is in use. Be sure the version number in the initial ramdisk image path matches the kernel version.):

    mkinitrd -v -f /boot/initrd-2.6.9-42.EL.img 2.6.9-42.EL

    Explanation of this command:




    1. mkinitrd: Make initial ramdisk


    2. -v: Be verbose


    3. -f: Force overwrite if file already exists (you want to replace the existing file)


    4. /boot/initrd-2.6.9-42.EL.img: Path to the file to write (which is already pointed to by /etc/grub.conf)


    5. 2.6.9-42.EL: Kernel version to use, which tells mkinitrd where to find the modules to include.



  12. Reboot.

    Important: After you have booted the system successfully and determined it is working as expected, remember to delete the snapshot you created in step 1.

Product Versions
VMware Converter 3.0.x
Keywords
guest OS; RHEL 4
Last Modified Date: 09-12-2008ID: 1002402

No comments:

Post a Comment