Chapter 2. Specifying the RHEL kernel to run
You can boot any installed kernel, standard or Real Time by selecting the required kernel manually in the GRUB menu during booting. You can also configure the kernel to boot by default.
When the RHEL for Real Time kernel is installed, it is automatically set to be the default kernel and is used on the next boot.
2.1. Displaying the default kernel Copy linkLink copied to clipboard!
You can display the kernel configured to boot by default.
Procedure
To view the default kernel:
# grubby --default-kernel /boot/vmlinuz-4.18.0-80.rt9.138.el8.x86_64The
rtin the output of the command shows that the default kernel is a real time kernel.
2.2. Displaying the running kernel Copy linkLink copied to clipboard!
You can display the currently running kernel
Procedure
To show which kernel the system is currently running.
~]# uname -a Linux rt-server.example.com 4.18.0-80.rt9.138.el8.x86_64 …NoteWhen the system receives a minor update, for example, from 8.3 to 8.4, the default kernel might automatically change from the Real Time kernel back to the standard kernel.
2.3. Configuring kernel-rt as the default boot kernel Copy linkLink copied to clipboard!
On a newly installed system, the stock RHEL kernel is set as the default boot kernel and is used as the default kernel on the next boot and subsequent system updates. You can change this configuration and set kernel-rt as the default kernel to boot with and also make this configuration persistent across the system updates. Configuring kernel-rt is a one-time procedure, which you can change or revert to another kernel if necessary. You can also configure other existing kernels variants, such as, kernel, kernel-debug, or kernel-rt-debug, as the default boot kernel.
Procedure
To configure
kernel-rtas the default boot kernel, enter the following command:# grubby --set-default=<RT_VMLINUZ>RT_VMLINUZis the name of thevmlinuxfile that is associated with thekernel-rtkernel. For example:# grubby --set-default=/boot/vmlinuz-5.14.0-284.11.1.rt14.296.el9_2.x86_64+rtTo configure
kernel-rtas default boot kernel on system updates, enter the following command:# sed -i ‘s/UPDATEDEFAULT=.*/UPDATEDEFAULT=yes/g’/etc/sysconfig/kernel # sed -i 's/DEFAULTKERNEL=.*/DEFAULTKERNEL=kernel-rt-core/g'/etc/sysconfig/kernelThe
UPDATEDEFAULTvariable when specified asyes, sets the default kernel to change with system updates.In the example output, the path for the default kernel is specific to the
kernel-rt-corepackage installed. You can determine the path to the kernel from a package by using therpm -q kernel-rt-corecommand.Optional: If you need to determine the path to the kernel from a package, first list the installed packages:
# rpm -q kernel-rt-core kernel-rt-core-5.14.0-284.11.1.rt14.296.el9_2.x86_64 kernel-rt-core-5.14.0-284.10.1.rt14.295.el9_2.x86_64 kernel-rt-core-5.14.0-284.9.1.rt14.294.el9_2.x86_64To use the latest installed package as the default, enter the following command to find the path to the boot image from that package:
# rpm -ql kernel-rt-core-5.14.0-284.11.1.rt14.296.el9_2.x86_64|grep‘^/boot/vmlinu’ /boot/vmlinuz-5.14.0-284.11.1.rt14.296.el9_2.x86_64.x86_64+rtTo configure
kernel-rtas the default boot kernel, enter the following command:# grubby --set-default=/boot/vmlinuz-5.14.0-284.11.1.rt14.296.el9_2.x86_64.x86_64+rt
Verification
To verify
kernel-rtis the default kernel, enter the following command:# grubby --default-kernel /boot/vmlinuz-5.14.0-284.11.1.rt14.296.el9_2.x86_64.x86_64+rt