Howto: Fixing GRUB After A Windows Installation and Fixing The GRUB Menu
January 25, 2008 at 7:48 pm | Posted in tips and tricks, xubuntu | 31 CommentsTags: grub, restore, tips and tricks, windows, xubuntu
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" -rThe resulting “find” command will display something like
(hd0,1)
. In this example, you would then typeroot (hd0,1)
and thensetup (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 😀
P.S.- If you have a question, I’ll be happy to answer to the best of my ability.
Thanks David!
31 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Create a free website or blog at WordPress.com.
Entries and comments feeds.
[…] Get the rest here […]
Pingback by IronLinux.org » Howto: Fixing GRUB After A Windows Installation and Fixing The GRUB Menu— January 26, 2008 #
Thanks
I was searching that command since a little while
Comment by Jo— January 28, 2008 #
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?
Comment by jason— January 29, 2008 #
jason, there should be an icon, if not, that’s probably a bug…
Comment by Vincent— February 13, 2008 #
Oh, sorry, I misunderstood. What I meant it: if it can’t mount it, it’s probably a bug (which should be reported).
Comment by Vincent— February 13, 2008 #
Wonderful!
Love that the find command is included. Didn’t find that in any other guide.
Comment by Gustav— May 7, 2008 #
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?
Comment by H— July 3, 2008 #
Great article. NOw i know the commands 😉
sudo grub
find /boot/grub/stage1
root (x,y)
setup (x)
quit
sudo shutdown “now” -r
Comment by geniv— August 11, 2008 #
[…] Via Xubuntu Blog […]
Pingback by » Recupera GRUB después de instalar Windows 7 | Tecnologías Libres— January 12, 2009 #
[…] Howto: Fixing GRUB After A Windows Installation and Fixing The GRUB Menu « Xubuntu Blog (tags: windows7 ubuntu grub) […]
Pingback by links for 2009-01-21 « steinarcarlsen— January 21, 2009 #
[…] Ver tambien este articulo […]
Pingback by Recuperar el Grub « OsoSentado— February 6, 2009 #
Thank you for this article. Windows 7 has broke my GRUB 😦 Nazisoft…
Comment by Adomas Bosanova— March 16, 2009 #
thank you! VERY VERY USEFULL!!!!!!!!!!!!!!!!!!!!!!
Comment by renoua— May 26, 2009 #
Worked great. Item 6 of the much used:
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
says:
“6. Type “setup (hd0,3)”. This is key. Other instructions say to use “(hd0)”, and that’s fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as “(hd0,3)”.”
However, it seems to be key to be able to write grub to the mbr, so I would recommend, for those who installed winxp after, to use the hd0 option as recommended here
Thanks!
Comment by wanichan— August 8, 2009 #
Excellent. Once again, UNIX amazes me with its elegance and simplicity…
Thanks a lot for this very helpful article.
Comment by der_ast— August 11, 2009 #
[…] as it happens with all Windows installations, not just 7. With a bit of Googling, I found a nice blog post that walks you through how to get GRUB […]
Pingback by Getting GRUB After Installing Windows 7 | Pi/Pi— August 26, 2009 #
Hi, Linux n00b here. So I had Vista and Ubuntu on my laptop and GRUB was my bootloader. I just updated to Windows 7 and the Windows bootloader is now in charge. Instead of giving the option to load Ubuntu, I am allowed to load GRUB, which takes me to the regular GRUB boot menu. Except, it’s the menu from before my recent upgrade to Ubuntu 9.04, it shows 8.10. When choosing this, it remarks how it can’t find some file. I can access my Ubuntu partition from Windows and the menu.lst file is in tact with the correct entries. Is there a way to repoint to the GRUB loader by just changing the text of a file?Thanks.
Comment by EP— September 22, 2009 #
ubuntu@ubuntu:~$ sudo grub
sudo: grub: command not found
What do I do now??
Comment by Anguel Nikolov— November 11, 2009 #
@Angel
sudo apt-get update
sudo apt-get install grub
This will install GRUB, now junt fallow the tutorial.
Comment by Alan Hoffmeister— November 21, 2009 #
This does not always work, the downloader does not want to start
Comment by Sudonymn— April 29, 2010 #
sudo grub-install …is the proper command to use. No need to install grub again since it was already installed since you had grub boot loader prior installing windows…
Comment by GrubEinstein— December 12, 2009 #
Thank you! you help me
Comment by brih— January 7, 2010 #
Thank you – you have saved me hours of stuffing around and saved me from having to reload operating systems. Many thanks to you!
Comment by manorina— March 20, 2010 #
Thanks!
Comment by 开源— June 18, 2010 #
I typed:
sudo grub
and it was fine.
I typed:
find /boot/grub/stage1
and got:
Error 15: File not found
I tried:
sudo apt-get grub
but it said I was good to go. Any suggestions?
Comment by Asclepius— August 7, 2010 #
same problem here, at ‘find /boot/grub/stage1’ i get ‘error 15: file not found’
i could just reinstall linux mint 9, but i’d like to avoid that if possible.
Comment by youngdaddytc— October 5, 2010 #
Thanks for the tips, but I get the “Error 15: File not found” too,
Comment by Marco— January 1, 2011 #
Hey you all can find the best solution of this problem over here:
http://goo.gl/HXsZv
Comment by Sagar— June 25, 2011 #
http://goo.gl/HXsZv is the best solution..fro this problem…
Comment by sahil— July 23, 2011 #
Here you will find the best solution of this problem:goo.gl/HXsZv
Comment by Sameer— September 11, 2011 #
[…] Grub Rescue ? document.write('[Log in to get rid of this advertisement]'); Hi guys:i have run into a problem with my Xubuntu12.04! the other day when i started up the PC,a Dell pentium4 with Xubuntu installed only OPS, i Had a black blank screen on boot with< Grub Rescue > tried to use the CD to boot no avail then i tried to reinstall Xubuntu No Avail,then since i keep many CDs different Distros around i tried Linux Mint 14 Nadia i struggled a little bit at first but at second try it booted up then it installed smoothly, today i was inquiring about this Grub Rescue problem and came across this Blog about the solution,since i did not try it and don't know if it works ,I'd like your opinion on this for a future problem of this arising in the future! https://xubuntu.wordpress.com/2008/01…the-grub-menu/ […]
Pingback by Grub Rescue ?— November 18, 2013 #