Show Table of Contents
25.7. 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.
25.7.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
25.7.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 shim25.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:
- Run the
rm /etc/grub.d/*command; - Run the
rm /etc/sysconfig/grubcommand; - For EFI systems only, run the following command:
~]#
yum reinstall grub2-efi shim grub2-tools - For BIOS and EFI systems, run this command:
~]#
yum reinstall grub2-tools - Rebuild the
grub.cfgfile by running thegrub2-mkconfigcommand as follows:-o- 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/redhat/grub.cfg
- Now follow the procedure in Section 25.7, “Reinstalling GRUB 2” to restore GRUB 2 on the
/boot/partition.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.