HOW-TO: Restore GRUB after Installing Windows
Sunday, January 14, 2007
I recently had to install Windows onto my system again (see previous post). Of course, in doing so, GRUB was effectively disabled and replaced with the Windows boot loader and its "fresh" MBR (of course, I couldn't boot into Linux from here). Since one just can't live without Linux and GRUB, here's a fairly simple way to get GRUB back:
Now, you will have to add an entry for windows. The format for this would be:
Of course, you will have to change "(hd0,0)" to the partition where Windows is located. You can change the title of the entry... doesn't matter. Be sure to be familiar with the way GRUB identifies hard drives and partitions. Numbers start begin with 0, and letters are also expressed numerically, beginning with 0. For example, /dev/hda1 would be "hda0,0" to GRUB, and /dev/hdb3 is "hda1,2".
Now, reboot, and you should once again be greeted by GRUB, this time with an entry for Windows. Select Windows, and see if it works. If not, you didn't specify the right hard drive/ partition to boot from. Repeat the steps in the preceding paragraph, directing GRUB to a different partition to boot from.
The steps listed above worked for me, and they can for you too! Just be patient, and don't do anything without thinking about it first. Be sure to have a backup of all your data, which is a good thing to have anyways! If you have further questions, you may consult me, or head on over to a forum.
A special thanks to the Ubuntu Community from where I got this information!
- Download the Unofficial "Super Grub Disk." You can download Super Grub Disk as a cdrom iso, floppy disk image or an usb tar.gz.
- Burn it to a CD, put it on a floppy, or install to a USB Disk. Whatever. Just get it on something bootable
- Boot up the "Super Grub Disk"
- Select your language
- Select Linux
- Select "Fix Boot of Linux (GRUB)"
- Go back to first menu
- Select Quit, and then reboot
sudo gedit /boot/grub/menu.lst
Now, you will have to add an entry for windows. The format for this would be:
title Windows XP 64
root (hd0,0)
savedefault
makeactive
chainloader +1
Of course, you will have to change "(hd0,0)" to the partition where Windows is located. You can change the title of the entry... doesn't matter. Be sure to be familiar with the way GRUB identifies hard drives and partitions. Numbers start begin with 0, and letters are also expressed numerically, beginning with 0. For example, /dev/hda1 would be "hda0,0" to GRUB, and /dev/hdb3 is "hda1,2".
Now, reboot, and you should once again be greeted by GRUB, this time with an entry for Windows. Select Windows, and see if it works. If not, you didn't specify the right hard drive/ partition to boot from. Repeat the steps in the preceding paragraph, directing GRUB to a different partition to boot from.
The steps listed above worked for me, and they can for you too! Just be patient, and don't do anything without thinking about it first. Be sure to have a backup of all your data, which is a good thing to have anyways! If you have further questions, you may consult me, or head on over to a forum.
A special thanks to the Ubuntu Community from where I got this information!