Richard W.M. Jones
2010-Jun-03 10:52 UTC
[Libguestfs] [PATCH 0/2] Fix grub-install (RHBZ#484986).
For some unknown reason (possibly a regression), grub-install cannot determine the BIOS devices corresponding to virtio-blk devices. Therefore you have to create a /boot/grub/device.map file by hand before running grub-install. These two patches just note this in the documentation, and secondly enable the tests by writing this file before running grub-install. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
Richard W.M. Jones
2010-Jun-03 10:53 UTC
[Libguestfs] [PATCH 1/2] grub-install: In docs suggest manually creating device.map (RHBZ#484986).
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/ -------------- next part -------------->From dccd9b8f525cfae49b89c38066d752e6c054c7f6 Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Thu, 3 Jun 2010 11:48:41 +0100 Subject: [PATCH 1/2] grub-install: In docs suggest manually creating device.map (RHBZ#484986). --- src/generator.ml | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index efc8bfd..cc34676 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -2329,7 +2329,18 @@ See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."); "install GRUB", "\ This command installs GRUB (the Grand Unified Bootloader) on -C<device>, with the root directory being C<root>."); +C<device>, with the root directory being C<root>. + +Note: If grub-install reports the error +\"No suitable drive was found in the generated device map.\" +it may be that you need to create a C</boot/grub/device.map> +file first that contains the mapping between grub device names +and Linux device names. It is usually sufficient to create +a file containing: + + (hd0) /dev/vda + +replacing C</dev/vda> with the name of the installation device."); ("cp", (RErr, [Pathname "src"; Pathname "dest"]), 87, [], [InitBasicFS, Always, TestOutput ( -- 1.6.6.1
Richard W.M. Jones
2010-Jun-03 10:54 UTC
[Libguestfs] [PATCH 2/2] grub-install: Enable grub-install tests and create explicit device.map file.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v -------------- next part -------------->From 8fca8549edb1581448fa45d08d90bad399c5dbfa Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Thu, 3 Jun 2010 11:49:38 +0100 Subject: [PATCH 2/2] grub-install: Enable grub-install tests and create explicit device.map file. --- src/generator.ml | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index cc34676..5cd704f 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -2320,11 +2320,14 @@ any partition tables, filesystem superblocks and so on. See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."); ("grub_install", (RErr, [Pathname "root"; Device "device"]), 86, [], - (* Test disabled because grub-install incompatible with virtio-blk driver. - * See also: https://bugzilla.redhat.com/show_bug.cgi?id=479760 + (* See: + * https://bugzilla.redhat.com/show_bug.cgi?id=484986 + * https://bugzilla.redhat.com/show_bug.cgi?id=479760 *) - [InitBasicFS, Disabled, TestOutputTrue ( - [["grub_install"; "/"; "/dev/sda1"]; + [InitBasicFS, Always, TestOutputTrue ( + [["mkdir_p"; "/boot/grub"]; + ["write"; "/boot/grub/device.map"; "(hd0) /dev/vda"]; + ["grub_install"; "/"; "/dev/vda"]; ["is_dir"; "/boot"]])], "install GRUB", "\ -- 1.6.6.1