In Red Hat EL versions 5 and 6 we can easily to update the /etc/grub.conf
in case we want to change the kernel by default variable
For example , grub.conf on redhat 5
default=0
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-410.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-410.el5 ro root=/dev/rootvg/slash
initrd /initrd-2.6.18-410.el5.img
title Red Hat Enterprise Linux Server (2.6.18-409.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-409.el5 ro root=/dev/rootvg/slash
initrd /initrd-2.6.18-409.el5.img
From this /etc/grub.conf
if we want to boot from kernel 2.6.18-409
version
then we just change the default=1
.
So on the next boot, the OS will start with the old kernel
RHEL7 is very different. I find in the RHEL7 the /boot/grub2/grub.cfg
But I don't understand how to change the file in order to boot from other kernel as I do it on RHEL5.
change
GRUB_DEFAULT=0
in/etc/default/grub
to the number that you want, now you need to regenarate the grub2 config usinggrub2-mkconfig -o /boot/grub2/grub.cfg
How the change GRUB kernel on redhat 7 version
To list all the menu entries that will be displayed at system boot, issue the following command:
How to verify what is the current entry (the current kernel from /etc/default/grub )
This mean the current kernel version from grub configuration is: 3.10.0-327.10.1.el7.x86_64
let’s check what is the current kernel version on the machine:
Now let’s changes the kernel version from GRUB configuration so Linux will boot with the higher kernel - 3.10.0-327.18.2.el7.x86_64 ,
remember from the awk command we get entrie number 0
So the setting should be as the following
Now we check the new GRUB configuration by
so now the new GRUB configuration is set to kernel version: 3.10.0-327.18.2.el7.x86_64
Now we reboot the machine
After reboot Linux was up with the new kernel