Using pygrub to boot a domU kernel

Using pygrub, each domU can boot with its own kernel instead of using the dom0 kernel, which lifes easier for updates and multi distribution xen installs. You need to have first a working domU.

On the domU

aptitude install linux-image-2.6-xen-amd64 grub

mkdir /boot/grub
echo "(hd0) /dev/sda" > /boot/grub/device.map
mknod /dev/sda b 202 0

update-grub

After editing this file, you need to re-run update-grub to propagate the changes.

sed -i -e 's/^# groot=(hd0)/# groot=(hd0,1)/' \
/boot/grub/menu.lst

update-grub

On the dom0

bootloader      = '/usr/lib/xen-3.2-1/bin/pygrub'

If you get  Error: Boot loader didn't return any data!  you need to have the system partition as the first partition comming in your domU.cfg something akin to

disk        = [
                  'phy:/dev/vg02/sandbox.openforce.com-disk,sda2,w',
                  'phy:/dev/vg02/sandbox.openforce.com-swap,sda1,w',
              ]

PyGrub (last edited 2009-03-16 03:33:05 by localhost)