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 1680572

Summary: Installing grub2-efi and efi-filesystem on BIOS enabled system fails with errot "Failed to Start Switch Root"
Product: Red Hat Enterprise Linux 8 Reporter: Steffen Froemer <sfroemer>
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: bnater, fmartine, jstransk, pdwyer, pkotvan, rpbikker, yferszt, zveleba
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: grub2-2.02-68.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 22:24:10 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:
Bug Depends On:    
Bug Blocks: 1647562, 1708241, 1727807, 1749310    

Description Steffen Froemer 2019-02-25 10:45:24 UTC
Description of problem:
On installing the package grub2-efi-x64 and dependency efi-filesystem will break the whole system, when running on a BIOS based system.


Version-Release number of selected component (if applicable):
grub2-common-2.02-57.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create KVM virtual machine with BIOS
2. Install RHEL8
3. yum install -y grub2-efi-x64
4. reboot

Actual results:
The system will break on next startup with error "Failed to Start Switch Root"

Expected results:
Boot should be possible

Additional info:
Installing EFI packages in RHEL7 was possible

Comment 1 Steffen Froemer 2019-02-25 10:53:36 UTC
[    2.242366] hostname systemd[1]: Reached target Switch Root.
[    2.245408] hostname systemd[1]: Starting Switch Root...
[    2.252419] hostname systemctl[543]: Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.
[    2.252846] hostname systemd[1]: initrd-switch-root.service: Main process exited, code=exited, status=1/FAILURE
[    2.253084] hostname systemd[1]: initrd-switch-root.service: Failed with result 'exit-code'.
[    2.253357] hostname systemd[1]: Failed to start Switch Root.
[    2.253461] hostname systemd[1]: Startup finished in 1.012s (kernel) + 0 (initrd) + 1.240s (userspace) = 2.253s.
[    2.253503] hostname systemd[1]: initrd-switch-root.service: Triggering OnFailure= dependencies.

Comment 3 Branislav NĂ¡ter 2019-03-15 14:22:51 UTC
I've also hit this issue.

Before grub2-efi-x64 was installed:
# grubby --info=ALL
index=0
kernel="/boot/vmlinuz-4.18.0-80.el8.x86_64"
args="ro console=tty0 console=ttyS0,115200 crashkernel=auto net.ifnames=0 rhgb quiet $tuned_params"
root="UUID=e347354c-71db-4bd1-9f19-df60a190c747"
initrd="/boot/initramfs-4.18.0-80.el8.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (4.18.0-80.el8.x86_64) 8.0 (Ootpa)"
id="111a2b89c187491883fe7c73e40ec958-4.18.0-80.el8.x86_64"

After grub2-efi-x64 installation:
# grubby --info=ALL
index=0
kernel="/boot/vmlinuz-4.18.0-80.el8.x86_64"
args="$kernelopts $tuned_params"
initrd="/boot/initramfs-4.18.0-80.el8.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (4.18.0-80.el8.x86_64) 8.0 (Ootpa)"
id="111a2b89c187491883fe7c73e40ec958-4.18.0-80.el8.x86_64"

root is missing. This issue isn't present on rhel-7

Comment 4 Javier Martinez Canillas 2019-03-15 16:59:38 UTC
The problem is that the grub2-efi-x64 package creates a /boot/grub2/grubenv symlink that points to /boot/efi/EFI/redhat/grubenv. So the /boot/grub2/grubenv file is overwritten with a broken symlink.

This issue was also present in RHEL-7.6, but the difference is that in RHEL-8.0 the kernel cmdline is defined in the grubenv file so it has a bigger consequence in this case.

Comment 6 Reinier Bikker 2019-06-04 16:27:59 UTC
Using this symlink in /boot/grub2/ is incorrect anyway. /boot/efi, if it exists, must be VFAT partition, while /boot is supposed to be ext2 or ext4. A symlink to a different partition will be unreadable for grub at boottime.

Fedora 30 is also hit by this mistake. See bug 1716193.

Comment 7 Zdenek Veleba 2019-08-05 10:12:07 UTC
Verified with grub2-2.02-74, RHEL-8.1.0-20190701.0

Comment 9 errata-xmlrpc 2019-11-05 22:24: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.

https://access.redhat.com/errata/RHBA-2019:3587