grub2调整启动顺序
查看启动列表:
[root@node03 ~]# awk -F \' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (5.0.5-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux (4.20.4-1.el7.elrepo.x86_64) 7 (Core)
2 : CentOS Linux (3.10.0-957.1.3.el7.x86_64) 7 (Core)
3 : CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)
4 : CentOS Linux (0-rescue-e330e4a1694b45aeb2e5a389909f12d9) 7 (Core)}
查看当前entry:
[root@node03 ~]# grub2-editenv list
saved_entry=CentOS Linux (4.20.4-1.el7.elrepo.x86_64) 7 (Core)
修改默认entry,重启:
[root@node03 ~]# grub2-set-default 0
[root@node03 ~]# grub2-editenv list
saved_entry=0
[root@node03 ~]# sync
[root@node03 ~]# reboot
查看:
[root@node03 ~]# uname -a
Linux node03 5.0.5-1.el7.elrepo.x86_64 #1 SMP Wed Mar 27 13:30:25 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux