2009年9月22日火曜日

GRUBをHDDに再インストール

usbメモリへのOSインストールで、ブートローダーのインストールに失敗してしまい、
errorが出て、usbメモリを挿していないと起動しなくなってしまいました。
GRUB Loading, please wait...
Error 21
この復旧の方法はGRUBを再インストールすればよかったんです。
usbメモリを挿した状態なら、HDDから起動することができるから、
HDDに入っているOSを起動して、/boot/grub/menu.lstの内容を確認して
「 sudo grub-install /dev/sda 」のコマンドを打てば復旧しました。

$ sudo grub-install /dev/sda
[sudo] password for ubuntu:
Searching for GRUB installation directory ... found: /boot/grub
Installing GRUB to /dev/sda as (hd0)...
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0) /dev/sda
後で調べたところ、/(root)と/bootが別のパーティションになっている時は、
オプションの「 --root-directory=/ 」が必要みたいです???
とりあえず復旧できてよかったぁ~~(^^)

0 件のコメント:

コメントを投稿