[CentOS-virt] Migrating from KVM to XEN - kernel panic

Mon Nov 9 20:15:30 UTC 2009
Christopher G. Stach II <cgs at ldsys.net>

----- "Christopher Hunt" <dharmachris at gmail.com> wrote:

> I've updated accordingly, and now am getting a brand new file system
> issue:
> 
> 
> Waiting for driver initialization.
> Scanning and configuring dmraid supported devices
> Creating root device.
> Mounting root filesystem.
> mount: could not find filesystem '/dev/root'
> Setting up other filesystems.
> Setting up new root fs
> setuproot: moving /dev failed: No such file or directory
> no fstab.sys, mounting internal defaults
> setuproot: error mounting /proc: No such file or directory
> setuproot: error mounting /sys: No such file or directory
> Switching to new root and running init.
> unmounting old /dev
> unmounting old /proc
> unmounting old /sys
> switchroot: mount failed: No such file or directory
> Kernel panic - not syncing: Attempted to kill init!

This could be a couple of things. Is it still displaying the message that it found vg00? If not, (1) it's mkinitrd being stupid and not creating the initrd init script correctly (ignoring LVM initialization when you supply an alternate fstab). If it is starting vg00 properly, it is probably (2) that your root device names are different in dom0 and the guest.'

If you have situation 1, you can modify the initrd manually or do a lengthy process with kpartx, yum install kernel-xen, bind mount a bunch of filesystems from dom0, mkinitrd, undo everything, and proceed to the next guest. (It's scriptable, bit still a pain.) Modifying the initrd manually isn't that bad. It basically goes like this:

1. mkinitrd --with=xenblk --with=xennet --preload=xenblk --preload=xennet <img> <version>
(yes, that's the original one without the fstab)
2. gunzip -c /boot/initrd-blah.img > /root/blah
3. mkdir /mnt/blah
4. mount -o loop /root/blah /mnt/blah
5. vi /mnt/blah/init
<change occurrences of dom0 VG to guest VG>
<change dom0 root device name to guest root device name>
6. umount /mnt/blah
7. gzip -c /root/blah > /boot/initrd-blah.img

You can keep repeat 4-7 as necessary until it works or you lose it. :)

If you don't have situation 1 but you have situation 2, just change the root device name in fstab-domU and rerun the mkinitrd command with the fstab argument.

-- 
Christopher G. Stach II