Win7 + CentOS7 雙系統

記錄一下更改系統啓動菜單的方法。vim

前提:ide

1. 先安裝 Win7 在硬盤第一分區,其它分區在 Win7 下處於未分配狀態。this

2. 再安裝 CentOS 到上述未分配分區。(注意:手動分區時,能夠留必定空間,最後格式化爲 vfat,用以在 Win7 和 CentOS 之間共享數據。)spa

安裝完後,發現開機菜單隻有 CentOS,而沒有 Win7 選項了。使用如下步驟解決:code

打開文件:blog

# vim /etc/grub.d/40_custom

在最後加入 ( 注意,由於個人 Win7 在硬盤第一分區,因此這裏是 (hd0,1) ):class

#!/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)' chainloader +1 }                                                 

修改啓動菜單的讀秒時間,打開文件:配置

# vim /etc/default/grub

修改讀秒時間爲 30 秒:file

GRUB_TIMEOUT=30

從新配置 grub2:方法

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

重啓便可。

相關文章
相關標籤/搜索