1

I'm trying to run a Ubuntu 12.10 off a Debian 6.0.4 and Xen-4.0. I realised that pygrub might not be able to parse the menu.lst (I symlinked menu.lst to grub.cfg in /boot) and ended up with this configuration:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
    insmod gzio
    insmod ext2
    search --no-floppy --fs-uuid --set=root 7098a9fb-df7a-4e37-841d-73641c6b79c5
    loopback loop0 /sdd
    set root=(loop0)
    linux   /boot/vmlinuz-3.5.0-27-generic root=UUID=7098a9fb-df7a-4e37-841d-73641c6b79c5 ro console=hvc0  splash quiet
    initrd  /boot/initrd.img-3.5.0-27-generic
}

But unfortunately pygrub is still unable to parse the configuration file and shows me the following output: Pygrub Output

I figured that pygrub has problems with the loopback device in the menuentry. I removed the offending lines and replaced them with a straightforward configuration (similar to my other Debian Xen instances).

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
    insmod ext2
    set root=(hd0)
    linux   /boot/vmlinuz-3.5.0-27-generic root=UUID=7098a9fb-df7a-4e37-841d-73641c6b79c5 ro console=hvc0  splash quiet
    initrd  /boot/initrd.img-3.5.0-27-generic
}

But unfortunately this won't boot either: It shows the pygrub menu and an error message: Traceback (most recent call last):

File "/usr/lib/xen-4.0/bin/pygrub", line 704, in <module>
chosencfg = run_grub(file, entry, fs, incfg["args"])
File "/usr/lib/xen-4.0/bin/pygrub", line 570, in run_grub
img = g.cf.images[0]
IndexError: list index out of range
root@xenhost7:~# Error: Boot loader didn't return any data!

The error seems to indicate that pygrub is able to parse the data but somehow is unable to find the kernel. But the kernel exists. Fdisk also shows that /boot is on the first partition:

Disk part: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c7dc8

Device Boot      Start         End      Blocks   Id  System
 part1               1        3851    30924800   83  Linux
 part2            3851        3917      529409    5  Extended
 part5            3851        3917      529408   82  Linux swap / Solaris

Note that booting the machine with an external kernel is not really an option since all VM's are booted via iSCSI (and we will switch to KVM at some point in the near future). The loopback device in the original grub config might also produce problems when starting up.

Any suggestions, ideas?

Pascal
  • 320
  • 2
  • 12

1 Answers1

2

We were able to boot the system with the indicated configuration:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
    insmod gzio
    insmod ext2

    set root='(hd0)' 
    linux   /boot/vmlinuz-3.5.0-27-generic root=UUID=7098a9fb-df7a-4e37-841d-73641c6b79c5 ro console=hvc0  splash quiet
    initrd  /boot/initrd.img-3.5.0-27-generic
}

The problem was that I created a menu.lst file which pygrub associates with Grub 1.0 (or 0.95) which got parsed first. The file format used in Ubuntu 12.10 is a Grub 2.0 file however.

So in order to run the Ubuntu 12.10 with pygrub the set root={...} line has to be replaced with set root='(hd0)'.

Pascal
  • 320
  • 2
  • 12