Why is the system not booting with the kernel set with grubby?
Environment
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 8
Issue
- Why is the system not booting with the kernel set with
grubby? - Why is the system not booting with the kernel returned by
grubby?
Resolution
The grubby command sets the saved entry, but if grub2 is not configured to use this saved entry, the system will not boot with the selected kernel.
To configure grub2 to use the saved entry, follow these steps:
- Edit the
/etc/default/grubfile and ensure that theGRUB_DEFAULTparameter is set tosaved:
GRUB_DEFAULT=saved
If it is not set to saved, edit the file, changeGRUB_DEFAULT so it is set to saved, then save the file.
- Update the
grub.cfgby running the following command:
# grub2-mkconfig -o /boot/grub2/grub.cfg
- Reboot the system. Confirm that the kernel used is the one returned by
grubby
Root Cause
The default setting for grub2 on RHEL is to used the saved entry. The probable Root Cause is that the grub2 was set to use a specific entry instead of the saved entry.
Diagnostic Steps
Verify that GRUB_DEFAULT is set to saved:
# grep GRUB_DEFAULT /etc/default/grub
GRUB_DEFAULT=saved
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.