RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2049220 - Cannot EFI chainload onto local disk when EFI partition is in Software Raid
Summary: Cannot EFI chainload onto local disk when EFI partition is in Software Raid
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: grub2
Version: unspecified
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Bootloader engineering team
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On: 2048904
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-01 18:23 UTC by Robbie Harwood
Modified: 2022-05-17 16:14 UTC (History)
7 users (show)

Fixed In Version: grub2-2.06-24.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2048904
Environment:
Last Closed: 2022-05-17 15:51:03 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-110610 0 None None None 2022-02-01 18:25:04 UTC
Red Hat Issue Tracker RTT-4240 0 None None None 2022-02-14 14:44:59 UTC
Red Hat Issue Tracker RTT-4241 0 None None None 2022-02-14 14:45:06 UTC
Red Hat Product Errata RHBA-2022:3925 0 None None None 2022-05-17 15:51:08 UTC

Description Robbie Harwood 2022-02-01 18:23:36 UTC
+++ This bug was initially created as a clone of Bug #2048904 +++

Description of problem:

We have a customer deploying systems using Upstream Satellite product.
All his systems are on UEFI and boot through the network, loading Grub2 and a configuration file used to chainload to the local disk of the system, similar to this excerpt below:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
menuentry 'Chainload Grub2 EFI from ESP' --id local {
  unset root
  # search for local disk EFI partition
  search --file --no-floppy --set=root /EFI/BOOT/BOOTX64.EFI
  echo found $root
  # select the right local disk bootloader
  if [ -f ($root)/EFI/BOOT/grubx64.efi ]; then
    chainloader ($root)/EFI/BOOT/grubx64.efi
  elif [ -f ($root)/EFI/fedora/grubx64.efi ]; then
    chainloader ($root)/EFI/fedora/grubx64.efi
  ...
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

When the system has its EFI partition in Software Raid, the "search --file" command returns "md/boot_efi" device as new root device, which prevents "chainloader" command from working because the device is not a EFI disk but a virtual device, which is not supported by the "chainloader" command.

The solution consists in adding a new "--efidisk-only" option to "search" to limit searching for EFI disks only:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
search --file --no-floppy --efidisk-only --set=root /EFI/BOOT/BOOTX64.EFI
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


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

all grub releases


How reproducible:

Always

Steps to Reproduce:
1. Setup a VM with EFI and softraid
2. Boot the VM from the network using chainloading grub.cfg above

Actual results:

"not a valid root device" error

Expected results:

can chainload

Additional info:

A partial workaround consists in adding a "--hint-efi" on the various disks making the softraid, e.g. "--hint-efi=hd0, --hint-efi=hd1," but this doesn't always work because there is no way to avoid "search" from returning the softraid.

--- Additional comment from Renaud Métrich on 2022-02-01 05:39:36 EST ---



--- Additional comment from Renaud Métrich on 2022-02-01 05:46:43 EST ---

Upstream thread: https://lists.gnu.org/archive/html/grub-devel/2022-02/msg00001.html

Comment 8 Renaud Métrich 2022-02-28 07:59:54 UTC
Verified on grub2-2.06-24.el9:


grub.cfg:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
ls

search --file --set=root1 /EFI/BOOT/BOOTX64.EFI
echo "Normal search: $root1"

search --file --efidisk-only --set=root2 /EFI/BOOT/BOOTX64.EFI
echo "efidisk-only search: $root2"
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Grub output:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
(proc) (hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1) (hd2) (hd2,msdos2) (lvm/rhel-root) (lvm/rhel-swap) (md/pv00) (md/boot_efi) (md/boot) 

Normal search: md/boot_efi
efidisk-only search: hd0,gpt2
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 9 Jan Stodola 2022-02-28 12:36:26 UTC
Thank you for verification, Renaud.
Marking as Verified:Tested.

Comment 16 errata-xmlrpc 2022-05-17 15:51:03 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 (new packages: grub2), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHBA-2022:3925


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