Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2189087

Summary: EFI grub.cfg wrapper doesn't always execute properly, leading to getting "grub>" prompt
Product: Red Hat Enterprise Linux 9 Reporter: Renaud Métrich <rmetrich>
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED MIGRATED QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.1CC: mlewando, sbarcomb
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-16 19:10:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Renaud Métrich 2023-04-24 07:18:19 UTC
Description of problem:

With RHEL9, the /boot/efi/EFI/redhat/grub.cfg file is now a wrapper redirecting to unified configuration file /boot/grub2/grub.cfg.
It appears that the wrapper can fail to find /boot partition (or / if /boot and / are merged). This especially happens if /boot/efi is on its own disk (e.g. /dev/vda) while the rest is on another disk (e.g. /dev/vdb).

The root cause is EFI firmware didn't plumb all disks, but only the one hosting /boot/efi.

This happens at least with VMWare at hardware level 19 and QEMU/KVM (Fedora 37).

The solution is to add the following stanza before searching for the device:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
connectefi scsi
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

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

grub2-common-2.06-46.el9.noarch and later

How reproducible:

Always

Steps to Reproduce:
1. Create a QEMU/KVM VM with 2 disks

  vda: 1GB, which will host /boot/efi
  vdb: 10GB, which will host the rest

2. Install the system making sure /boot/efi is on vda and the rest on vdb
3. Poweroff the system once installation complete (don't just reboot)

4. Boot the system on disk

Actual results:

Grub prompt

Expected results:

System boots

Additional info:

At Grub prompt we can see only vda is connected, preventing /boot from being found:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
grub> ls
(proc) (hd0) (hd0,gpt1) 

grub> cat /efi/redhat/grub.cfg
grub> cat /efi/redhat/grub.cfg
search --no-floppy --fs-uuid --set=dev f2ed30fe-ff8d-44bc-9b06-342f4f31f6b1
set prefix=($dev)/grub2

export $prefix
configfile $prefix/grub.cfg

grub> search --no-floppy --fs-uuid --set=dev f2ed30fe-ff8d-44bc-9b06-342f4f31f6b1
error: ../../grub-core/commands/search.c:315:no such device: f2ed30fe-ff8d-44bc-9b06-342f4f31f6b1.
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

After executing "connectefi scsi", the partition is found:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
grub> connectefi scsi
grub> ls                                                                         
(proc) (hd0) (hd0,gpt1) (hd1) (hd1,gpt2) (hd1,gpt1) (cd0) (cd0,msdos2) (lvm/rhel-swap) (lvm/rhel-root) 
grub> search --no-floppy --fs-uuid --set=dev f2ed30fe-ff8d-44bc-9b06-342f4f31f6b1
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 1 Marta Lewandowska 2023-05-23 08:38:23 UTC
Reproduced following the description.

# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    253:0    0    1G  0 disk 
└─vda1 253:1    0 1022M  0 part /boot/efi
vdb    253:16   0   10G  0 disk 
├─vdb1 253:17   0    1G  0 part /boot
├─vdb2 253:18   0    4G  0 part [SWAP]
└─vdb3 253:19   0    5G  0 part /

or (autopart with two disks as long as /boot/efi and /boot are on different disks)

# lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda           252:0    0    1G  0 disk 
├─vda1        252:1    0  292M  0 part /boot/efi
└─vda2        252:2    0  730M  0 part 
  └─rhel-root 253:0    0  8.6G  0 lvm  /
vdb           252:16   0   10G  0 disk 
├─vdb1        252:17   0    1G  0 part /boot
└─vdb2        252:18   0    9G  0 part 
  ├─rhel-root 253:0    0  8.6G  0 lvm  /
  └─rhel-swap 253:1    0  1.1G  0 lvm  [SWAP]

And verified that your fix works, Renaud. Thanks for that.

Comment 2 RHEL Program Management 2023-09-16 19:05:16 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 3 RHEL Program Management 2023-09-16 19:10:31 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.