Howto: Fixing GRUB After A Windows Installation and Fixing The GRUB Menu

January 25, 2008 at 7:48 pm | In tips and tricks, xubuntu | 13 Comments
Tags: , , , ,

Windows is not really friendly towards other operating systems – when you installed it while another operating system is already installed, it will replace the bootloader with its own, without including any reference to that other operating system – preventing you from booting it. This is why it is often recommended to install Xubuntu after Windows. Sometimes, however, installed Windows afterwards is unavoidable. Restoring Xubuntu’s bootloader (GRUB) can be a pain.

Luckily, David Mooney comes to the rescue: in a post to the xubuntu-users mailinglist, he explains how to restore GRUB:

If for some odd reason you missed having the Windows operating system and you decided to install it on another partition, you will notice your GRUB is missing afterwords. This usually happens and is a huge headache for those trying to get their GRUB back. Here’s what you need to do to get it back:

Put your bootable Ubuntu/Xubuntu install disk in the CD drive and run it. Instead of installing anything, click on the menu to open the terminal application.

In terminal mode, type the following:

sudo grub
find /boot/grub/stage1
root (x,y)
setup (x)
quit
sudo shutdown "now" -r

The resulting “find” command will display something like (hd0,1). In this example, you would then type root (hd0,1) and then setup (hd0) in the above area. These numbers might be different; that’s why I included the “find” command so that folks who might have their Ubuntu partitions located either in front or behind their Windows installation or on a completely separate internal/external hard drive so that you will get the appropriate/correct setup numbers.

Ok, now you got your GRUB-on, but what about that darn GRUB menu? It’s not displaying what you want it to display? Well, let just see here…

Upon reboot, select “Recovery Mode”, usuaully the second option down on the GRUB menu. This will allow you to boot into the root. Once you’re in the terminal mode, type:

editor /boot/grub/menu.lst

Well, the rest is pretty much self explanatory. There should be enough comments in the menu.lst to direct you to what you can and cannot do to your GRUB menu.lst.

I usually put the Windows option at the top of the menu so that others (none-Linux users) who use my computer can find it easily if they have to do a reboot. Your Windows installation will have a different root than your Ubuntu/Xubuntu, but it’s usually automatically placed by GRUB once it’s set up again (like the above). I also recommend removing the timeout option as this is sometimes annoying. Have fun!

-David :D

P.S.- If you have a question, I’ll be happy to answer to the best of my ability.

Thanks David!

13 Comments »

RSS feed for comments on this post. TrackBack URI

  1. [...] Get the rest here [...]

  2. Thanks

    I was searching that command since a little while

  3. How to Retrieve Hard Drive Files Off a Damaged Computer using xubuntu

    i burned a copy of xubuntu onto a cd and the booted my computer to run from the cd in order to retrieve my hard drive files. But i cant seem to see the hard drive on the desktop. there is one icon that says it cant mount volume?

  4. jason, there should be an icon, if not, that’s probably a bug…

  5. Oh, sorry, I misunderstood. What I meant it: if it can’t mount it, it’s probably a bug (which should be reported).

  6. Wonderful!
    Love that the find command is included. Didn’t find that in any other guide.

  7. When i reboot i get something about checking for required files needed to boot how do i get it to stop displaying after every boot?

  8. Great article. NOw i know the commands ;-)

    sudo grub
    find /boot/grub/stage1
    root (x,y)
    setup (x)
    quit
    sudo shutdown “now” -r

  9. [...] Via Xubuntu Blog [...]

  10. [...] Howto: Fixing GRUB After A Windows Installation and Fixing The GRUB Menu « Xubuntu Blog (tags: windows7 ubuntu grub) [...]

  11. [...] Ver tambien este articulo [...]

  12. Thank you for this article. Windows 7 has broke my GRUB :( Nazisoft…

  13. thank you! VERY VERY USEFULL!!!!!!!!!!!!!!!!!!!!!!


Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.