• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Reinstall GRUB bootloader after windos wipes it out

#1
If you run a dual-boot system with Linux and Windows, this has happened to you. You had to do your monthly reinstall of Windows, and now you don't see the linux bootloader anymore, so you can't boot into Ubuntu or whatever flavor of linux you prefer.
Here's the quick and easy way to re-enable Grub.
1) Boot off the LiveCD
2) Open a Terminal and type in the following commands, noting that the first command will put you into the grub "prompt", and the next 3 commands will be executed there. Also note that hd0,0 implies the first hard drive and the first partition on that drive, which is where you probably installed grub to during installation. If not, then adjust accordingly.

sudo grub
> root (hd0,0)
> setup (hd0)
> exit

Reboot (removing the livecd), and your boot menu should be back.

Only read below if Windows is now missing from the boot menu
If you installed Ubuntu before you installed Windows, then Ubuntu will not have anything in the grub configuration for Windows. This is where you'll have to do a bit of manual editing to the grub boot menu file.
If you open the file /boot/grub/menu.lst with the following command:
sudo gedit /boot/grub/menu.lst
You'll see a sample section for Windows, which you'll want to uncomment and add to the boot menu list in whatever position you want it in. (uncomment by removing the #'s)

# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1

Note that you should also verify that hd0,0 is the correct location for Windows. If you had installed Windows on the 4th partition on the drive, then you should change it to (hd0,3)
 
#3
i guess because linux people think person will shift from windows to linux not from linux to window. So if anyone first installed linux then there is lot more chance he won't go for window. But this is vice versa if person install window first :)
 

falconguard

Carbon based lifeform
Political User
#4
Monthly reinstall of windows? Whatever for? Both are stable enough for me that I have not reinstalled anything.

What if you are using the LiLo bootloader?
 

KenJackson

Linux Guy
Political User
#5
i guess because linux people think person will shift from windows to linux not from linux to window. So if anyone first installed linux then there is lot more chance he won't go for window. But this is vice versa if person install window first :)
I thought Carpo was making a statement or a lament, but you seem to be answering him like it was a question.

Windows is almost always installed first anyway, because almost all PCs are sold with Windows installed. And the few people that buy a PC without Windows are usually savvy enough to want something better. :p

But if you are installing everything from scratch, there is a very good reason to install Windows first. Windows assumes it owns the machine. It is not designed to play well with competitors. So for best results, install Windows first and then install any other OS you want, which will surely behave like a gentleman and not try to take over the MBR unless you ask it to.
 
#6
I thought Carpo was making a statement or a lament, but you seem to be answering him like it was a question.

Windows is almost always installed first anyway, because almost all PCs are sold with Windows installed. And the few people that buy a PC without Windows are usually savvy enough to want something better. :p

But if you are installing everything from scratch, there is a very good reason to install Windows first. Windows assumes it owns the machine. It is not designed to play well with competitors. So for best results, install Windows first and then install any other OS you want, which will surely behave like a gentleman and not try to take over the MBR unless you ask it to.
oh i thought it was question. nways thanks...
 

Dark Atheist

Moderator
Staff member
Political User
#7
Monthly reinstall of windows? Whatever for? Both are stable enough for me that I have not reinstalled anything.

What if you are using the LiLo bootloader?
just type liloconfig and remake it, and yes the above reply was a statement and not a question, because if it was a question it would have had a ? at the end of it :p
 

Mainframeguy

Debiant by way of Ubuntu
#9
...which will surely behave like a gentleman and not try to take over the MBR unless you ask it to.
Having just had the unfortunate experience of installing XP and then UBUNTU intrepid Ibex twice each I can confirm that the Ibex is no "gentleman"! So the moral of the story is always expect the unexpected - the partitioner in Ibex has issues and royally screwed me (partly my fault, should have planned ahead and done a little googling research, but easy to be wise after the event!).

Always expect the unexpected! :D
 

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,962
Messages
673,247
Members
89,020
Latest member
saryrehgy