昇級 GRUB boot loader

昇級 GRUB 之後,會有下列的訊息:

* *** IMPORTANT NOTE: you must run grub and install

* the new version's stage1 to your MBR. Until you do,

* stage1 and stage2 will still be the old version, but

* later stages will be the new version, which could

* cause problems such as an unbootable system.

對於這種長長的訊息,通常都看不下去。尤其有時一次昇級很多程式,更是會被忽略。

沒想到,果然發生訊息中所警告的情形。更不幸的是,GRUB是在一個長假的出門前昇級的,假期中雖然帶了 notebook,可是沒帶到電源,就整個假期都不想開機,然後回到家,接上電源,電腦真的開不起來。

有時開到一半就當了,或是開到一半又自動重開,變成中毒後的 XP 了,或是開成了,卻進不了 X window。開始嘗試各種解決方法,拆記憶體、電源、硬碟 ,所有可動的部分都動了,差點要去買一顆新的硬碟。

後來,回到辦公室上班之後,昇級 GRUB 時,注意到上面的訊息後,重新將 GRUB 給 install 至 MBR,又恢復正常了。

步驟如下,進入 GRUB,

grub> root (hd0,0)

Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)

Checking if "/boot/grub/stage1" exists... yes

Checking if "/boot/grub/stage2" exists... yes

Checking if "/boot/grub/e2fs_stage1_5" exists... yes

Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.

succeeded

Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2

/boot/grub/menu.lst"... succeeded

Done.