Win7 + CentOS7 双系统

记录一下更改系统启动菜单的方法。

前提:

1. 先安装 Win7 在硬盘第一分区,其它分区在 Win7 下处于未分配状态。

2. 再安装 CentOS 到上述未分配分区。(注意:手动分区时,可以留一定空间,最后格式化为 vfat,用以在 Win7 和 CentOS 之间共享数据。)

安装完后,发现开机菜单只有 CentOS,而没有 Win7 选项了。使用以下步骤解决:

打开文件:

# vim /etc/grub.d/40_custom

在最后加入:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Windows 7" { 
        set root='(hd0,1)'  # 注意,因为 Win7 在硬盘第一分区,所以这里是(hd0,1)
        chainloader +1 
}                                                 

修改启动菜单的读秒时间,打开文件:

# vim /etc/default/grub

修改读秒时间为 30 秒:

GRUB_TIMEOUT=30

重新配置 grub2:

# grub2-mkconfig -o /boot/grub2/grub.cfg

重启即可。

猜你喜欢

转载自www.cnblogs.com/gaowengang/p/10791757.html