CentOS 7 Grub 2
grubby
OVH CentOS 7 server grub rescue prompt
RHEL Based – AlmaLinux, CentOS, RockeyLinux, Oracle Linux
Regenerate grub config
grub2-mkconfig -o /boot/grub2/grub.cfg grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
grub config on RHEL
/etc/default/grub
To install Grub, run
/sbin/grub2-install /dev/sda
To see all available kernels
awk -F\' '$1=="menuentry " {print i++ " = "$2}' /etc/grub2.cfg
If all kernels not showing, edit
vi /etc/default/grub
Add
GRUB_DISABLE_SUBMENU=true GRUB_DEFAULT=saved
Rebuild grub
grub2-mkconfig -o /etc/grub2.cfg
To set default Kernel
grub2-set-default 0
To see the current Kernel
grub2-editenv list
Reinstall kernel and set it to default
yum reinstall kernel grub2-set-default 0 grubby --set-default 0
Ubuntu
sudo update-grub /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg