Everytime I have to look up how to install grub after the mbr got messed up. Therefor here a link to speed up the process…

Manual page of Grub about grub-install

The important part is the line

mount -t ext2 /dev/hda1 /mnt
grub-install --root-directory=/mnt hda