Friday, May 3, 2019

RHEL7 - Recover /boot partition on CentOS 7

How to recover /boot partition on CentOS 7?
 [ RHEL7 = CentOS]
If some reason /boot partition is not available, system is not able to boot.
Perform the following tasks below to recover your system.

1. Boot your system using CentOS iso image. You can burn it on DVD/USB and boot off it. Read hardware specific guide on how to mount ISO image and boot the IS.

2. Up on reboot, you will see three options on whic one of them is "Troublessoting". Select it and press enter to continue.

3. Select the option "Rescue a CentOS system" and press enter and enter again to continue

4. Specify Option 1 and press enter to continue..

5. Now, you are on rescue mode. Now, chroot to sysimage to troubleshoot
# chroot /mnt/sysimage

6. Now, you have to install three packages to troubleshoot
a. kernel
b. grub
c. logos

7. Go to package lcation and install them
# cd /mnt/Packages
# ls -l | egrep "kernel-|grub2-|logos"
# rpm -ivh --force groub-...... groub2-2...... centos-logos-.....

for redhat use redhat-logos

8. Install grub on your boot disk. Here is a tricky part. Find your boot device. Most of the case it is /dev/sda.
if you have multi disk
# grub2-install /dev/sda

if thats not the right disk tryp cfdisk command
# cfdisk /dev/sda ..sdb


9. Now, finally, generate grub.cfg file
# grub2-mkconfig -o /boot/grub2/grub.cfg

Exit twice to reboot the server.

system should be coming up fine..

if not, contact your best friend, which is google, or bing

No comments:

Post a Comment