This blog is NOFOLLOW Free!

The magic space of the IT find what you seek or get lost


Fix pygrub booting of debian squeeze

Debian Squeeze is now using grub2 as the default bootmanager. Because of this pygrub has some difficulties to boot the domU after installing it. Here are the things i found out, if you have more remarks, drop me a comment please.

First off all, because of the new grub2 you have to use at least xen-tools in the version 3.4.3. The developers has first added the support to 4.x, but then they have made a back-port and released this officially in 3.4.3.

Ok now the new grub gets detected correctly by pygrub, but I still got an error message like this:

xen ~# xm create server02

Error code: Using class 'grub.GrubConf.Grub2ConfigFile' to parse  /boot/grub/grub.cfg
Error parameters: WARNING:root:Unknown directive load_video, Traceback  (most recent call last):, File "/usr/bin/pygrub", line 746, in ?,  raise RuntimeError, "Unable to find partition containing kernel",  RuntimeError: Unable to find partition containing kernel,

The problem is an argument which is used in the grub.conf file. We have to change it a little bit. For this we have to mount the boot/root partition of the installed guest domU. If you don’t know how you can do this, you can find the information here.

– Open the grub.cfg file (boot/grub/grub.cfg) in your favorite editor.
– Change msdos infos to a normal grub entry
hd0,msdos1 -> hd0,0
– Do this for all entries.
– Keep in mind that debian perhaps update this file

About kTitan

Comments (6) Trackbacks (0)
  1. Realy thx for this post

  2. Hi there,

    there was more to this issue for me. Menu entries of my fresh Squeeze install had the following structure:

    menuentry ‘Debian GNU/Linux, with Linux 2.6.32-5-amd64’ –class debian –class gnu-linux –class gnu –class os

    using single quotes for the title. However, matches double quotes only 🙁

    Once changing to double quotes, everything is fine.


  3. Hi,
    Thanks for your tips about the “msdos1” stuff but I think I found a better way to edit grub.cfg on my XenServer 5.6 pf1. Just use

    xe-edit-bootloader -u -p 1 -f /boot/grub/grub.cfg

    You can edit the file without mounting the partition.

  4. Hi there,

    I had similar problem after domU upgrade from Ubuntu 10.10 to 11.04 on XenServer 5.6FP1. In additon to what Björn has suggested, I had to remove all parameters from the menuentry line, between the closing quote and the opening curly braket. Then it started working.

  5. Thank god. This entry was SOOOO helpful. I had to follow Alexandre’s advice as well but it worked. However, it dropped me to a shell because it gave up waiting for the root device. Just one minor thing to fix (I hope).

  6. You beed to update the Grub devicemap, then the enties will be correct after grup-update

    sed -i ‘s!/dev/sda!/dev/xvda!’ /boot/grub/

Leave a comment

Connect with Facebook

No trackbacks yet.