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 1737444 - Executing grub2-install on a UEFI system prevents the system from booting
Summary: Executing grub2-install on a UEFI system prevents the system from booting
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: grub2
Version: 8.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Jan Hlavac
QA Contact: Release Test Team
URL:
Whiteboard:
: 1655673 1830866 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-05 11:30 UTC by Renaud Métrich
Modified: 2021-05-18 14:59 UTC (History)
6 users (show)

Fixed In Version: grub2-2.02-92.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 14:59:39 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Renaud Métrich 2019-08-05 11:30:32 UTC
Description of problem:

On a UEFI system, executing "grub2-install" creates a new "red" directory under /boot/efi/EFI with a single file "grubx64.efi" in it (no "grub.cfg", "grubenv", etc). It also changes the boot order to boot on that new "red" entry.

This causes the next reboots to fail switching root. This seems due to having the kernel properly loaded but with no other parameters such as the root device:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
[FAILED]Failed to start Switch Root.
...

(dracut emergency prompt)
:/# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-80.7.1.el8_0.x86_64
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


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

grub2-tools-2.02-66.el8.x86_64


How reproducible:

Always

Steps to Reproduce:
1. Execute "grub2-install"

  # grub2-install

2. Reboot

Actual results:

Failure to boot


Expected results:

No issue booting


Additional info:

Expected cmdline when booting properly:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-80.7.1.el8_0.x86_64 root=/dev/mapper/rhel-root ro resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap console=tty0 console=ttyS0,115200n8 console=tty0 console=ttyS0,115200n8
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

To recover the system, /boot/efi/EFI/red directory needs to be removed or boot order modified.

Comment 1 Petr Janda 2020-06-04 14:03:10 UTC
As far as I know, using grub2-install is not supported method for setting bootloader up. But I agree that it shouldn't break anything. So I think we want to warn user and not break anything, but it is not supposed to do everything what user requests. Because even in case correct installation etc. it still will break secure boot system due it rewrites shim binary.
Anyway, I will try to reproduce it and provide qa_ack.

Comment 2 Petr Janda 2020-06-04 15:38:14 UTC
It is not reproducible with grub2-tools 2.02-81.el8 on RHEL-8.2.0-20200404.0-x86_64
grub2-install fails with
"grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory."
message.
Will try it again with older version or different parameters.

Comment 3 Javier Martinez Canillas 2020-06-04 16:02:40 UTC
(In reply to Petr Janda from comment #2)
> It is not reproducible with grub2-tools 2.02-81.el8 on
> RHEL-8.2.0-20200404.0-x86_64
> grub2-install fails with
> "grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist.
> Please specify --target or --directory."
> message.
> Will try it again with older version or different parameters.

Yes, you need to install the grub2-efi-x64-modules package to run grub2-install on an EFI installation.

Comment 4 Petr Janda 2020-06-05 14:28:32 UTC
Thank you Javier,
after installing grub2-efi-x64-modules package it breaks system as reported.
Reproduced on released RHEL-8.2 x86_64
grub2-tools-2.02-81.el8

Comment 5 Javier Martinez Canillas 2020-06-30 16:11:05 UTC
*** Bug 1830866 has been marked as a duplicate of this bug. ***

Comment 17 Petr Janda 2020-11-30 11:32:01 UTC
tested on RHEL-8.4.0-20201128
on UEFI system grub2-install prints error message and exits with exit code 1
on BIOS system it works as expected

Comment 18 Jan Hlavac 2021-02-22 11:30:16 UTC
*** Bug 1655673 has been marked as a duplicate of this bug. ***

Comment 20 errata-xmlrpc 2021-05-18 14:59:39 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 (grub2 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/RHBA-2021:1648


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