Reinstall grub using a Linux Live-CD

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 /dev/sda6.

First it’s necessary to mount our Linux filesystem (including /proc and /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 /dev/sda.

$ chroot /mnt/root /bin/bash
$ grub-install /dev/sda

Done.

  • http://akheron-linux.com akheron

    Bien, te rifaste, pocos pasos y lo necesario sin tanto rollo como en los foros ubuntueros =D VIVA DEBIAN jajajaj 8-D

    • http://maff.ailoo.net/ Mathias

      Thanks for your comment :) Arghs I really have to improve my Spanish, I’m going there in 2 weeks :D

  • http://akheron-linux.com akheron

    Bien, te rifaste, pocos pasos y lo necesario sin tanto rollo como en los foros ubuntueros =D VIVA DEBIAN jajajaj 8-D

    • http://maff.ailoo.net/ Mathias

      Thanks for your comment :) Arghs I really have to improve my Spanish, I’m going there in 2 weeks :D