Bug 1220066 - grub2-install suggestion doesn't distinguish between BIOS and UEFI installs
Summary: grub2-install suggestion doesn't distinguish between BIOS and UEFI installs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora Documentation
Classification: Fedora
Component: system-administrator's-guide
Version: devel
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Stephen Wadeley
QA Contact: Fedora Docs QA
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-09 18:24 UTC by Chris Murphy
Modified: 2016-06-10 06:54 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-10 00:39:45 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1344528 0 unspecified CLOSED [RFE] Running grub2-install on EFI, provide script or method to notify user or abort 2021-02-22 00:41:40 UTC

Internal Links: 1344528

Description Chris Murphy 2015-05-09 18:24:41 UTC
ttps://docs.fedoraproject.org/en-US/Fedora/21/html/System_Administrators_Guide/sec-Reinstalling_GRUB_2.html#sec-Using_the_grub2-install_Command

Section 20.4 and 20.4.1 apply only to BIOS computers, not UEFI. On UEFI:
1. grub2-install fails
https://bugzilla.redhat.com/show_bug.cgi?id=1101352
2. If grub2-efi-modules is installed, grub2-install succeeds but then:
2a. This will break UEFI Secure Boot systems because the core.img/grubx64.efi binary that gets created isn't signed and therefore UEFI Secure Boot will reject it.
2b. On UEFI systems without Secure Boot, GRUB behavior is different in a number of ways including that it will no longer look to /boot/efi/EFI/fedora/grub.cfg but rather to /boot/grub2/grub.cfg.

Two ways to fix the documentation:
a.) A side bar that says this section doesn't apply to systems with UEFI firmware (maybe a link to where we give them a hint "how to find out what kind of firmware you have"), and/or that this section is effectively done by 20.4.2 step 3.
b.) Reorganize 20.4 into discreet BIOS and UEFI sections.

Comment 1 Stephen Wadeley 2015-05-11 07:20:07 UTC
Hello Chris


Thank you for raising this bug:

Link to doc:
http://docs.fedoraproject.org/en-US/Fedora/21/html/System_Administrators_Guide/sec-Resetting_and_Reinstalling_GRUB_2.html

Comment 2 Stephen Wadeley 2015-05-14 13:48:25 UTC
Hello

Proposed change:


20.4. Reinstalling GRUB 2
Reinstalling GRUB 2 is a convenient way to fix certain problems usually caused by an incorrect installation of GRUB 2, missing files, or a broken system. Other reasons to reinstall GRUB 2 include the following:

    Upgrading from the previous version of GRUB.
    The user requires the GRUB 2 boot loader to control installed operating systems. However, some operating systems are installed with their own boot loaders. Reinstalling GRUB 2 returns control to the desired operating system.
    Adding the boot information to another drive. 

⁠20.4.1. Reinstalling GRUB 2 on BIOS-Based Machines
When using the yum grub2-install command, the boot information is updated and missing files are restored. Note that the files are restored only if they are not corrupted.
Use the yum grub2-install <device> command to reinstall GRUB 2 if the system is operating normally. For example:

~]# yum grub2-install /dev/sda

⁠20.4.2. Reinstalling GRUB 2 on UEFI-Based Machines
When using the yum reinstall grub2-efi command, the boot information is updated and missing files are restored. Note that the files are restored only if they are not corrupted.
Use the yum reinstall grub2-efi <device> command to reinstall GRUB 2 if the system is operating normally. For example:

~]# yum reinstall grub2-efi /dev/sda

Comment 3 Chris Murphy 2015-05-14 15:51:55 UTC
Delete the yum reference in section 20.4.1. The correct command is:
# grub2-install /dev/sdX            ## (where X is the applicable drive letter)

Add shim to, and remove /dev/sda from, the reinstall commend in section 20.4.2. The correct command is:
# yum reinstall grub2-efi shim      ## Fedora 21 and older
# dnf reinstall grub2-efi shim      ## Fedora 22 and newer

Comment 4 Stephen Wadeley 2015-05-14 19:16:49 UTC
Hello

Thank you for comment 3

I will use:

20.4.1. Reinstalling GRUB 2 on BIOS-Based Machines
When using the grub2-install command, the boot information is updated and missing files are restored. Note that the files are restored only if they are not corrupted.
Use the grub2-install device command to reinstall GRUB 2 if the system is operating normally. For example, if sda is your device:

