Chapter 15. Reinstalling GRUB


Reinstall the GRUB boot loader to resolve issues caused by incorrect installation, missing files, or system corruption. Reinstalling GRUB is also necessary when upgrading packages, adding boot information to another drive, or restoring control over installed operating systems.

Note

GRUB restores files only if they are not corrupted.

15.1. Reinstalling GRUB on BIOS-based machines

To ensure your BIOS-based system remains functional at startup, reinstall the GRUB boot loader on the system after updating GRUB packages.

Important

This overwrites the existing GRUB to install the new GRUB. Ensure that the system does not cause data corruption or boot crash during the installation.

Procedure

  1. Install grub2-pc:

    # grub2-pc
  2. Reinstall GRUB on the device where it is installed. For example, if sda is your device:

    # grub2-install /dev/sda
  3. Reboot your system for the changes to take effect:

    # reboot

    See the grub2-pc(8) man page on your system for more information.

15.2. Reinstalling GRUB on UEFI-based machines

To resolve boot issues, reinstall the GRUB boot loader on your UEFI-based system.

Important

Ensure that the system does not cause data corruption or boot crash during the installation.

Procedure

  1. Reinstall the grub2-efi and shim boot loader files:

    # dnf reinstall grub2-efi-x64 shim
  2. Reboot your system for the changes to take effect:

    # reboot

15.3. Reinstalling GRUB on IBM Power machines

To maintain system bootability on IBM Power systems, reinstall the GRUB boot loader on the Power PC Reference Platform (PReP) boot partition after updating GRUB packages.

Important

This overwrites the existing GRUB to install the new GRUB. Ensure that the system does not cause data corruption or boot crash during the installation.

Procedure

  1. List the disk partition that stores GRUB:

    # bootlist -m normal -o
    sda1
  2. Reinstall GRUB on the disk partition:

    # grub2-install partition

    Replace partition with the identified GRUB partition, such as /dev/sda1.

  3. Reboot your system for the changes to take effect:

    # reboot

    See the grub-install(1) man page on your system for more information.

15.4. Resetting 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.

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.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top