Centos 7开机菜单查看与修改设置方法

Centos 7的开机菜单设置主要是能过 /etc/grub2.cfg ( /etc/grub2.cfg -> ../boot/grub2/grub.cfg)

timeout=5   为等待用户选择时间,当5秒钟没有选择,系统会启动默认的菜单

与centos 6不同的是centos 7在设置默认启动项时不能通过 default=? 来设置,而是通过以下命令:

若要列出系统开机时显示的所有选项,请执行以下指令:

[root@host ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux 7 (Core), with Linux 3.10.0-229.14.1.el7.x86_64
1 : CentOS Linux 7 (Core), with Linux 3.10.0-229.4.2.el7.x86_64
2 : CentOS Linux 7 (Core), with Linux 3.10.0-229.el7.x86_64
3 : CentOS Linux 7 (Core), with Linux 0-rescue-605f01abef434fb98dd1309e774b72ba
查看当前默认启动项

# grub2-editenv list

设置默认启动项

#grub2-set-default 2

重启后生效

 

版权声明:
作者:John
链接:https://vps.la/2023/03/27/centos-7%e5%bc%80%e6%9c%ba%e8%8f%9c%e5%8d%95%e6%9f%a5%e7%9c%8b%e4%b8%8e%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae%e6%96%b9%e6%b3%95/
来源:VPS啦
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>