2008-12-06

Rebuild Grub Bootloader

GRUB (GRand Unified Bootloader)是目前 Linux 下常用的開機磁區管理程式, 預設情況會覆蓋掉 Windows 的 MBR 資料。重裝 Windows XP 後,Windows XP 會以系統預設的 MBR 覆蓋掉 GRUB 磁區,這個時候就需要重建 GRUB。

步驟如下:
  1. 用 Linux Live CD 開機
  2. 進入 Console Mode
  3. sudo grub (以 root 權限執行 grub shell)
  4. 首先尋找系統中的 grub 開機資料,find /boot/grub/stage1
  5. 系統會回應如 (hdx, y) 這樣的資訊,x 代表實體硬碟,y 代表分割區
  6. 指定 root 位置, root (hdx,y)
  7. 安裝 grub, setup (hdx)
這樣就重建完 GRUB,消失了 Linux 開機程式又回到系統。

Grub 的用途很多,當我們已經擁有一個正常的 Windows 系統,然後想安裝 Linux 系統,卻沒有光碟可用時,GRUB 便可完成這個任務。