P2V’ing CentOS5.1 with an LVM
So this week I accepted the task of P2V'ing a machine for one of our customers that has long been 'untouched' for years. Doing some initial digging I found that the machine was built using CentOS5.1 or otherwise known as the free RHEL5.1 kernel (2.4.x). Doing some brain storming with a fellow colleague we discussed the various options of getting the machine from a physical to virtual status, with the least amount of possibilities in failing the kernel and having to start over. The following options were considered:
Clonezilla
VMware P2V
Shadowprotect Image Creator
Using a Netbackup Restore
Doing a hot rsync transfer of the kernel.
After some deliberation, we decided that we would try the Clonezilla image. Of course taking this course required that we have a downtime for the machine so that it could be properly cold imaged.
Unfortunately, the clonezilla images did not work, and we ended up going with a P2V. Since, the images did not work, the task of getting the P2V was passed to me, since I have the experience with Linux and VMware that would be required to get this working.
After about 4 hours of waiting for the p2v to finish, I was finally able to try and turn the VM on and see what happened. Not being suprised, first time I powered on the vm I received a kernel panic. So I did a google search to see if the centos5.1 kernel was even still available, and sure enough after about 15 minutes of searching, I finally found the iso's that I was looking for.
Next step, to boot the vm up in safe mode to see what I was dealing with. Good news, safe mode found the kernel, but had to mount it as /mnt/sysimage; unfortunately this means that there is a driver issue and the machine was unable to locate the correct drive on the boot. So I started through the process of rotating through the drivers, first starting with the LSI Logic drivers (mptbase, mptscsih); tried a reboot, no success. Note: I also tried recreating the boot by reruning setup, but this also did not help.
What ended up working was changing the drivers in /etc/modprobe.conf to use the mptbase driver on the main scsiadapter, and all other scsiadapters to use the ata_piix driver, then running kudzu, and then doing a mkinitrd kernel.smb.img kernel.img, reboot, and bingo it booted.
Also to note, I rebooted after changing the /etc/modprobe.conf file original, and was able to do an lvdisplay, pvdisplay, vgdisplay and show all lvms present and accounted for, I think this was the key to stepping forward. Also good to remember that if your boot/os is not on an LVM, booting into safe mode constantly to fix this is not needed, it can all be done while the kernel is running live.
Here's a helpful VMware thread I found
Linux
I'm really starting to like having a dev environment as well, I'm getting a chance to play with linux automation on a whole new level then I did before. My next idea is to figure out pgsql replication using rsync. Havn't done that one before and I think it'll be something that I will enjoy.

