centos7 开机启动设置

1、由于做了yum ugrade 导致开机多出一个纯内核选项 CentOS Linux (3.10.0-327.3.1.el7.x86_64) 7 (Core),进入这个系统后,无法开启无线,因此需要选第二项才能正常使用

需要将第二项作为开机默认启动CentOS Linux, with Linux 3.10.0-123.el7.x86_64

2、cat /boot/grub2/grub.cfg | grep CentOS

[root@gxcc boot]# cat /boot/grub2/grub.cfg | grep CentOS
menuentry 'CentOS Linux (3.10.0-327.3.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-eb80a88a-8941-4198-902e-87494311061b' {
menuentry 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-eb80a88a-8941-4198-902e-87494311061b' {
menuentry 'CentOS Linux, with Linux 0-rescue-274dc2ad56de4b9695eb3db3a841d7e4' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-274dc2ad56de4b9695eb3db3a841d7e4-advanced-eb80a88a-8941-4198-902e-87494311061b' {
if [ "x$default" = 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' ]; then default='Advanced options for CentOS Linux>CentOS Linux, with Linux 3.10.0-123.el7.x86_64'; fi;

3、验证开机默认启动项

[root@gxcc boot]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-327.3.1.el7.x86_64) 7 (Core)

4、修改

[root@gxcc boot]# grub2-set-default "CentOS Linux, with Linux 3.10.0-123.el7.x86_64"
这儿只能使用第2条命令输出中双引号 “ ” 或者单引号 ‘ ‘ 中的内容)

5、再验证

[root@gxcc boot]# grub2-editenv list

saved_entry=CentOS Linux, with Linux 3.10.0-123.el7.x86_64

原文地址:https://www.cnblogs.com/glxsc/p/5106033.html