VPSMATE

  • HOME
  • NEWS
  • VPS
  • DEDICATED
  • ARCHIVES
  • GoDaddy
  • SCRIPT
  • TOOLS
    • Traceroute
    • Benchmark
    • Useful Sites
  • Themes
  • GFW
VPSMATE
VPS COUPON & PROMOS | VPS & DEDICATED SERVERS OFFERS | VPS REVIEWS
  1. Main page
  2. Tutorials
  3. Main content

How to change default kernel (boot with old kernel) – CentOS/RHEL/OEL 7

28/08/2020 840hotness 0likes 0comments

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

Related

Tag: Nothing
Last updated:28/08/2020

kyaky

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

Comments

Cancel

This site uses Akismet to reduce spam. Learn how your comment data is processed.

COPYRIGHT © 2021 vpsmate.net. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang