grub does not install properly to a virtio disk in kvm (/dev/vda)

Bug #281492 reported by Dustin Kirkland 
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub (Debian)
Fix Released
Unknown
grub (Ubuntu)
Invalid
Undecided
Unassigned
grub-installer (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: grub

This bug is related to Bug #279754, which was recently fixed. Installations to virtio hard disks would not complete. They complete now, but the installed system is not bootable.

This looks to me to be a problem with grub-install.

I tested this as follows:

 1) install system A using
  * kvm -m 256 -hda A.img -cdrom intrepid-server-amd64.iso
 2) install system B using:
  * kvm -m 256 -drive file=B.img,if=virtio,boot=on -cdrom intrepid-server-amd64.iso

Both installs complete. However, only system A will boot. System B will not boot, hanging with a line that says:
 * Booting from Hard Disk...

Next, I take system A, and boot it with its disk as a virtio device, with:
 * kvm -m 256 -drive file=A.img,if=virtio,boot=on

This boots fine. The root filesystem is mounted and functional as /dev/vda

Next I take system B, and try to boot it with the disk as a standard disk, with:
 * kvm -m 256 -hda B.img

This is not bootable either. Same error message as above.

Finally, I take system A, boot it with its disk as a virtio device, and re-run grub-install /dev/vda (after updating /boot/grub/devices.map). The grub installation will succeed, however, this will render this disk unbootable.

:-Dustin

Revision history for this message
Niklas Hagman (blinkiz) wrote :

Can confirm this. Tried to install latest ubuntu-8.10-beta-server-amd64.iso (20081013) and the system is not bootable. Workaround is as described by Dustin. First installing into simple hda drive and then switch to vda (virtio) after installation.
Hardy works both ways without problem. The goal is of course to make intrepid work as well.

Changed in grub:
status: New → Confirmed
Revision history for this message
Niklas Hagman (blinkiz) wrote :

I can see in the changelog for package grub-installer, 1.27ubuntu4, that Soren Hansen has "Teach grub-installer about virtio devices (/dev/vd*)". Intrepid is using version 1.32 resynchronised from Debian. Does this mean grub-installer needs to be patched each time a new version is merged from Debian?

Changed in grub:
status: Unknown → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 281492] Re: grub does not install properly to a virtio disk in kvm (/dev/vda)

On Tue, Oct 14, 2008 at 05:04:04PM -0000, Niklas Hagman wrote:
> I can see in the changelog for package grub-installer, 1.27ubuntu4, that
> Soren Hansen has "Teach grub-installer about virtio devices (/dev/vd*)".
> Intrepid is using version 1.32 resynchronised from Debian. Does this
> mean grub-installer needs to be patched each time a new version is
> merged from Debian?

The patch for /dev/vd* support was merged up to Debian in version 1.31.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Marking "Invalid" against grub, the bug is in grub-installer

:-Dustin

Changed in grub:
status: Confirmed → Invalid
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

The attached patch fixes this bug in the installer.

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Patch updated with a better changelog entry.

Also, I have uploaded to a bzr branch:
 * lp:~kirkland/grub-installer/281492

:-Dustin

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub-installer - 1.32ubuntu7

---------------
grub-installer (1.32ubuntu7) intrepid; urgency=low

  * grub-installer: if the boot filesystem is on a virtio device, we need to
    null out the $frdisk variable (LP: #281492)

 -- Dustin Kirkland <email address hidden> Tue, 14 Oct 2008 17:31:47 -0500

Changed in grub-installer:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.