1. Check the current running Kernel Version
# uname -a
Linux localhost.localdomain 5.8.5-1.el7.elrepo.x86_64 #1 SMP Wed Aug 26 10:08:39 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
2. List the Kernel Entries as per GRUB2 file:
# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core)
CentOS Linux (5.8.5-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-1127.8.2.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-862.6.3.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-862.3.3.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-05c105c5b5e048fa89f4c9f430dc2586) 7 (Core)
3. Let us modify the Kernel Version to "CentOS Linux (5.8.5-1.el7.elrepo.x86_64) 7 (Core)" which is at line number 2 but denoted as entry 1.
# grub2-set-default 1
4. Changes to /etc/default/grub require rebuilding the grub.cfg file as follows:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.5-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-5.8.5-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-1127.19.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1127.19.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-1127.8.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1127.8.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-862.6.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-862.6.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-862.3.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-862.3.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-05c105c5b5e048fa89f4c9f430dc2586
Found initrd image: /boot/initramfs-0-rescue-05c105c5b5e048fa89f4c9f430dc2586.img
done
Reboot the Server and it will boot with Kernel Version 5.8.5-1.el7.elrepo.x86_64.
# shutdown -r now
Comments