PyGrub

from:https://wiki.debian.org/PyGrub

Using pyGRUB on Wheezy to boot a domU kernel

Using pyGRUB from xen-utils-4.0, each domU can boot with its own kernel instead of using the dom0 kernel, which makes life easier for updates and multi distribution Xeninstalls. You need to have first a working domU. The domU FileSystem needs to be ext[234].

 

On the dom0

  • You need to have the system partition as the first partition listed in your domU.cfg disklist.

Config snippet:

root        = '/dev/xvda2 ro'
disk        = [
                  'phy:/dev/vg05/test2.openforce.com-disk,xvda2,w',
                  'phy:/dev/vg05/test2.openforce.com-swap,xvda1,w',
              ]

 

On the domU

  • Make sure /etc/fstab refers to the mount points /dev/xvda{1,2}

  • Install a standard linux-image-amd64 kernel (since Xen support is in mainline Linux since Linux 2.6.37)

 

mkdir /boot/grub
apt-get install linux-image-amd64

You don't need to install grub, you just need to create a simple grub config file which will be read by pygrub on the Dom0.

  • Create first /boot/grub/menu.lst based on the content of /boot/.

 

cat > /boot/grub/menu.lst << EOF

default         0
timeout         2

title Debian GNU/Linux root (hd0,0) kernel /vmlinuz root=/dev/xvda2 ro initrd /initrd.img  title Debian GNU/Linux (recovery mode) root (hd0,0) kernel /vmlinuz root=/dev/xvda2 ro single initrd /initrd.img  EOF

 

On the dom0

  • Check that grub was properly installed on the domU with

 

/usr/lib/xen-default/bin/pygrub /dev/vg02/my_domU-disk

which should great with the familiar grub menu, and then abort

  • Replace the kernel and ramdisk parameters in the domU config file with the following line.

 

bootloader      = '/usr/lib/xen-default/bin/pygrub'

转载于:https://www.cnblogs.com/heidsoft/p/3899698.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值