Oops, I updated Windows and overwrote the MBR
I just updated to Windows 7 on my dual-boot laptop, and of course, Windows is greedy, and with its brain-dead installation process it just assumes I would like to overwrite the MBR. Here’s how I got GRUB working again:
I downloaded the latest ArchLinux Live distro from http://arch-live.isawsome.net/iso/ which at the time of writing was “20080731″. Burned the ISO to a disk and booted the computer from it. I chose the console only boot option, no need for a full desktop session as this is a quick fix.
The steps to locate the correct GRUB info and rewrite the MBR, directly from the ArchLinux wiki pages at http://wiki.archlinux.org/index.php/Grub. Just be mindful, like always, that if you do this wrong you may make matters worse, so do your reading first! If you screw up your computer, it’s your own fault.
If you are unaware of the the location of /boot, use the GRUB shell find command to locate the GRUB files. Enter the GRUB shell by:
# grub
The following example is for systems without a separate /boot partition, wherein /boot is merely a directory under /:
grub> find /boot/grub/stage1
The following example is for systems with a separate /boot partition:
grub> find /grub/stage1
GRUB will find the file, and output the location of the stage1 file. For example:
(hd0,0)
This value should be entered on the root line in your configuration file.
Use the root command with the output from the find command to instruct GRUB which partition contains stage1 (and therefore, /boot):
grub> root (hd0,0)
The following example installs GRUB to the MBR of the first drive:
grub> setup (hd0)
Then just reboot, pop the live CD out, and you have control of your computer again!
