Re-Enable Grub For Linux After Windows Install
Following the installation of Windows 7 on my desktop machine that was previously running Ubuntu 9.04, I realized that one of my partitions was missing. It was formatted as ext3 so of course it wouldn’t show up in windows. When I went to boot back into linux the grub boot manager was gone. The machine just booted straight into windows 7.
To re-enable grub was a lot simpler than I thought it would be. Since the Ubuntu 8.04 install disc that I had lying around also works as a live disc I booted my desktop off that. Once Ubuntu started up I opened up a terminal and typed these commands:
sudo grub
root(hd0,7)
setup(hd0)
quit
I then rebooted and grub was back to normal with both my Ubuntu operating system and windows 7 listed. Note that hd0,7 was the partition where I installed Ubuntu. If you installed linux before windows then you will probably want to use hd0,0. I installed windows 7 over a broken windows xp partition that I had installed before everything else.
If you installed ubuntu before you installed windows then you’re probably going to have to edit your ‘/boot/grub/menu.lst’ file. The grub documentation may be helpful.
August 16th, 2009 at
[…] Re-Enable Grub For Linux After Windows Install http://codytaylor.org/?p=14228 […]
August 17th, 2009 at
“If you installed ubuntu before you installed ubuntu…”
If you installed ubuntu before you installed GRUB.
August 17th, 2009 at
Thank you sir. Wrote that pretty late last night. I meant before you installed windows because then grub will not know anything about windows and then you will have to enter it manually.
December 23rd, 2009 at
HellO! Very nice to mention is the tab completion feature which can be used in the grub prompt after specifying the root.
root (hd0,7)
cat /
Just to verify that the proper disk / partition is selected
oh and to see a list of available disks / partitions use Tab completion
root
:)