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

Ubuntu GRUB Rescue 模式修復開機引導完整教學

編輯:Linux 系統常見問題解答

問題成因

  • 重裝 Windows 覆寫 MBR
  • 調整分區導致 GRUB 核心映像找不到 /boot/grub
  • GRUB 升級失敗或配置檔損壞

進入 grub rescue> 提示符表示 GRUB Stage 1.5/2 無法載入。

核心概念

GRUB Rescue 手動啟動步驟

  1. 列出分區尋找 Ubuntu 根分區
    ls
    # 輸出範例:(hd0) (hd0,msdos1) (hd0,msdos5) ...
    ls (hd0,msdos5)/boot   # 直到出現 grub 目錄、vmlinuz、initrd.img
  2. 設定 root 與 prefix,載入 normal 模組
    set root=(hd0,msdos5)
    set prefix=(hd0,msdos5)/boot/grub
    insmod normal
    normal

    成功進入 GRUB 選單後可選擇 Ubuntu 開機。

  3. 進入系統後修復 MBR
    sudo update-grub
    sudo grub-install /dev/sda   # 裝置路徑勿加分區號

進階:chroot 完整重裝 GRUB(Live USB 環境)

# 1. 開機進入 Ubuntu Live USB(版本、架構需一致)
# 2. 掛載根分區
sudo mount /dev/sda5 /mnt
# 3. 若有獨立 /boot 分區
sudo mount /dev/sda1 /mnt/boot
# 4. 掛載虛擬檔案系統
for d in /dev /dev/pts /proc /sys /run; do sudo mount --bind $d /mnt$d; done
# 5. chroot 進入目標系統
sudo chroot /mnt
# 6. 重建配置並重裝 GRUB
update-grub
grub-install /dev/sda
grub-install --recheck /dev/sda
# 7. 退出與卸載
exit
for d in /mnt/dev/pts /mnt/dev /mnt/proc /mnt/sys /mnt/run; do sudo umount $d; done
sudo umount /mnt/boot 2>/dev/null
sudo umount /mnt
# 8. 重開機
reboot

UEFI 系統注意事項

  • 無 MBR 概念,改為 EFI 系統分區 (ESP, FAT32) + /boot/efi
  • 修復指令:grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu
  • Live USB 需以 UEFI 模式開機才能 chroot 修復 UEFI 系統。

常見錯誤與對策

  • error: unknown filesystem:ls 時分區號錯誤,繼續嘗試下一個。
  • insmod normal 失敗:prefix 路徑錯誤,確認 /boot/grub 實際位置。
  • 重裝後仍進 rescue:檢查 BIOS 開機順序是否指向正確磁碟;多磁碟時 grub-install /dev/sdX 確認 X 正確。
Copyright © Windows教程網 All Rights Reserved
元件說明
BIOS/UEFI韌體,執行 POST 並載入啟動裝置首扇區
MBR (512 bytes)含 GRUB Stage 1(極小)與分區表
GRUB Stage 1.5 / core.img檔案系統驅動,讀取 /boot/grub
/boot/grub/grub.cfg選單配置,由 update-grub 產生