Re: HOWTO: Restore GRUB (if your MBR is messed up)

I substituted my HD with a larger one and used partimage to move linux partition to the new HD... but I had a continuos Grub Error 15 at boot (without any specified "file not found").

I tried to do anything suggested in this thread but i kept having this problem.

Then i understood it was a BIOS problem. In fact my bios allowes to select a priority in HD booting access. Even if i moved my last HD from master to slave it still was at the top of the bios hd boot priority.

So i changed properly this value and finally the correct grub has loaded.

Re: HOWTO: Restore GRUB (if your MBR is messed up)

This guide sure helped a lot of people I just messed with partitions a little bit so my grub did not boot. Solution? Fire up LiveCD, use Konqueror to Google "Ubuntu howto restore GRUB" and the solution is right there. I have to love this ! Thumbs up

Re: HOWTO: Restore GRUB (if your MBR is messed up)

Has anyone had problems using SATA drives in conjunction with IDE (PATA) drives? I ask this as I have had to physically unplug the power to any IDE drives otherwise GRUB installs to the MBR of the IDE drive. Have had this happen on all my machines so isn't a one off.

Re: HOWTO: Restore GRUB (if your MBR is messed up)

OK, so here's my problem. I'm running a dual boot with Edgy and Windows XP. Recently I started having all sorts of trouble with getting GRUB to boot properly, and I eventually resorted to popping in the Windows XP CD and restoring the MBR from there. Now Windows works fine, but it bypasses GRUB entirely and I can't figure out how to get back to Ubuntu.

I've looked at a lot of the solutions offered here, and they all seem to involve booting from the linux CD. But for some insane reason which I still can't figure out, my CD drive will read practically any disc except the Ubuntu disc. (I've tried burning multiple copies from multiple computers. None of them work, so I'm quite sure it's a problem with my drive.) Can anyone help me restore GRUB without the use of a CD?

Re: HOWTO: Restore GRUB (if your MBR is messed up)

Ok I am trying to get triple boot working. I was running XP and xubuntu. I installed ubuntu and the xubuntu dissapeared off my grub, how do I add xubuntu back to grub or edit the grub menu? FYI xp is hd0, xubuntu is hd4 and ubuntu is hd5
when I put in the command " find /boot/grub/stage1 " the output is " (hd0,5)"
thanks in advance!

In the install CD gui open a terminal or use ctrl+alt+f1 for a different term.
Changes as root user!
> sudo bash """switch to root user"""
> mkdir ubuntumnt """make a mount point"""
> mount -t ext3 /dev/sda1 ubuntumnt """Mount ubuntu drive. the '1' is a partition (s-ata drive, partition 1). In other words, mount the partition, not the drive"""

"""
Edit above to remove the hdd. Since the IDE drive is read first by the system, by observation the s-ata drive will be hd(x) where x is the number after all ide drives (it seems to me), so 4 ides and an s-ata will result in hd4 being the sata drive.
Now we have:
"""

hd0 /dev/hda
hd1 /dev/sda

"""save the file and edit the menu.lst""
> vi ubuntumnt/boot/grub/menu.lst

************************************************** *******************************"""Save the file and enter the grub interface"""

> grub

Now we show where the root is. Since we mounted the edgy partition, we can see the grub folder. (Not mounting is the reason why "find /boot/grub/stage1" sometimes does not work as asked in above posts.
>find /boot/grub/stage1
hd (1,0) """This should be you edgy drive. In my case hd(1,0) after I removed hdd. 2nd Physical drive 2, partition 1. Meaning sda1 in my case"""

Now we follow previous steps in this HOW TO
root (hd1,0) """Define the root partition on the drive
setup (hd1) """Setup grub on the drive"""

"""At this point all previous posts said quit and restart, yet I still got the Error21. I eventually decided the MBR on the hda windows disk was messed up too.
Since I know the windows drive is hd0 I also did"""
setup (hd0)
quit

"""Now we restart the machine and voila! IT works again

Last edited by irrational_e; March 7th, 2007 at 03:20 PM.
Reason: problem solved