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 2048904 - 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 8
Classification: Red Hat
Component: grub2
Version: 8.5
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Bootloader engineering team
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On: 2060948 2061252
Blocks: 2049220
TreeView+ depends on / blocked
 
Reported: 2022-02-01 06:45 UTC by Renaud Métrich
Modified: 2022-05-10 16:58 UTC (History)
8 users (show)

Fixed In Version: grub2-2.02-117.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2049220 (view as bug list)
Environment:
Last Closed: 2022-05-10 15:31:42 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch to Upstream (5.09 KB, patch)
2022-02-01 10:39 UTC, Renaud Métrich
no flags Details | Diff
Patch improving error message (not in Upstream project) (2.14 KB, patch)
2022-02-15 13:15 UTC, Renaud Métrich
no flags Details | Diff
Proposed patch to Upstream (5.48 KB, patch)
2022-02-15 13:16 UTC, Renaud Métrich
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-110492 0 None None None 2022-02-01 06:48:31 UTC
Red Hat Issue Tracker RTT-4236 0 None None None 2022-02-14 14:44:27 UTC
Red Hat Issue Tracker RTT-4237 0 None None None 2022-02-14 14:44:33 UTC
Red Hat Product Errata RHSA-2022:2110 0 None None None 2022-05-10 15:32:26 UTC

Description Renaud Métrich 2022-02-01 06:45:16 UTC
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.

Comment 1 Renaud Métrich 2022-02-01 10:39:36 UTC
Created attachment 1858328 [details]
Proposed patch to Upstream

Comment 2 Renaud Métrich 2022-02-01 10:46:43 UTC
Upstream thread: https://lists.gnu.org/archive/html/grub-devel/2022-02/msg00001.html

Comment 6 Renaud Métrich 2022-02-15 13:15:42 UTC
Created attachment 1861221 [details]
Patch improving error message (not in Upstream project)

Comment 7 Renaud Métrich 2022-02-15 13:16:37 UTC
Created attachment 1861222 [details]
Proposed patch to Upstream

Comment 9 Renaud Métrich 2022-02-15 13:20:34 UTC
Upstream thread: https://lists.gnu.org/archive/html/grub-devel/2022-02/msg00075.html

Comment 12 Renaud Métrich 2022-02-28 08:00:50 UTC
Verified on grub2-2.02-117.el8:

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 13 Jan Stodola 2022-02-28 11:40:27 UTC
Thank you for verification, Renaud.
Marking as Verified:Tested.

Comment 22 errata-xmlrpc 2022-05-10 15:31:42 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 (Low: grub2 security, bug fix, and enhancement update), 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/RHSA-2022:2110


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