warren6

 

CentOS7修改内核启动顺序

CentOS7修改内核启动顺序

1.首先查看当前系统有几个内核

#方式1
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

# 0 : CentOS Linux (5.16.0-1.el7.elrepo.x86_64) 7 (Core)
# 1 : CentOS Linux (3.10.0-1160.49.1.el7.x86_64) 7 (Core)
# 2 : CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)
# 3 : CentOS Linux (0-rescue-6ae14471c6f9480298cc7690f9d1803e) 7 (Core)

# 方式2
cat /boot/grub2/grub.cfg |grep menuentry

2.查看当前默认内核

grub2-editenv list

# saved_entry=CentOS Linux (3.10.0-1160.49.1.el7.x86_64) 7 (Core)

3.更改默认启动内核

grub2-set-default '5.16.0-1.el7.elrepo.x86_64) 7 (Core)'

4.重启机器生效

reboot

posted on 2022-10-10 13:45  Warren6  阅读(314)  评论(0编辑  收藏  举报

导航