Reset GRUB

To fix boot failures caused by corrupted files or invalid configurations, reset GRUB. This process removes current settings and reinstalls the boot loader with default values.

About this task

Important

The following procedure will remove all the customization made by the user.

Procedure

  1. Remove the configuration files:
    # rm /etc/grub.d/*
    # rm /etc/sysconfig/grub
  2. Reinstall packages.
    • On BIOS-based machines:
      # dnf reinstall grub2-pc grub2-tools
    • On UEFI-based machines:
      # dnf reinstall grub2-efi shim grub2-tools grub2-common
  3. Rebuild the grub.cfg file for the changes to take effect:
    # grub2-mkconfig -o /boot/grub2/grub.cfg

    This applies to both, BIOS and UEFI based systems.

    Warning

    The path to rebuild grub.cfg is same for both BIOS and UEFI based machines. Actual grub.cfg is present at BIOS path only. The UEFI path has a stub file that must not be modified or recreated using grub2-mkconfig command.

  4. Follow Reinstalling GRUB procedure to restore GRUB on the /boot/ partition.