-
Current Situation:
- The system has multiple kernel versions installed:
- 4.9.127-32.el7.x86_64 (newest)
- 3.10.0-1160.11.1.el7.x86_64 (currently booting)
- 3.10.0-957.21.3.el7.x86_64 (your preferred version)
- Several debug kernels
- The system has multiple kernel versions installed:
-
The Issue:
- The
grubenv
file shows that the system is set to boot into the debug version of 3.10.0-1160.11.1 - This is likely happening because of the
savedefault
option in each menu entry, which saves the last booted entry as the default
- The
-
Why It Changes:
- When security updates install new kernels, they typically become the default boot option
- The
savedefault
feature then remembers whatever kernel was last booted - If the system was ever booted into the debug kernel, it would remember that choice
-
To Fix This, you would need to run these commands on the remote system:
# To set the preferred kernel as default (957.21.3):
grub2-set-default "CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core)"
# Verify the setting:
grub2-editenv list
# Regenerate the grub config:
grub2-mkconfig -o /boot/grub2/grub.cfg
- To Prevent Future Issues:
- Edit
/etc/default/grub
to setGRUB_SAVEDEFAULT=false
- This will prevent the system from automatically changing the default kernel
- Then regenerate the grub config again
- Edit