Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

使用 GRUB 引導 Windows/Linux 三重開機:完整分區與配置指南

編輯:Windows 2008 應用技巧

GRUB(Grand Unified Bootloader)是 Linux 經典開機管理程式,支援多作業系統彈性引導。本文記錄雙硬碟環境安裝 Windows 2000 + Red Hat 9 + Mandrake 9.1 三系統共存的完整流程,原理適用於現代 Windows/Linux 多重開機。

硬碟分區規劃

硬碟分區掛載點/用途檔案系統大小建議
第一顆 (hda)hda1Windows 系統碟 (C:)NTFS/FAT3280 GB
第二顆 (hdb)hdb1/boot (共用)ext3100-200 MB
hdb2swapswap記憶體 1-1.5 倍 (≥512MB 同記憶體大小)
hdb3/ (Red Hat)ext35-10 GB
hdb5/ (Mandrake)ext35-10 GB
關鍵原則:Windows 安裝於第一顆硬碟主分區;Linux 系統分區分離,共用 /boot 與 swap;EXT3 格式 Windows 無法識別,避免誤操作。

安裝順序與開機載入器部署

  1. Windows 2000:優先安裝於 hda1,佔用 MBR
  2. Red Hat 9:安裝時選擇「GRUB 安裝於 hda1 MBR」(覆寫 Windows MBR)
  3. Mandrake 9.1:安裝時選擇「LILO/GRUB 安裝於 /boot 第一磁區 (hdb1)」,不覆寫 MBR

修改 GRUB 設定檔 (/boot/grub/grub.conf)

以 root 身分編輯 /boot/grub/grub.conf(或 menu.lst),參考範例:

default=0
timeout=10
splashimage=(hd1,2)/boot/grub/splash.xpm.gz

title Windows 2000
rootnoverify (hd0,0)
chainloader +1

title Red Hat 9
root (hd1,2)
kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /boot/initrd-2.4.20-8.img

title Mandrake 9.1
kernel (hd1,4)/boot/vmlinuz root=/dev/hdb5 quiet devfs=mount acpi=off vga=788
initrd (hd1,4)/boot/initrd.img

關鍵參數解析

參數說明
default=X預設啟動項目索引 (0 起算)
timeout=X選單等待秒數
splashimage開機選單背景圖路徑 (GRUB 表示法)
root (hdX,Y)Linux 核心所在分區:X=硬碟索引(0起算),Y=分區索引(0起算,邏輯分區從 4 開始)
rootnoverify (hdX,Y)不掛載檔案系統,直接鏈結載入(用於 Windows)
chainloader +1載入目標分區第一磁區 (MBR/VBR)
kernel /path/vmlinuz ...核心映像路徑與啟動參數
initrd /path/initrd.img初始化虛擬磁碟映像

GRUB 裝置表示法對照

  • (hd0) = 第一顆硬碟 (hda/sda)
  • (hd0,0) = 第一顆硬碟第一主分區 (hda1/sda1)
  • (hd1,4) = 第二顆硬碟第一邏輯分區 (hdb5/sdb5)
  • 分區編號:主分區 0-3,邏輯分區從 4 開始

驗證與除錯

  1. 安裝完成後重啟,觀察 GRUB 選單是否顯示三個選項
  2. 依序選擇各系統進入桌面,確認正常運作
  3. 若 Windows 無法啟動:嘗試將 rootnoverify 改為 root
  4. 若 Linux kernel panic:檢查 root= 參數對應正確分區裝置名稱

現代環境應用提示

  • UEFI 系統請使用 GRUB2 (grub.cfg) 或 systemd-boot,並啟用 Secure Boot 相容模式
  • Windows 10/11 + Linux 雙系統:建議先裝 Windows,再裝 Linux (安裝程式通常自動偵測並配置 GRUB)
  • 多 Linux 發行版共存:共用 /boot/efi (UEFI) 或 /boot (Legacy),各自獨立 / 與 home
Copyright © Windows教程網 All Rights Reserved