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

重裝 Windows 後修復 Ubuntu GRUB 引導 (MBR 恢復)

編輯:系統常見問題解答

重裝 Windows 會覆蓋 MBR 導致 GRUB 消失,無法進入 Ubuntu。使用 Ubuntu Live CD 修復 GRUB 至 MBR 即可恢復雙系統啟動菜單。

修復步驟

  1. 啟動 Ubuntu Live CD,進入桌面打開終端。
  2. 輸入 sudo grub 進入 GRUB 命令行。
  3. 尋找 /boot/grub/stage1 所在分區:
    find /boot/grub/stage1
    輸出如 (hd0,2) 表示第一塊硬盤第 3 個分區 (從 0 計數)。
  4. 設置根分區並安裝 GRUB 到 MBR:
    root (hd0,2)
    setup (hd0)
    顯示 success 即成功。
  5. quit 退出,重啟電腦。

多硬盤注意事項

若 Windows 在第一塊盤、Linux 在第二塊盤,BIOS 從第一塊盤啟動,則第 4 步 setup (hd0) 仍需指向第一塊盤 (hd0),將 GRUB 寫入啟動盤 MBR。或對每塊盤執行 setup (hd0)、setup (hd1) 保險。

原理

MBR 僅 512 字節,Windows 安裝器會無條件覆寫。GRUB 分 Stage1 (MBR)、Stage1.5、Stage2 (/boot/grub);修復實質是將 Stage1 重寫入 MBR 並指向正確分區。

Copyright © Windows教程網 All Rights Reserved