您的位置:首页 > 运维架构 > Linux

CentOS 7 grub Linux 修改默认的启动操作系统

2015-08-05 19:29 543 查看


可以用下面的方法修改grub默认的启动OS。

;查看当前的启动内核

root@localhost ~]# grub2-editenvlist

saved_entry=CentOS Linux(3.10.0-123.20.1.el7.x86_64) 7 (Core)

;查找要默认启动的操作系统名字

[root@localhost ~]# cat /etc/grub2.cfg | grep 3.4.44

menuentry 'CentOS Linux (3.4.44) 7(Core)'
--class centos --class gnu-linux --class gnu --class os--unrestricted $menuentry_id_option'gnulinux-3.10.0-123.el7.x86_64-advanced-e3146a2a-a237-4081-ba08-dbf258de434a'{

linux16 /vmlinuz-3.4.44 root=/dev/mapper/centos-rootro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/rootcrashkernel=auto
vconsole.keymap=us rhgbquiet LANG=en_US.UTF-8

initrd16 /initramfs-3.4.44.img

;设置新的默认启动操作系统选项

[root@localhost ~]# grub2-set-default
"CentOSLinux (3.4.44) 7 (Core)"

;查看是否生效

[root@localhost ~]# grub2-editenv list

saved_entry=CentOS Linux (3.4.44) 7 (Core)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: