How to recover broken grub2 boot on SLES15
Posted on Wed, Nov 25, 2020 at 12:28 by Hubertus A. Haniel
I am currently having issues where the boot of one of my VM's gets corrupted and I frequently have to recover it - I sometimes miss out mounting one of the required mount points so I noted them here to jolt my memory mainly but they may be helpful for others......
These are the steps I currently follow to recover the boot sector:
- - Boot the system from the DVD or PXE into rescue mode
- Mount the existing root file system under /mnt which is on /dev/rootvg/rootlv using "mount /dev/rootvg/rootlv /mnt"
- mount -t proc none /mnt/proc
- mount -t sysfs sys /mnt/sys
- mount -o bind /dev /mnt/dev
- chroot /mnt
- /sbin/mkinitrd (to recreate the initrd for the existing kernel
- /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg (To regenerate the grub config)
- /usr/sbin/grub2-install --force /dev/sda (/dev/sda is my boot disk)
Now exit the chroot jail and reboot the system and hopefully everything should be back to normal
Edited on: Wed, Nov 25, 2020 12:36Posted in HowTo (RSS), System - Linux (RSS)