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
Best Answer
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:
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:
You'll still need to make your grub.conf and fstab files with the correct xvd devices though.