2010年5月21日 星期五

[Ubuntu] 解決重新分割磁碟後grub rescue的問題

在裝有Grub的磁碟重新切分割可能會造成grub rescue,
已經不是第一次遇到這個情形了,
所以乾脆這次碰上的時候,也順便紀錄一下,
下次就不用再找資料了。

假設Ubuntu裝在hd0的第2個partition,
那麼看起來應該就像這樣:
grub rescue>
grub rescue>set
prefix=(hd0,2)/boot/grub
root=hd0,2
所以如果出現『grub rescue>』,
就把他設定回來再開機:
grub rescue>ls
(hd0), (hd0,1), (hd0,2), (hd0,3), (hd0,5)
grub rescue>set root=(hd0,2)
grub rescue>set prefix=(hd0,2)/boot/grub
grub rescue>insmod normal
rescue:grub>normal
這樣應該就可以看見grub選單,
進入Ubuntu之後,打開終端機執行:
sudo update-grub
sudo grub-install /dev/sda
重新開機以後應該就正常了。


2 則留言:

  1. 我打到grub rescue>insmod /boot/grub/normal.mod
    步電腦打出incompatible license
    可以點做

    回覆刪除
  2. 謝謝大大~~救了一命~感謝~

    回覆刪除