Change grub2 default kernel

 Change grub2 default kernel

0. Check if grub_default is setup to saved

# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=cl/root vconsole.font=latarcyrheb-sun16 crashkernel=auto  vconsole.keymap=us rd.lvm.lv=cl/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

1. make copy of grub

# cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bak

2. generata new grub .config

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

3. Check what kernels are available.

# grep "^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2

4. Select kernel by name and setup as default 

#grub2-set-default "Oracle Linux Server 7.9, with Linux 3.10.0-1160.31.1.el7.x86_64
 

5. Check what is saved entry

# grub2-editenv list
 

Comments

Popular posts from this blog

Reduce (shrink) and resize raw disk at Proxmox

Securing the Pi-hole with fail2ban to prevent DNS Amplification attacks

How to clean DB from old logs in Magento 1.x