Bug 916016 - grub-efi should recognize virtio-blk devices
Summary: grub-efi should recognize virtio-blk devices
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: grub
Version: 6.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Václav Pavlín
QA Contact: Release Test Team
Depends On:
TreeView+ depends on / blocked
Reported: 2013-02-27 01:56 UTC by Laszlo Ersek
Modified: 2013-11-21 20:47 UTC (History)
6 users (show)

Fixed In Version: grub-0.97-82.el6
Doc Type: Bug Fix
Doc Text:
Cause: Grub didn't check EFI device path against EFI pci device path. Consequence: Grub wasn't able to recognize virtio-blk device in qemu-kvm with OVMF bios - thus fell into grub shell. Fix: Check EFI device path against EFI pci device path. Result: Grub now can see the disk successfully.
Clone Of:
Last Closed: 2013-11-21 20:47:10 UTC
Target Upstream Version:

Attachments (Terms of Use)
(proposed patch) recognize virtio-blk on OVMF (771 bytes, patch)
2013-02-27 02:05 UTC, Laszlo Ersek
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1649 0 normal SHIPPED_LIVE grub bug fix and enhancement update 2013-11-21 00:40:10 UTC

Description Laszlo Ersek 2013-02-27 01:56:36 UTC
*** Description of problem:
One useful environment for UEFI-related development is OVMF running on qemu-kvm. For performance reasons the virtio-blk disk driver is preferred in the virtual machine.

Recent OVMF versions come with a VirtioBlkDxe driver; that is, they can load and start grub.efi from the virtio-blk disk in qemu-kvm. However grub.efi itself does not recognize the virtio-blk disk -- it cannot access its config file, and the user is dropped to the grub shell.

*** Version-Release number of selected component (if applicable):

*** How reproducible:

*** Steps to Reproduce:
1. Follow the RHEL-6 oriented OVMF howto at <http://www.linux-kvm.org/page/OVMF>.

2. At first, install the RHEL-6 guest to an emulated IDE disk. Then shut down the guest.

3. In virt-manager, change the disk bus from IDE to Virtio.

4. Reboot the guest.

5a. At the OVMF splash screen, press Esc, then navigate to Boot Maintenance Manager | Boot Options | Add Boot Option.

5b. In the File Explorer, select the following UEFI device path:


5c. Navigate to \EFI\redhat\grub.efi and add it with the name "RHEL-6 grub".

5d. Inside Boot Maintenance Manager | Boot Options | Change Boot Order, press Enter, highlight the "RHEL-6 grub" entry, and press + repeatedly until it's the top-most option. Commit changes.

5e. From the main menu, select Boot Manager, and boot the "RHEL-6 grub" option.
*** Actual results:
grub-efi displays its shell.

*** Expected results:
grub-efi should display the countdown and then boot the default kernel.

*** Additional info:
This bug is similar to bug 746106. As discussed there, the problem is again that grub doesn't accept the UEFI device path node just before the HD() node:


(The above textual format is rendered by OVMF, not grub.) The VirtioBlkDxe driver produces the Block Io Protocol directly on top of the PCI devpath node. 

Therefore the fix is similar to the one seen in bug 746106.

Comment 2 Laszlo Ersek 2013-02-27 02:05:00 UTC
Created attachment 703232 [details]
(proposed patch) recognize virtio-blk on OVMF

The patch follows the GNU coding standards:

Comment 5 Václav Pavlín 2013-02-27 08:45:45 UTC
Hi Laszlo,

Thanks for the patch. I will consider it to the next release.

Comment 6 RHEL Program Management 2013-05-22 21:33:49 UTC
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.

Comment 11 Laszlo Ersek 2013-08-05 12:53:17 UTC
I'm confirming the fix. I upgraded grub from grub-0.97-81.el6 to grub-0.97-82.el6 in my OVMF-based RHEL-6 guest, downloading the latter build from Brew.

Then I shut down the guest, changed the disk bus from (virtio-)scsi to virtio(-blk) in virt-manager, and booted the guest again.

I had to update the boot option in the OVMF setup TUI (which was expected -- this step is necessary so that OVMF finds grub itself).

Afterwards grub booted the OS from the virtio-blk root disk. Thanks.

Comment 12 Pavel Holica 2013-10-09 11:11:16 UTC
Reproduced on RHEL6.4 x86_64 Client.
Verified fix on RHEL6.5-20131004.5 x86_64 Client.

Comment 14 errata-xmlrpc 2013-11-21 20:47:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.