Setting Default Boot Kernel in CentOS

Jul 12, 2024

How to Change Default Boot Kernel

Introduction

  • Welcome to the technical session on changing the default boot kernel
  • Overview:
    • Importance of kernel updates
    • Step-by-step process to set default boot kernel

Context

  • Using CentOS (St. Louis) Operating System (OS)
  • Impact of kernel updates
  • Frequent kernel updates and reboots
  • Setup to load the latest kernel after reboot

Main Steps

Important Preparations

  • Ensure the system has the latest kernel installed
  • Need to vote system with the preferred kernel
  • Change default boot kernel in Grub bootloader
  • Manually edit Grub configuration file: grub.conf or grub.cfg
  • Use the grubby tool to set the default kernel

Change Default Boot Kernel Using Grubby

  1. Open terminal on CentOS
  2. List installed kernels:
    sudo egrep ^menuentry /etc/grub2.cfg
    
    or for legacy systems:
    sudo egrep ^title /etc/grub.conf
    
  3. Set default kernel:
    sudo grubby --set-default=/boot/vmlinuz-<kernel-version>
    
  4. Verify changes:
    grubby --default-kernel
    

Validate System Boot

  • Reboot the system
  • Ensure the system boots with the new default kernel
  • Use uname -r to check running kernel version

Conclusion

  • Successfully changed the default boot kernel
  • Verification and validation steps

Subscribe and Follow for More

  • Reminder to subscribe to the channel for more technical updates