Issue
After updating the server kernel, the system must boot with the latest kernel. However, on CloudLinux or CentOS 8, the server may fail to start using the CloudLinux kernel—even if it is set as the default.
For example, after installing CloudLinux 8 or CentOS 8, running:
# awk -F\' '$1=="menuentry " {print i++ " = "$2}' /etc/grub2.cfg
0 = System setup
And checking kernel options:
# grub2-editenv - list | grep kernelopts
kernelopts=root=UUID=2e025cae-0f14-4d0d-a99a-a715b9a32fd0 ro crashkernel=auto biosdevname=0 net.ifnames=0 rhgb quiet
Setting the default kernel using:
# grub2-set-default <kernel_index>
Has no effect, and the system still does not boot with the intended kernel.
Environment
-
CloudLinux OS 8
-
CentOS 8
Solution
-
Update GRUB2 packages:
yum update grub2*
-
Edit
/etc/default/grubto include the following settings:
GRUB_DEFAULT=saved
GRUB_ENABLE_BLSCFG=true
-
Regenerate GRUB configuration files:
grub2-mkconfig -o /etc/grub2.cfg
grub2-mkconfig -o /etc/grub2-efi.cfg
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
After these steps, the server will correctly boot using the latest CloudLinux kernel.
Cause
RHEL 8-based distributions introduced changes to how kernel boot options are managed, requiring updates to GRUB configuration and bootloader settings to properly recognize and use the default kernel.
