NEW VPS PLANS

Experience Ultra-high Performance of NVMe Storage on New UK VPS Plans.

Deploy Instantly
  • +357 2425 0808
  • Login
  • English

Home

Blog

How To change the default kernel in GRUB...

How To change the default kernel in GRUB for RHEL and CentOS

How To change the default kernel in GRUB for RHEL and CentOS

NetShop ISP

NetShop ISP · Blog Author

Oct 22, 2021 · Technical Tutorials

This article answers common questions such as “How to set default boot kernel in linux?”, “How to change the default boot entry for kernel?”, “How to boot with old kernel version?” and “How to revert to previous kernel version?”.

GRUB2 is the version of GRUB currently in use, at the time of publishing this article. The software was rewritten to allow plugins and expand features available in the menu system. GRUB legacy and GRUB2 are otherwise fairly similar.

Let’s continue on how you can easily change the default kernel in GRUB on your Linux RHEL or CentOS 7 Server.

Step 1. Get list of installed kernels

awk -F\' /^menuentry/{print\$2} /etc/grub2.cfg

Output:

0- Red Hat Enterprise Linux Server (3.10.0-1062.7.1.el7.x86_64) 7.7 (Maipo)
1- Red Hat Enterprise Linux Server (3.10.0-1062.1.2.el7.x86_64) 7.7 (Maipo)
2- Red Hat Enterprise Linux Server (3.10.0-693.el7.x86_64) 7.4 (Maipo)
3- Red Hat Enterprise Linux Server (0-rescue-39228403a82a4e29afb7e5ca1a869adb) 7.4 (Maipo)

Step 2. Set a default kernel

grub2-set-default 1

Step 3. Verify new default kernel

# cat /boot/grub2/grubenv | grep saved

Output:

saved_entry=1

Step 4. Rebuild GRUB Config File

BIOS-based:

grub2-mkconfig -o /boot/grub2/grub.cfg

UEFI-based:

grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Step 4. Reboot Server

All done! You can now reboot your Linux Server to have it booted with your new default kernel.

shutdown -r now

Press Releases
72

Free VPS Trial

No Credit Card Required.

Recent Posts

How To Migrate from MongoDB Atlas to self-hosted Ubuntu 22.04 Server

How To Migrate from MongoDB Atlas to self-hosted Ubuntu 22.04 Server

15 April, 2024

How NetShop ISP Improves Trading Infrastructure Resilience through Equinix LD7 Data Center Hosting

How NetShop ISP Improves Trading Infrastructure Resilience through Equinix LD7 Data Center Hosting

21 March, 2024

Introducing New Cutting-Edge VPS Plans: OKTAPLUS, HYPER, and TITAN Enhanced with NVMe Technology

Introducing New Cutting-Edge VPS Plans: OKTAPLUS, HYPER, and TITAN Enhanced with NVMe Technology

12 March, 2024

How To Install Let’s Encrypt SSL on Ubuntu Server 22.04 for Apache or Nginx

How To Install Let’s Encrypt SSL on Ubuntu Server 22.04 for Apache or Nginx

04 March, 2024

Navigating Forex Server Hosting: Key Distinctions from Conventional Providers

Navigating Forex Server Hosting: Key Distinctions from Conventional Providers

23 February, 2024

#letushostyou

Award Winning Hosting Provider established in 2004.

120 Faneromenis Avenue, Imperial Tower, 2nd Floor, Larnaca 6031, Cyprus

Products

Bare Metal Servers

Customized Servers

Virtual / Cloud Servers

Forex VPS

Storage VPS

cPanel Web Hosting

Reseller Web Hosting

Colocation

Addons

Premium DNS

Email Hosting

Cloud Backup

DDoS Protection

Licenses

SSL Certificates

Domain Names

Premium SLAs

About Us

Data Center Locations

Looking Glass

Our Company

Contact Us

Careers in Cyprus

Become a Partner

Awards

Certifications

© 2024 S.S. NetShop Internet Services Ltd. All rights reserved.  Terms & Conditions  |  Privacy Policy
CY Reg. Number: HE 217340 | EU VAT Number: CY10217340J

Visa
Mastercard
PayPal
Bitcoin
Tether
Ethereum
Litecoin
Wise
Revolut
Wire Transfer