How to change default kernel version boot order in RHEL 8 ?
Today in this post, we will see how to change the default kernel version during boot time in RHEL 8.
Lets see it step by step to understand the scenario.
a. Check out the current kernel version with which system is booted.
[root@ngelinux01 boot]# uname -a Linux ngelinux01 4.18.0-372.26.1.el8_6.x86_64 #1 SMP Sat Aug 27 02:44:20 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux [root@ngelinux01 boot]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.6 (Ootpa)
b. Check out the default system kernel and index id.
[root@ngelinux01 boot]# grubby --default-kernel /boot/vmlinuz-4.18.0-372.26.1.el8_6.x86_64 [root@ngelinux01 boot]# grubby --default-index 0
Here default index means which kernel number is default in boot order.
c. Verify the index id of new kernel.
[root@ngelinux01 boot]# grubby --info /boot/vmlinuz- vmlinuz-0-rescue-bf5ae16a7dca4c4ca98d6db3b9aabf2e vmlinuz-4.18.0-372.9.1.el8.x86_64 vmlinuz-4.18.0-372.26.1.el8_6.x86_64 [root@ngelinux01 boot]# grubby --info /boot/vmlinuz-4.18.0-372.9.1.el8.x86_64 index=1 kernel="/boot/vmlinuz-4.18.0-372.9.1.el8.x86_64" args="ro crashkernel=auto resume=UUID=bf1ac0e7-0bea-4d25-a5cc-8c2bcc4b7667 rhgb quiet rd.driver.blacklist=nouveau $tuned_params" root="UUID=679a288c-9a2e-4c73-b2ef-03276c326073" initrd="/boot/initramfs-4.18.0-372.9.1.el8.x86_64.img $tuned_initrd" title="Red Hat Enterprise Linux (4.18.0-372.9.1.el8.x86_64) 8.6 (Ootpa)" id="bf5ae16a7dca4c4ca98d6db3b9aabf2e-4.18.0-372.9.1.el8.x86_64" [root@ngelinux01 boot]#
d. Set new kernel as default kernel on system.
[root@ngelinux01 boot]# grubby --set-default=/boot/vmlinuz-4.18.0-372.9.1.el8.x86_64 The default is /boot/loader/entries/bf5ae16a7dca4c4ca98d6db3b9aabf2e-4.18.0-372.9.1.el8.x86_64.conf with index 1 and kernel /boot/vmlinuz-4.18.0-372.9.1.el8.x86_64 [root@ngelinux01 boot]# Now reboot your system and it will be booted with new kernel.