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

Windows 7 硬碟雙啟動安裝 BT4 (BackTrack 4) 完整教學:Grub4DOS + BCDedit 引導配置

編輯:Win7 系統應用技巧

在已安裝 Windows 7 的電腦上新增 BackTrack 4 (BT4) 滲透測試系統,需配置雙啟動引導。本文採用 Grub4DOS + Windows BCDedit 方案,避免修改 MBR 導致 Windows 7 無法啟動,提供完整指令與菜單配置。

準備工作

  1. 下載 Grub4DOS(推薦 0.4.4 版以上),解壓取出 grldr、grldr.mbr、menu.lst 放置 C: 根目錄。
  2. 下載 BT4 ISO(如 bt4-final.iso),解壓至目標分區(例:E: 槽),保留 /boot/vmlinuz、/boot/initrd.gz、/casper/filesystem.squashfs 等關鍵檔案。

建立 Grub4DOS BCD 啟動項

以系統管理員身分開啟命令提示字元,依序執行:

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} 替換為上一步實際輸出的識別碼,含大括號。

配置 menu.lst

編輯 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:

  • 刪除多餘的「Grub4DOS」項目(保留 Windows 7 項目)。
  • 或將 Grub4DOS 項目重命名為「Linux / BT4」,調整顯示順序與逾時。
  • EasyBCD 亦可直接新增 Linux/Grub4DOS 項目,比手動 bcdedit 直觀。

驗證與測試

  1. 重啟 → 選單選擇「BackTrack 4」 → 進入 BT4 桌面。
  2. 選擇「Windows 7」 → 正常進入 Windows 7。
  3. 若 BT4 進入失敗,檢查 (hd0,5) 對應分區、vmlinuz/initrd.gz 路徑、檔案權限。

注意事項

  • 所有 bcdedit 指令必須以系統管理員身分執行。
  • 修改 BCD 前建議備份:bcdedit /export C:\BCD_Backup。
  • BT4 已停止更新,現代滲透測試建議使用 Kali Linux,安裝邏輯相同。

掌握 Grub4DOS + BCDedit 雙引導技術,不僅能安裝 BT4,更能輕鬆管理多重 Linux 發行版與 Windows 共存環境。

Copyright © Windows教程網 All Rights Reserved