Skip to content

How to Repair GRUB Boot Loader using Ubuntu Live CD

08/09/2010
Boot Loader

Boot Loader

Sometimes it is necessary to repair GRUB; for example, after installing another operating system alongside Ubuntu. Since Ubuntu 10.04 GRUB2 is used as the default boot loader. Earlier versions use GRUB.

Here are some simple steps to restore GRUB to the MBR after installing Windows on alongside Ubuntu. The Ubuntu root (/) partition is installed on the first partition (sda1 or hd0,1) of the first hard drive (sda or hd0.) Please tailor the following instructions to match your circumstances.

GRUB2

Start you computer using the Ubuntu LiveCD and, if necessary, select the option to try Ubuntu. This will load the Ubuntu Desktop.

Open the terminal (Ctrl-Alt+T) and type the following to find the correct partition with Ubuntu:

$ sudo fdisk -l

Mount your Ubuntu installation and reinstall GRUB2 on the mounted partition:

$ sudo mount /dev/sda1 /mnt
$ sudo grub-install --root-directory=/mnt/ /dev/sda

Reboot (and remove the LiveCD.)

Open the terminal (Ctrl-Alt+T) and update the GRUB2 menu to pick any new OS:

$ sudo update-grub

GRUB

If you’re still running earlier versions of Ubuntu with GRUB follow these steps.

Start you computer using the Ubuntu LiveCD and, if necessary, select the option to try Ubuntu. This will load the Ubuntu Desktop.

Open the terminal (Ctrl-Alt+T) and type the following repair grub:

$ sudo grub
> root (hd0,1)
> setup (hd0)
> quit

Reboot (and remove the LiveCD.)

Image: Renjith Krishnan/ FreeDigitalPhotos.net.

Advertisement
Leave a Comment

Leave a Reply

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

Gravatar
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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 457 other followers