標籤:rhe7 grub2
一、安裝序順
1. 先安裝 Windows 作業系統
2. 再安裝 RHEL 7 系統
二、grub 中,添加Windows 引導資訊
因為安裝rhel7後,只有Linux 的引導資訊,而沒有Windows 系統的資訊,需要手工添加。
1. 修改grub 自訂設定檔(本例 Windows server 2008 是安裝在C 盤,且在安裝時,Windows 自動建立了一個隱藏式磁碟分割)
[[email protected] ~]# cat /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 Server 2008‘ {
insmod part_msdos
insmod ntfs
insmod ntldr
set root=(hd0,1)
chainloader +1
boot
}
2.重新編譯產生啟動菜單
[[email protected] ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
3. 重新啟動即可看到有Windows 引導項。
三、 grub2更改啟動順序
grub2是通過/etc/grub.d/目錄下的檔案順序來決定啟動項順序的,因此改變這些檔案的序順即可。
1. 修改檔案的序順
[[email protected] ~]# cd /etc/grub.d/
[[email protected] grub.d]# ls
00_header 10_linux 20_linux_xen 20_ppc_terminfo 30_os-prober 40_custom 41_custom README
[[email protected] grub.d]# cp 40_custom 02_windows
[[email protected] grub.d]# ls
00_header 02_windows 10_linux 20_linux_xen 20_ppc_terminfo 30_os-prober 40_custom 41_custom README
2.重新編譯產生啟動菜單
[[email protected] ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
四、grub2 修改菜單顯示時間
1.修改設定檔
[[email protected] ~]# vi /etc/default/grub
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR="$(sed ‘s, release .*$,,g‘ /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrheb-sun16 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
2.重新編譯產生啟動菜單
[[email protected] ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
本文出自 “鐵釘” 部落格,請務必保留此出處http://nails.blog.51cto.com/640492/1548701
RHEL 7 和 Windows 雙系統安裝