CentOS7 默认启动项修改

2018-03-05 2714点热度 0人点赞

双系统默认启动在 Linux,但是 Centos7 和 6 修改方式却发生了变化,尤其是 EFI 状态下对应文件都产生了变化。


首先,查看一下系统启动项和名称

[root@linux boot]# cat /boot/efi/EFI/centos/grub.cfg | grep menuentry

if [ x"${feature_menuentry_id}" = xy ]; then
 menuentry_id_option="--id"
 menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (3.10.0-693.17.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-693.el7.x86_64-advanced-4bc7efd1-e7ad-4a70-ad2e-aaf498989414' {
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-40C0-2AA2' {

然后,设置开机默认选择的启动项

[root@linux boot]# grub2-set-default "Windows Boot Manager (on /dev/sda1)"
[root@linux boot]# grub2-editenv list

saved_entry=Windows Boot Manager (on /dev/sda1)

[root@linux boot]# cat /boot/grub2/grubenv 

# GRUB Environment Block
saved_entry=Windows Boot Manager (on /dev/sda1)#############

最后,重启检查是否正常。

 

StarryVoid

Have a good time