Archive for February, 2008

Say you had a laptop that was set up to dual-boot windows and linux. And then, say, for some unknown reason, that the windows partition got completely hosed. So, after reinstalling windows on that partition, how do you fix the MBR so that grub runs to give the option of starting either windows or linux?

1. Boot into rescue mode from linux install disks

linux rescue

2. Let the partition be mounted under /mnt/sysimage

3. After mounted, change the root to /mnt/sysimage

chroot /mnt/sysimage

4. Reinstall grub

grub-install /dev/sda

Or use /dev/hda or whatever the main disk on the system is