配置内核优先启动
- 查看当前内核默认启动项
grub2-editenv list
- 查看当前系统具有的内核
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg 0 : CentOS Linux (3.10.0-957.1.3.el7.x86_64) 7 (Core) 1 : CentOS Linux (0-rescue-60dac28184694b70a032240860d449b1) 7 (Core) 2 : CentOS Linux GNU/Linux, with tboot 1.9.4 and Linux 3.10.0-957.1.3.el7.x86_64
- 修改默认启动的内核
$ grub2-set-default “CentOS Linux (3.10.0-957.1.3.el7.x86_64) 7 (Core)”
- 验证是否修改成功
grub2-editenv list saved_entry=CentOS Linux (3.10.0-957.1.3.el7.x86_64) 7 (Core)
- 重启服务器验证内核是否修改成功
uname -r 3.10.0-957.1.3.el7.x86_64