You could also have repaired grub from the live CD following this tutorial I found somewhere and have used several times. At least I suppose it will fix things even if grub is so beaten as in your case.
Note that the sudo does not have a password on the live cd, just hit enter
The following should be edited a bit but Id on't have the time
Re-install Grub with Live CD,
This method is also the best method to use from a hard disk installed operating system.
It can be done from a grub floppy disk too, or from grub's Command Line Interface or just about anywhere there is already a grub installation present with the necessary Grub files.
You can use this to install Grub to anywhere too, it doesn't have to be only to the MBR of a first hard disk. Grub can be installed to any other hard disk, or to a usbdisk, or floppy disk this way.
The most common use for this operation is to fix your MBR after a Windows re-install has corrupted your MBR with the IPL for the Windows bootloader, so you can only boot Windows.
herman@red~:$ sudo grub
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ 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. ]
I typed 'sudo grub' and pressed 'Enter'.
In Ubuntu, it is important to use the 'sudo' preface to the 'grub' command. If not, you will get what appears to be a grub shell, but you won't be able to do very much with it. You will probably get some confusing error messages.
This is an example of one use of a grub shell. I know this is a Grub shell, because it has a grub prompt, like this, 'grub>_'
grub> find /boot/grub/stage1
Here, I typed 'find /boot/grub/stage1' because I want to find out which partitions in my computer have Grub installed in them, (just to remind me).
This gives me a clue as to exactly where the necessary Grub files may be located that I can install grub from.
grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0x83
The 'root (hd0,1) will tell grub which operating system partition contains the grub I want to install from.
It has to be one of the ones listed by the 'find' command (above).
The Grub menu from the operating system's /boot/grub/menu.lst that I installed grub from is the one that will appear on boot up.
In other words, if (hd0,1) contians Ubuntu, and I install grub from (hd0,1), I'll get Ubuntu's Grub menu on boot up.
If (hd0,3) contians Kubuntu, and I install grub from (hd0,3), I'll get Kubuntu's Grub menu on boot up.
Grub should recognize the filesystem, and will reply with an output similar to the one shown above. If not, then check to make sure you didn't make a mistake.
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 15 sectors are embedded.
Running "install /boot/grub/stage1 d (hd0) (hd0)1+15 p (hd0,1)/boot/grub/stage
2 /boot/grub/menu.lst"... succeeded
The 'setup' command is the command that tells Grub exactly where to install Grub to.
Installing Grub to MBR:
'setup (hd0)' is the command to install Grub's stage1 to MBR.
Stage1_5 will also be installed to the 15 sectors following the MBR in the first track of the hard disk.
May not work - error 27 unknown command
Reset button or if in a gnome/KDE terminal probably just close it.