[PLUG] How to recover GRUB on MBR

Pranav Peshwe pranavpeshwe at gmail.com
Mon Jul 6 09:36:24 IST 2009


Hi Pankaj,

On Mon, Jul 6, 2009 at 9:06 AM, Vaibhav Kulkarni <netvaibhav at gmail.com>wrote:

> On Sun, Jul 5, 2009 at 7:18 PM, Pankaj Kumar<pankaj at glug4muz.org> wrote:
> > Hi all,
> >  Initially on my system Windows Xp and Open SUSE 11 was installed. The
> menu to
> > switch between these two operating systems was appearing with the help of
> > GRUB boot loader. Yesterday I reinstalled Windows Xp due to some problem
> in
> > it. Now GRUB is not appearing. So I am unable to boot into Open SUSE 11.
> I
> > know that Open SUSE 11 is still installed in one of the partition of my
> hard
> > disk. But as MBR has been overwritten by Windows Xp and so I am not able
> to
> > boot into Open SUSE 11. So please tell me how to recover GRUB on MBR?
>
> I have run into this situation several times and the recovery is quite
> simple. All you need is a live CD to boot into some Linux.
>
> Assuming your root partition is /dev/sda5 and you do not have a
> separate /boot partition,
>
> 1. Boot live CD
> 2. On root prompt:
> # mkdir /mnt/sda5
> # mount /dev/sda5 /mnt/sda5


I think mounting is not required since, writing an MBR is not a filesystem
dependent task. `grub-install  /dev/<boot/root partition name>` should do
it.


> # grub-install --root-directory=/mnt/sda5 '(hd0)'
> 3. Reboot.
>


I would recommend a read of the howtos and documentation available related
to grub and bootloaders. That will help you to backup and restore your
bootloader and understand things better.

My 2 cents...
CMIIW.

-Pranav
http://pranavsbrain.peshwe.com



More information about the Plug-mail mailing list