3

I'm trying to install Gentoo into a Xen HVM guest. Everything went fine with the install up to the point where you do the grub-install. Apparently, grub does not know about block devices labeled "xvd" (see https://bugs.gentoo.org/show_bug.cgi?id=424343). The initial error was:

livecd# grub-install /dev/xvda
/dev/xvda does not have any corresponding BIOS drive

After patching the /sbin/grub-install to see xvd devices and modifying /boot/grub/device.map to be:

(hd0) /dev/xvda

I now get the following error:

livecd# grub-install /dev/xvda
df: Warning: cannot read table of mounted file systems: No such file or directory
Could not find device for /boot: Not found or not a block device

The livecd sees the disks fine, and fdisk -l shows all my partitions:

Disk /dev/xvda: 48.3 GB
Device       Start       End     System
/dev/xvda1     2048      206847    Linux
/dev/xvda2   206848     4302847    Linux swap / Solaris
/dev/xvda3  43002848   94371739    Linux

Has anyone got Gentoo working on a Xen DomU? Any advice on getting past this would be appreciated. It appears only grub has an issue at this point.

Edit: Adding in /proc/mounts

livecd ~ # cat /proc/mounts
rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=46256,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
tmpfs / tmpfs rw,relatime 0 0
/dev/sr0 /mnt/cdrom iso9660 ro,relatime 0 0
/dev/loop0 /mnt/livecd squashfs ro,relatime 0 0
xenfs /proc/xen xenfs rw,nosuid,nodev,noexec,relatime 0 0
rc-svcdir /mnt/livecd/lib64/rc/init.d tmpfs rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /mnt/livecd/lib64/firmware tmpfs rw,relatime 0 0
tmpfs /mnt/livecd/usr/portage tmpfs rw,relatime 0 0
usbfs /proc/bus/usb usbfs rw,nosuid,noexec,relatime 0 0
/dev/xvda3 /mnt/gentoo ext3 rw,relatime,errors=continue,barrier=1,data=writeback 0 0
/dev/xvda1 /mnt/gentoo/boot ext3 rw,relatime,errors=continue,barrier=1,data=writeback 0 0
proc /mnt/gentoo/proc proc rw,relatime 0 0
udev /mnt/gentoo/dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=46256,mode=755 0 0
devpts /mnt/gentoo/dev/pts devpts rw,relatime,gid=5,mode=620 0 0
shm /mnt/gentoo/dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0

Output of ls /dev/da

/dev/dac960_gam
/dev/revalidate
/dev/xvda
/dev/xvda1
/dev/xvda2
/dev/xvda3
3
  • Can you paste the output of ls /dev/*da*.
    – mgorven
    Jul 13, 2012 at 3:56
  • /dev/da output added
    – John P
    Jul 13, 2012 at 15:21
  • Please post your current DomU definition content.
    – Nils
    Jul 15, 2012 at 21:27

1 Answer 1

1

grub-install really only needs to know what device to install onto and since your livecd is not using a Xen kernel it won't have xvd devices. You can verify this by looking at /proc/mounts:

> cat /proc/mounts

So assuming /dev/sda is the device you need to install grub onto, all you really need to do to install grub in the livecd environment is:

> grub-install --no-floppy /dev/sda

You'll still need to make your grub.conf and fstab files with the correct xvd devices though.

2
  • 1
    /dev/sda is not available (and does not show up in /proc/mounts). What is available is /dev/xvda1 and /dev/xvda3 along with xenfs
    – John P
    Jul 12, 2012 at 17:07
  • @JohnP so change your definition file for the DomU on the Dom0 and replace xvda with hda.
    – Nils
    Jul 15, 2012 at 21:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .