You will have to keep a ubuntu live cd handy for this to work.
- Boot from your live cd.
- Open a terminal.
We are going to do a lot of sudo work so its better to type $ sudo -i
To find out more information on your partition do a # fdisk -l
Find your linux root partition.
Now we will create a mount point for your linux partition.
# mkdir /mnt/oldroot
Now we will mount the partition in the dir '/mnt/oldroot'
# mount -t /dev/hda1 /mnt/oldroot (Note i am assuming your root partition is /dev/hda1, if it is something else replace it suitably. Incase you don't know what your root partition is, then mount all your partitions one by one. )
# ls /mnt/oldroot To see if your mounted partition is the one you wanted.
Change into the boot directory. # cd /mnt/oldroot/boot/
Now we will actually reinstall grub. # grub-install --root-directory=/mnt/oldroot /dev/hda -recheck
Replace /dev/hda with the location where you want to install grub.
Now if you reboot the new re-installed grub should work.