I just reinstalled Windows on my dual-boot system and had to reinstall grub as Windows setup overwrites the existing master boot record. Here’s how I did it using a Linux Live-CD (im my case an Ubuntu 7.04 CD I had lying around). My Linux root partition is
First it’s necessary to mount our Linux filesystem (including
/dev). If you got
/boot on an extra partition, you have to mount that partition too.
$ mkdir /mnt/root $ mount -t ext3 /dev/sda6 /mnt/root $ mount -t proc none /mnt/root/proc $ mount -o bind /dev /mnt/root/dev
Then we can chroot into our system and re-install grub on
$ chroot /mnt/root /bin/bash $ grub-install /dev/sda