boot – ExpLinux https://www.explinux.com Explore Linux How to, Tutorials, Unix, Updates, Technology. Tue, 18 May 2021 12:22:17 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.4 https://www.explinux.com/wp-content/uploads/2023/04/cropped-favicon-32x32-1-32x32.png boot – ExpLinux https://www.explinux.com 32 32 Grub2 files are missing from /boot. How to recover ? https://www.explinux.com/2021/02/grub2-files-are-missing-from-boot-how-to-recover.html https://www.explinux.com/2021/02/grub2-files-are-missing-from-boot-how-to-recover.html#respond Tue, 23 Feb 2021 02:13:00 +0000 Grub2 files are missing from /boot. How to recover ? Read More »

]]>
Repair Grub2

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.

Environment

  • Red Hat Enterprise Linux 7 
  • CentOS 7
  • RHEL 8

Issue

  • Missing the ‘/boot’, grub folder, and grub.conf file which are essential to boot the system.
  • How to recover missing boot files ?

Resolution

  • Verify Boot directory contents are really missing or the /boot is not mounted properly :
#ls /boot/grub2/
  • Install grub2:
#grub2-install /dev/<disk name>
  • Create grub.cfg file:
#grub2-mkconfig -o /boot/grub2/grub.cfg
  • Create device.map file if missing:
#vi /boot/grub2/device.map

(hd0) /dev/<disk name>
  • Reboot
Now the server or PC  will boot properly. In this article, we have learned the way to recover grub and save it from reinstallation.
]]>
https://www.explinux.com/2021/02/grub2-files-are-missing-from-boot-how-to-recover.html/feed 0