在已安裝 Windows 7 的電腦上新增 BackTrack 4 (BT4) 滲透測試系統,需配置雙啟動引導。本文採用 Grub4DOS + Windows BCDedit 方案,避免修改 MBR 導致 Windows 7 無法啟動,提供完整指令與菜單配置。
grldr、grldr.mbr、menu.lst 放置 C: 根目錄。bt4-final.iso),解壓至目標分區(例:E: 槽),保留 /boot/vmlinuz、/boot/initrd.gz、/casper/filesystem.squashfs 等關鍵檔案。以系統管理員身分開啟命令提示字元,依序執行:
bcdedit /create /d "Grub4DOS" /application bootsector
:: 記錄輸出的 GUID,如 {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
bcdedit /set {GUID} device boot
bcdedit /set {GUID} path \grldr.mbr
bcdedit /displayorder {GUID} /addlast
bcdedit /timeout 5
註:{GUID} 替換為上一步實際輸出的識別碼,含大括號。
編輯 C:\menu.lst,內容如下:
color black/cyan yellow/cyan
timeout 5
default 0
title Windows 7
find --set-root /bootmgr
chainloader /bootmgr
boot
title BackTrack 4
find --set-root /boot/vmlinuz
kernel (hd0,5)/boot/vmlinuz BOOT=casper boot=casper nopersistent rw quiet vga=0x317
initrd (hd0,5)/boot/initrd.gz
boot
關鍵參數說明:
(hd0,5):Grub 裝置表示法。hd0=第一顆硬碟,分區編號從 0 起算,主分區 0-3,邏輯分區從 4 開始。若 BT4 解壓在 E: 槽(第 2 個邏輯分區),則為 (hd0,5)。請用 find --set-root /boot/vmlinuz 自動偵測。vga=0x317:1024x768x16 解析度,可依螢幕調整。nopersistent:不儲存變更至硬碟(Live 模式),若需持久化請移除並配置 persistent 參數與儲存裝置。重啟後可能出現:
1. Grub4DOS 選單(Windows 7 / BT4)
2. 選 Windows 7 → 進入 Windows 7 自帶 BCD 選單(Windows 7 / Grub4DOS)
形成迴圈。
解決方案:使用 EasyBCD(免費版)管理 BCD:
(hd0,5) 對應分區、vmlinuz/initrd.gz 路徑、檔案權限。bcdedit 指令必須以系統管理員身分執行。bcdedit /export C:\BCD_Backup。掌握 Grub4DOS + BCDedit 雙引導技術,不僅能安裝 BT4,更能輕鬆管理多重 Linux 發行版與 Windows 共存環境。