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

Ubuntu 系統災難恢復實錄:誤刪 Boot 分區與 Grub 修復全過程

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

背景

三系統共存:Ubuntu 12.04(主力,磁盤不足)、Ubuntu 14.04、CentOS。嘗試用 GParted Live 刪除後兩系統分區騰出空間。

分區佈局

sda1: Ubuntu 14.04 (原 Win7)sda3: NTFS D 盤sda4: ext4 /boot (關鍵!)sda5: swapsda6: Ubuntu 12.04 /sda7: /homesda8: swapsda9: CentOS /sda10: swap

第一次誤操作

誤以為 sda4/sda8 屬於 14.04,刪除 sda4(/boot)、sda8 及所有 swap。重啟進入 grub rescue:

error: /grub/i386-pc/normal.mod not found

Grub Rescue 自救嘗試

  1. set prefix=(hd0,msdos6)/boot/grub、set root=(hd0,msdos6)。
  2. insmod normal 成功(路徑變為 i386-pc),但 normal 命令報 symbol 'grub_term_highlight_color' not found。
  3. 查資料發現是 Grub 版本不匹配,需 Live 系統重裝 Grub2。

Live U 盤修復曲折

  • 復制 Live 系統 /boot 到目標分區 → 進入 Live 系統而非目標系統。
  • update-grub 報 failed to get canonical path of /cow。
  • grub-install /dev/sda 報 /boot/grub not readable。
  • 嘗試 chroot 修復:
    sudo mount /dev/sda6 /mntsudo mount --bind /sys /mnt/syssudo mount --bind /proc /mnt/procsudo mount --bind /dev /mnt/devsudo chroot /mntsudo apt-get install --reinstall grub2

關鍵發現:/etc/fstab 掛載點配置

原 12.04 系統分離了 /、/boot、/home 三分區,/etc/fstab 記錄 UUID 掛載關系。修復後需手動補全:

UUID=65a7fc16... / ext4 errors=remount-ro 0 1UUID=aef790b3... /home ext4 defaults 0 2

用 blkid 核對分區 UUID,修正 fstab 後重啟終於進入原 12.04 系統。

教訓總結

  1. 刪除分區前必須確認掛載點,lsblk -f/cat /etc/fstab 核對。
  2. /boot 分區極其關鍵,不可輕易刪除或移動。
  3. Grub 修復首選 chroot + grub-install --root-directory,而非直接在 Live 系統運行 update-grub。
  4. 多系統環境下,保留一個專用 Live USB(如 Boot-Repair-Disk)應急。
Copyright © Windows教程網 All Rights Reserved