Introduction
This guide's purpose is purely informational, and as such, cPanel, LLC will not assume responsibility for any potential adverse outcomes that might arise from its adoption. You may, therefore, wish to seek assistance from a qualified system administrator in case you require further assistance with upgrading the kernel on your system.
The cPanel software does not provide a method for managing the Kernel that your server will boot into by default. Normally, the kernel package update will automatically configure the latest version to be loaded during boot. If an update conflicts or grub2 is not loading the most secure version, it may be necessary to change this configuration manually. This article discusses the process of configuring which Kernel your CentOS 7 server will load during system boot.
Procedure
Please note that this task involves advanced procedures and can impact your server's ability to boot successfully. Due to this, we advise that this task only be performed by a system administrator experienced with managing kernels on a CentOS 7 system.
Before you proceed with this change, we strongly advise reviewing the documentation below from the CentOS documentation to ensure a full understanding of the grub2 configurations and how to edit which Kernel will be used during boot.
- First, you must ensure that the setting GRUB_DEFAULT is set to saved in the configuration file /etc/default/grub. If not, you will need to update it to this value using your preferred text editor(i.e., vi, vim, nano).
[root@server ~]# grep GRUB_DEFAULT /etc/default/grub
GRUB_DEFAULT=saved - You then need to confirm the IDs for each Kernel installed on your server. This command will list each Kernel and the number followed by a colon at the beginning of each line is that version's ID.
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
- After this, the desired Kernel can be set to be used during boot with the following command. In most cases, you should be using ID 0(the latest installed Kernel), but this can be replaced with any from the list identified in step 2.
grub2-set-default 0
- Finally, you need to reboot the server to load in the selected Kernel.
reboot
Additional Resources
How to set the default kernel with grubby.
Comments
0 comments
Article is closed for comments.