MarioNote

December 26, 2009

Re-installing GRUB Using Ubuntu Live USB

Filed under: Linux,Linux memo,Ubuntu — mariojump @ 1:24 am

GRUB can be re-installed using Ubuntu Live CD (or Live USB).
I had to do this after upgrading Vista to Windows 7, as Windows 7 installer wiped off the GRUB for Ubuntu and Vista.

Even if your HDD-Installed Ubuntu is 64bit, either 32bit or 64bit Live CD/USB can be used.

You need to know which partition you had GRUB. Mine had /boot in a partition /dev/sda6, and it made me enter:
root (hd0,5)

Here’s the step.

ubuntu@ubuntu:~$ sudo grub
Probing devices to guess BIOS drives. This may take a long time.

[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> device (hd0) /dev/sda
device (hd0) /dev/sda
grub> root (hd0,5)
root (hd0,5)
grub> setup (hd0)
setup (hd0)
[omit]
Running “embed /grub/e2fs_stage1_5 (hd0)”… 17 sectors are embedded.
succeeded
Running “install /grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/grub/stage2
/grub/menu.lst”… succeeded
Done.
grub>

——-
If you use Ubuntu 9.10 Live, whose default is GRUB2, you may need to use GRUB2, or install GRUB.
My Ubuntu 9.10 was originally upgraded from 9.04, so I installed GRUB to Ubuntu 9.10 live USB.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: