Product SiteDocumentation Site

6.3.2. Reinstalling GRUB

In some cases, you may need to reinstall the GRUB bootloader itself. It might be because another operating system has overwritten GRUB, or because of some inadvertent action. This section explains how to do that, but if you do have a GRUB menu or GRUB prompt, you probably don't need to perform the operations. This section assumes that you have tried all of the firmware boot options, and are sure you do not have a functioning GRUB bootloader on your system.
Be careful not to mix up the different instructions for UEFI and legacy systems. Installing the wrong implementation of GRUB can cause problems that are difficult to resolve.
6.3.2.1. Reinstalling GRUB on UEFI systems.
Procedure 3. Reinstalling GRUB on UEFI systems.
  1. Enter your installed system in a chroot using the instructions in Section A.1, “Setting up a chroot from a live image”. Be sure to boot the live image in UEFI mode.
  2. Reinstall the packages that provide bootloader files. This will recreate any Fedora files missing from the EFI system partition.
    # yum reinstall grub2-efi shim
    
  3. Optionally, recreate the firmware boot entry. You only need to do this if the Fedora entry is missing, so check to see if the Fedora entry is present before continuing.
    Exit the chroot before creating the EFI boot entry.
    # exit
    
    1. Check the existing firmware boot entries.
      # efibootmgr -v
       BootCurrent: 0015 Timeout: 1 seconds BootOrder: 0015,0000 Boot0000* Windows Boot Manager HD(3,2e9a5000,32000,0d13443c-6bf1-4952-960c-c05ba2b3fd8c)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a............... Boot0015* Fedora HD(1,800,64000,211be689-9d4f-4034-bbc9-4e03372165db)File(\EFI\fedora\grubx64.efi) Boot0018* SATA : PORT 4 : HL-DT-ST BD-RE WH14NS40 BIOS(3,0,00)AMBO Boot0019* SATA : PORT 6G 0 : ST31500341AS : PART 0 : Boot Drive BIOS(2,0,00)AMBO 
      
    2. If the Fedora entry is missing, check the installation logs to get the command to put it back.
      # grep efibootmgr /var/log/anaconda/anaconda/program.log
       05:43:07,548 INFO program: Running... efibootmgr 05:43:07,566 INFO program: Running... efibootmgr -c -w -L Fedora -d /dev/sda -p 2 -l \EFI\fedora\shim.efi 
      
    3. Run the efibootmgr invocation again. If needed, adjust the arguments to fit your EFI system partition's location. In this example, -d /dev/sda places that partition on the /dev/sda, and -p 2 designates the second partition on the drive.
      # efibootmgr -c -w -L Fedora -d /dev/sda -p 2 -l \EFI\fedora\shim.efi
      
  4. Reboot your system into Fedora.