Why is the system not booting with the kernel set with grubby?

Solution Unverified - Updated

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:

  1. Edit the /etc/default/grub file and ensure that the GRUB_DEFAULT parameter is set to saved:
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.

  1. Update the grub.cfg by running the following command:
# grub2-mkconfig -o /boot/grub2/grub.cfg
  1. 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
SBR
Components
Tags

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.