Recovering GRUB after being overwritten by Windows

By: Hartfiel

January 5, 2006 12:00 am





ENVIRONMENT: Novell Linux Desktop (SP1, SP2, SPx).
WindowsXP, Windows2000.
NLD/WinXP dual-boot installation on the same machine.

PROBLEM: How to recover NLD/WinXP dualboot installation if a subsequent WinXP setup has overwritten your grub loader with the Windows boat loader?

SOLUTION: Here are the details to put grub back in charge again instead of the Windows boot loader.

1. Start NLD installation from NLDSPx-CD

2. Choose your Yast2 language (e.g. English, US) –> Accept

3. Select your Default Desktop (e.g. Gnome) –> Accept

4. Write down your Linux Partitioning Information

In my case it was:

    /dev/hda6 8.9GB (for / with reiser)
    /dev/hda5 1.0GB (for swap)

5. Abort NLD Installation –> Abort

6. Reboot to the NLDSPx-CD and choose ‘Rescue System’ from the main NLD Installation Menu (Linux Kernel will be loaded).

7. Choose a keyboard map (e.g. English, US) –> OK

8. At the Rescue login prompt type: root

9. Mount linux partition to a temp dir, e.g.:

    mkdir /mnt/nld
    mount -t reiserfs /dev/hda6 /mnt/nld

10. change root to the system so paths from ‘/’ are on your linux partition and not the rescue CD’s ramdisk:

    cd /mnt/nld
    chroot /mnt/nld

11. Run grub-install now:

    grub-install /dev/hda
    (not hda6!!!)

12. Reboot

After this procedure the grub boot loader will be recovered and it will also have the original entry for booting Windows XP.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Categories: Technical Solutions

Disclaimer: As with everything else in the SUSE Blog, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.