Centos7 修改启动顺序
2019-08-06 本文已影响0人
知然
上一次安装输入法,将内核升级到了 5.2.1 ,昨天yum update 一下 之前的内核更新到了 3.10
导致今天启动的时候 出现莫名其妙的错误,仔细查看才发现,默认启动项变了
查看 启动列表
sudo cat /boot/grub2/grub.cfg |grep menuentry
出现下边结果
menuentry 'CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-5.2.1-1.el7.elrepo.x86_64-advanced-6febd9f5-e1b3-4459-a73a-6debbb690745' {
menuentry 'CentOS Linux (5.2.1-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-5.2.1-1.el7.elrepo.x86_64-advanced-6febd9f5-e1b3-4459-a73a-6debbb690745' {
menuentry 'CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.21.3.el7.x86_64-advanced-6febd9f5-e1b3-4459-a73a-6debbb690745' {
menuentry 'CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.el7.x86_64-advanced-6febd9f5-e1b3-4459-a73a-6debbb690745' {
menuentry 'CentOS Linux (0-rescue-2f972f97b903412e91ea115175674d25) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-2f972f97b903412e91ea115175674d25-advanced-6febd9f5-e1b3-4459-a73a-6debbb690745' {
查看当前默认启动项
sudo grub2-editenv list
结果如下
saved_entry=CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)
果然启动项变成3.10.0的内核了
修改启动地址
sudo grub2-set-default 'CentOS Linux (5.2.1-1.el7.elrepo.x86_64) 7 (Core)'
再次查看
sudo grub2-editenv list
saved_entry=CentOS Linux (5.2.1-1.el7.elrepo.x86_64) 7 (Core)
重启以后就会发现 默认项是第一个了