Grub2 or Boot Repair
Due to some file corruption or mishandling we lost grub. This can cause the system to hang in the boot.
When you reboot the system it will not boot, So before rebooting the system check this file is in place or not. If you accidentally rebooted and the system is unable to boot then boot the server in rescue mode and follow the below steps.
- Red Hat Enterprise Linux 7
- CentOS 7
- RHEL 8
- Missing the ‘/boot’, grub folder, and grub.conf file which are essential to boot the system.
- How to recover missing boot files ?
- Verify Boot directory contents are really missing or the /boot is not mounted properly :
#grub2-install /dev/<disk name>
#grub2-mkconfig -o /boot/grub2/grub.cfg
- Create device.map file if missing:
(hd0) /dev/<disk name>
Now the server or PC will boot properly. In this article, we have learned the way to recover grub and save it from reinstallation.