13.4. Resetting GRUB
Resetting GRUB completely removes all GRUB configuration files and system settings, and reinstalls the boot loader. You can reset all the configuration settings to their default values, and therefore fix failures caused by corrupted files and invalid configuration.
The following procedure will remove all the customization made by the user.
Procedure
Remove the configuration files:
# rm /etc/grub.d/* # rm /etc/sysconfig/grubReinstall packages.
On BIOS-based machines:
# dnf reinstall grub2-pc grub2-toolsOn UEFI-based machines:
# dnf reinstall grub2-efi shim grub2-tools grub2-common
Rebuild the
grub.cfgfile for the changes to take effect:# grub2-mkconfig -o /boot/grub2/grub.cfgThis applies to both, BIOS and UEFI based systems.
警告The path to rebuild
grub.cfgis same for both BIOS and UEFI based machines. Actualgrub.cfgis present at BIOS path only. The UEFI path has a stub file that must not be modified or recreated usinggrub2-mkconfigcommand.-
Follow Reinstalling GRUB procedure to restore GRUB on the
/boot/partition.