• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Change default kernel (boot with old kernel) – CentOS/RHEL/OEL 7

by admin

Question: How to modify the GRUB2 default entry to boot a different Kernel version?

1. Check the current running Kernel Version

# uname -a
Linux geeklab 3.8.13-94.el7uek.x86_64 #2 SMP Wed Feb 11 14:18:22 PST 2015 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
Oracle Linux Server, with Unbreakable Enterprise Kernel 3.8.13-94.el7uek.x86_64
Oracle Linux Server, with Unbreakable Enterprise Kernel 3.8.13-94.el7uek.x86_64 with debugging
Oracle Linux Server 7.1, with Linux 3.10.0-229.el7.x86_64
Oracle Linux Server 7.1, with Unbreakable Enterprise Kernel 3.8.13-55.1.6.el7uek.x86_64
Oracle Linux Server 7.1, with Linux 0-rescue-441e86c9ff854310a306bd33e56aae2b
NOTE: The first entry is denoted as Zero. So currently the Server is booted to 0th entry as per the above `uname -a` command output.

3. Let us modify the Kernel Version to 3.8.13-55.1.6.el7uek.x86_64 which is at line number 4 but denoted as entry 3.

# grub2-set-default 3

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-3.10.0-229.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.8.13-94.el7uek.x86_64
Found initrd image: /boot/initramfs-3.8.13-94.el7uek.x86_64.img
Found linux image: /boot/vmlinuz-3.8.13-55.1.6.el7uek.x86_64
Found initrd image: /boot/initramfs-3.8.13-55.1.6.el7uek.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-441e86c9ff854310a306bd33e56aae2b
Found initrd image: /boot/initramfs-0-rescue-441e86c9ff854310a306bd33e56aae2b.img
done

Reboot the Server and it will boot with Kernel Version 3.8.13-55.1.6.el7uek.x86_64.

# shutdown -r now

Filed Under: CentOS/RHEL 7, Linux, OEL 7

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : How to rebuild Initial Ramdisk Image
  2. How to identify the HBA cards/ports and WWN in Linux
  3. How to Manage Oracle database Audit File Directory Growth with cron (ASM Instances Only)
  4. XFS error: Unable to mount filesystem With Noacl Permission in CentOS/RHEL 7
  5. How to configure multicast on an IP address (interface)
  6. Order of environment calls for different OS shells in Linux
  7. swapon and swapoff Command Examples in Linux
  8. RHEL 7 – RHCSA Notes – vi/vim editor
  9. CentOS / RHEL 7 : How to install and configure telnet
  10. wget Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • PHP cos function – Cosine
  • PHP connection_status function – Returns connection status bitfield
  • PHP ceil function – Round fractions up
  • PHP bindec function – Convert a number between arbitrary bases

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright