Set Default Kernel in Linux
In this part, we are goint to set default kernel for VPS server. Remember last time you had difficult time when accessing the VPS due to incompatible kernel and causing Dracut at startup. You can also make the splash screen longer so you able to select earlier version of kernel.
Let say you managed to login to session login with earlier version of Kernel. Now we need to modify default kernel when logged in.
See how much kernels loaded :
awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
Now we can apply the default kernel will be loaded. Make sure you load kernel with working kernel only.
grub2-set-default x
Where x is a numeric that counted from 0. For example :
Kernel version X = counted as 0
Kernel version Y = counted as 1
Kernel version U = counted as 2
Let say you are going to set kernel as version Y. So you need to run grub2-set-default 1 as you need to load that kernel by default after reboot.
