![Centos configure grub key Centos configure grub key](/uploads/1/2/4/4/124435246/898721124.png)
By default, the savedentry value is set to the name of latest installed kernel of package type kernel. This is defined in /etc/sysconfig/kernel by the UPDATEDEFAULT and DEFAULTKERNEL directives. The file can be viewed by the root user as follows: # cat /etc/sysconfig/kernel# UPDATEDEFAULT specifies if new-kernel-pkg should make# new kernels the defaultUPDATEDEFAULT=yes# DEFAULTKERNEL specifies the default kernel package typeDEFAULTKERNEL=kernelWhen new kernels are installed, they should include a new stanza in the bootloader configuration file, /boot/grub2/grub.conf. The default stanza is based on the savedentry directive in the /boot/grub2/grubenv file. For example currently my system is configured is to boot from 3.10.0-957.1.3.el7.x8664 # grep saved /boot/grub2/grubenvsavedentry=CentOS Linux (3.10.0-957.1.3.el7.x8664) 7 (Core)Now currently I have a different kernel loaded on my system # uname -r3.10.0-693.el7.x8664This is because I just installed a newer kernel on my system but since I have not rebooted my node, still old kernel is loaded.So after reboot the kernel version provided in “ savedentry” will be loaded. Now after reboot as expected my loaded kernel has changed # uname -r3.10.0-957.1.3.el7.x8664How to set default boot kernel?The boot configuration when using GRUB 2 is in the /boot/grub2/grub.cfg file. You can also refer to it by the /etc/grub2.cfg file which is a symbolic link.
To force a system to always use a particular menu entry and to set default boot kernel, use the menu entry name as the key to the GRUBDEFAULT directive in the /etc/default/grub file.
CentOS 7: GRUB2 and Linux with serial console This article will describe changing GRUB2 and Linux to serial console. This is not for desktop environment but embedded system and virtual machine environment.