Recovering the grub boot loader after Windows (re)install

After re-installing Windows XP on my Laptop (I dual-boot Windows and Ubuntu), my grub (linux bootloader) was overwritten. It is easy to fix this, so I once again can select between Linux and Windows at boot time:

  • Boot Ubuntu Desktop/Live CD
  • Open Terminal application
  • Mount root partition of local Linux Install (eg. mount /dev/sda2 /mnt)
  • Reinstall grub: grub-install –root-directory=/mnt /dev/sda

  • If you get errors try: grub-install –root-directory=/mnt /dev/sda –recheck
  • Remember to use the correct device names above.

More at: