On 10/29/2009 09:28 PM, Richard W.M. Jones wrote:
On Thu, Oct 29, 2009 at 08:35:58PM +0100, Dennis J. wrote:
> but when I issue the "grub-install / /dev/sda" all I get is:
> "libguestfs: error: grub_install: grub-install: /dev/sda does not have
> any corresponding BIOS drive."
I read the rest of your comment with awe. All I can say is good luck
with your experiments.
Just about the particular error above .. Is /dev/sda the real name of
the drive? (Try the list-devices command to list the real device
Success! The problem was that the guest is usually using /dev/vda but I
couldn't get guestfish to start with:
[root@nexus ~]# guestfish -a /var/lib/libvirt/images/test2.img -m
/dev/vg_test/lv_root -m /dev/vda1:/boot
libguestfs: error: mount: mount_stub: /dev/vda1: No such file or directory
Using /dev/sda1 instead lets guestfish start and /boot is mounted properly
but grub-install didn't work. What did the trick was changing "/dev/vda" to
"/dev/sda" in /boot/grub/device.map followed by a grub-install which now
works and then changing the device.map back so I don't get problems when
booting up the guest for real.
After that the "new" guest boots up perfectly.
I'm not very familiar with guestfish (yet) so I'm not sure if the /dev/vda1
thing is a bug or simply not supposed to work.
The next step would be to automate the whole thing with a script even if
it's only useful in some cases (where the guest only really uses a small
part of the image).