Chapter 9. Reinstalling GRUB


You can reinstall the GRUB boot loader to fix certain problems, usually caused by an incorrect installation of GRUB, missing files, or a broken system. You can resolve these issues by restoring the missing files and updating the boot information.

Reasons to reinstall GRUB:

  • Upgrading the GRUB boot loader packages.
  • Adding the boot information to another drive.
  • The user requires the GRUB boot loader to control installed operating systems. However, some operating systems are installed with their own boot loaders and reinstalling GRUB returns control to the desired operating system.
Note

GRUB restores files only if they are not corrupted.

9.1. Reinstalling GRUB on BIOS-based machines

You can reinstall the GRUB boot loader on your BIOS-based system. Always reinstall GRUB after updating the 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. Reinstall GRUB on the device where it is installed. For example, if sda is your device:

    # grub2-install /dev/sda
    Copy to Clipboard Toggle word wrap
  2. Reboot your system for the changes to take effect:

    # reboot
    Copy to Clipboard Toggle word wrap

9.2. Reinstalling GRUB on UEFI-based machines

You can 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:

    # yum reinstall grub2-efi shim
    Copy to Clipboard Toggle word wrap
  2. Reboot your system for the changes to take effect:

    # reboot
    Copy to Clipboard Toggle word wrap

9.3. Reinstalling GRUB on IBM Power machines

Reinstall the GRUB boot loader on the Power PC Reference Platform (PReP) boot partition of your IBM Power system. Always reinstall GRUB after updating the 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. Determine the disk partition that stores GRUB:

    # bootlist -m normal -o
    Copy to Clipboard Toggle word wrap
    sda1
    Copy to Clipboard Toggle word wrap
  2. Reinstall GRUB on the disk partition:

    # grub2-install partition
    Copy to Clipboard Toggle word wrap

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

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

    # reboot
    Copy to Clipboard Toggle word wrap

9.4. Resetting GRUB

Resetting GRUB removes all GRUB configuration files and system settings. It reinstalls the boot loader and restores all configuration settings to their default values. This process fixes failures caused by corrupted files and invalid configuration.

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
    Copy to Clipboard Toggle word wrap
  2. Reinstall packages.

    • On BIOS-based machines:

      # yum reinstall grub2-tools
      Copy to Clipboard Toggle word wrap
    • On UEFI-based machines:

      # yum reinstall grub2-efi shim grub2-tools grub2-common
      Copy to Clipboard Toggle word wrap
  3. Rebuild the grub.cfg file for the changes to take effect.

    • On BIOS-based machines:

      # grub2-mkconfig -o /boot/grub2/grub.cfg
      Copy to Clipboard Toggle word wrap
    • On UEFI-based machines:

      # grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
      Copy to Clipboard Toggle word wrap
  4. Follow Reinstalling GRUB procedure to restore GRUB on the /boot/ partition.
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2026 Red Hat
Volver arriba