~]# grub2-install /dev/sda

⁠20.4.2. Reinstalling GRUB 2 on UEFI-Based Machines
When using the yum reinstall grub2-efi command, the boot information is updated and missing files are restored. Note that the files are restored only if they are not corrupted.
Use the yum reinstall grub2-efi shim command to reinstall GRUB 2 if the system is operating normally. For example:

~]# yum reinstall grub2-efi shim

-----------------

I will do the yum to dnf changes as a separate commit

Thank you

Comment 5 Stephen Wadeley 2015-05-14 19:28:47 UTC
errr, I missed one "shim" in "When using the yum reinstall grub2-efi command"

20.4.1. Reinstalling GRUB 2 on BIOS-Based Machines
When using the grub2-install command, the boot information is updated and missing files are restored. Note that the files are restored only if they are not corrupted.
Use the grub2-install device command to reinstall GRUB 2 if the system is operating normally. For example, if sda is your device:

~]# grub2-install /dev/sda

⁠20.4.2. Reinstalling GRUB 2 on UEFI-Based Machines
When using the yum reinstall grub2-efi shim command, the boot information is updated and missing files are restored. Note that the files are restored only if they are not corrupted.
Use the yum reinstall grub2-efi shim command to reinstall GRUB 2 if the system is operating normally. For example:

~]# yum reinstall grub2-efi shim

Comment 6 Stephen Wadeley 2015-05-14 19:43:54 UTC
commit da159560f733d2bd44479dd3452a52d67579630e
Author: Stephen Wadeley <swadeley>
Date:   Thu May 14 21:30:06 2015 +0200

    grub2 install distinguish BIOS and UEFI
    
    Bug 1220066 - grub2-install suggestion doesn't distinguish between BIOS
    and UEFI installs
    Thank you Chris Murphy for raising this bug.
    Thank you Peter Jones for advice.

Comment 7 Chris Murphy 2015-05-14 19:54:24 UTC
Should this section point to a section or a concise tip/sidebar on how to identify firmware type? Opened new bug 1221780 to track that question separately.

Comment 8 Chris Murphy 2015-05-14 19:55:47 UTC
Oops.

Comment 9 Stephen Wadeley 2015-05-28 14:30:51 UTC
Hello

This is now live in Fedora 22 version.

See: http://docs.fedoraproject.org/en-US/Fedora/22/html/System_Administrators_Guide/sec-Reinstalling_GRUB_2.html

Please feel free to reopen this bug if more work is need on the section.

The commit is in the 21 branch as well in case we need to republish that guide.


Thank you

Comment 10 Noel McLoughlin 2016-02-28 23:32:53 UTC
Hi Stephen,

Very good documentation! Could you add grub2-tools to step 3 to compensate for step1 deletion of "/etc/grub.d/*" contents?

       3. For EFI systems only, run the following command:

          ~]# yum reinstall grub2-efi shim grub2-tools


thank you.

Comment 11 Noel McLoughlin 2016-02-28 23:34:35 UTC
I encountered the issue on Centos7 but grub2-tools delivers /etc/grub.d/* files on Fedora rawhide also so assume fix works there also.

Comment 13 Chris Murphy 2016-02-29 18:34:00 UTC
Hmm 20.4.3 contains stale information.
https://bugzilla.redhat.com/show_bug.cgi?id=1313022

I think the section 20.4.3 concerns are better off in that bug since this one was closed.

Comment 14 Noel McLoughlin 2016-02-29 19:43:12 UTC
Thanks Chris. Reverting to closed->currentrelease

Comment 15 Shawn Starr 2016-06-10 00:21:21 UTC
I do not think just adding documentation is a good fix. Users running grub2-install should be told that using GRUB2's EFI boot loader is not supported on Fedora and gracefully exit (or provide an override).

Documentation is fine but users are not going to be looking at documentation when they run the command.

Reopening, a proper solution is have a script in grub.d that can notify the user they can't run grub2-install because this will break their booting.

Comment 16 Chris Murphy 2016-06-10 00:39:45 UTC
Opened a new bug. Closing this one again.

Comment 17 Stephen Wadeley 2016-06-10 06:54:39 UTC
(In reply to Chris Murphy from comment #16)
> Opened a new bug. Closing this one again.

Thank you


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