- 删除或者备份/boot/grub2/grubenv
# mv /boot/grub2/grubenv /home/bak
# grub2-editenv /boot/grub2/grubenv create
# cat /boot/grub2/grub.cfg | grep ^menuentry | cut -c1-50 | nl -v 0
序号 内核版本
0 menuentry 'CentOS Linux, with Linux 5.1.2-1.el7.el
1 menuentry 'CentOS Linux, with Linux 3.10.0-957.12.
2 menuentry 'CentOS Linux, with Linux 3.10.0-123.el7
3 menuentry 'CentOS Linux, with Linux 0-rescue-241f5
# grub2-set-default 1
有时候写上面的字符串不一定生效CentOS Linux (3.10.0-957.12.1.el7.x86_64) 7 (Core)
实在不生效
# vi /etc/default/grub
GRUB_DEFAULT=1
# grub2-editenv list
# grub2-mkconfig -o /boot/grub2/grub.cfg
# reboot
# uname -r
网友评论