[fedora-virt] P2V and grub bootloader

Dennis J. dennisml at conversis.de
Fri May 1 18:12:23 UTC 2009

On 05/01/2009 05:36 PM, Richard W.M. Jones wrote:
> Here's an example where I've used a separate /boot partition and root
> is on an LV:
> -------------------------------------------------- /tmp/test.sh
> #!/bin/sh -
> guestfish<<EOF
> alloc /tmp/test.img 500MB
> run
> sfdisk /dev/sda 0 0 0 ",10 ,"
> echo Size of /dev/sda1:
> blockdev-getsize64 /dev/sda1
> echo Size of /dev/sda2:
> blockdev-getsize64 /dev/sda2
> mkfs ext2 /dev/sda1
> pvcreate /dev/sda2
> vgcreate VG /dev/sda2
> lvcreate LV VG 400M
> mkfs ext2 /dev/VG/LV
> mount /dev/VG/LV /
> mkdir /boot
> mount /dev/sda1 /boot
> grub-install / /dev/sda

I'm actually using the same setup but I forgot to mount the /boot 
partition. After doing that grub-install worked fine although I'm not sure 
why I got the BIOS error message simply because /boot wasn't mounted. Isn't 
the MBR written to the first sector of the disk and as a result independent 
of any particular partition? Why would the mounting of a partition have an 
influence on that? (Of course without the mount grub's boot files get 
written to the wrong place but that doesn't explain grub complaining about 
the device layout)


More information about the Fedora-virt mailing list