Product SiteDocumentation Site

21.7.3. Resetting and Reinstalling GRUB 2

This method completely removes all GRUB 2 configuration files and system settings. Apply this method to reset all configuration settings to their default values. Removing of the configuration files and subsequent reinstalling of GRUB 2 fixes failures caused by corrupted files and incorrect configuration. To do so, as root, follow these steps:
  1. Run the rm /etc/grub.d/* command;
  2. Run the rm /etc/sysconfig/grub command;
  3. For EFI systems only, run the following command:
    ~]# dnf reinstall grub2-efi shim grub2-tools
  4. Rebuild the grub.cfg file by running the grub2-mkconfig -o command as follows:
    • On BIOS-based machines, issue the following command as root:
      ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
    • On UEFI-based machines, issue the following command as root:
      ~]# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
  5. Now follow the procedure in Section 21.7, “Reinstalling GRUB 2” to restore GRUB2 on the /boot/ partition.