Connect with us

Hi, what are you looking for?

Linux

How to Reinstall the GRUB2 Boot Loader on CentOS 7

How to Reinstall the Deleted / Corrupted / Replaced GRUB2 Boot Loader on CentOS 7 / RHEL 7 / SL 7 / OL 7. The GRUB2 is the default boot loader for Enterprise Linux 7.  GRUB2 boot loader is the most important part of any Enterprise Linux. Most important thing it is used by millions. If the GRUB2 boot loader is Deleted / Corrupted / Replaced by any other OS then this guide provide you fix for this issues with ease. This tutorial shows the step by step methods that applies quickly and easily to fix this issue for your enterprise Linux.

How to Reinstall the GRUB2 Boot Loader on EL 7

Step-1 (Check the default location GRUB2 configuration files)
[root@techbrown ~]# rpm -qc grub2-tools
Sample Output
/etc/default/grub
/etc/grub.d/00_header
/etc/grub.d/10_linux
/etc/grub.d/20_linux_xen
/etc/grub.d/20_ppc_terminfo
/etc/grub.d/30_os-prober
/etc/grub.d/40_custom
/etc/grub.d/41_custom
Step-2 (Remove the Default GRUB2 configuration file)
[root@techbrown ~]# rm -rf /etc/default/grub
Step-3 (Remove the grub2-tools configuration files)
[root@techbrown ~]# rm -rf /etc/grub.d/*
Step-4 (Reinstall the GRUB2 using yum command)
[root@techbrown ~]# yum reinstall grub2-tools
Step-5 (Regenerate and save the GRUB2 configuration file)
[root@techbrown ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Sample Output
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-7e890c03ebb940a9a67163adaef14894
Found initrd image: /boot/initramfs-0-rescue-7e890c03ebb940a9a67163adaef14894.img
done

Final Words

That’s all finally you have fixed and reinstalled the damaged / corrupted GRUB2 boot loader using the above steps. If you have issues regarding this topic then you have to use the comment section below.

Comments
Advertisement
Advertisement
Advertisement

You May Also Like

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Windows

Internet is the most important public network for connecting to the WEB. For internet connection requirement the ISP is required as well as it...

Windows

How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...

Windows

How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...