Professional Documents
Culture Documents
How To Recover Grub - CFG (Grub Menu) in Centos 8
How To Recover Grub - CFG (Grub Menu) in Centos 8
How To Recover Grub - CFG (Grub Menu) in Centos 8
GRand Unified Bootloader, it’s a upgraded version of lilo boot loader & Default boot loader of Linux every
distribution. GRUB is the first software program that runs when a computer is started. GRUB is responsible for
loading the Kernel software. The Kernel then initializes the rest of the operating system.
grub>
Restart the system and boot using CentOS 8 ISO/DVD.
It will ask you for mounting your filesystem, choose the option and '1' and
press <ENTER> .
Press <ENTER> again to acquire a shell.
Execute chroot command to access your filesystem.
sh-4.4# chroot /mnt/sysimage
By using grub2-mkconfig command, you can regenerate grub.cfg file.
bash-4.4# grub2-mkconfig -o /boot/grub2/grub.cfg
If you are working on an UEFI based machine then you have to generate grub.cfg file
in /boot/efi/EFI/centos/ directory.
If you are using SELinux, then create following file to trigger SELinux file relabeling
process on next startup.
bash-4.4# touch /.autorelabel
Finally exit from chrooted environment and reboot your system.
bash-4.4# exit
sh-4.4# reboot
Boot using your Hard Disk and now it will display the GRUB boot menu this time.
sh-4.4# cd /mnt/install/repo/BaseOS/Packages
grub-recovery-01 login:
We have successfully recovered CentOS 8 Kernel.
grub-recovery-01 login:
CentOS 8 initrd image has been recovered.