LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-28-2004, 11:56 AM   #1
JohnHawes
LQ Newbie
 
Registered: Jan 2004
Location: UK
Distribution: RedHat9
Posts: 3

Rep: Reputation: 0
WinXP overwrote Grub


I was happily using a multiboot system with W2k and Redhat9, until I installed WinXP on a spare partition. This has overwritten Grub. What is the best/easiest way to re-install grub. I presume I can make a linux boot disk from my redhat cds.
 
Old 01-28-2004, 12:00 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
You can just use your RH install CD #1... There's an option to use it as a boot disk to load an already-installed system. I forget exactly, but read the first screen, and it will tell you. Once you get the system booted, you can have GRUB takeover again. "man grub" will help.
 
Old 01-28-2004, 12:01 PM   #3
Kilka
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Mandrake, Redhat, openBSD, Gentoo
Posts: 84

Rep: Reputation: 15
rescue boot

I believe you can do a rescue boot. Pop the cd in and type rescue at the prompt.

-Kilka
 
Old 01-28-2004, 12:51 PM   #4
GT_Onizuka
Member
 
Registered: Aug 2003
Location: Atlanta
Distribution: Debian, OS X
Posts: 711

Rep: Reputation: 30
Yeah, as Kilka said, just use a the rescue function on your installer CDs (or use any sort of boot distro like Knoppix) and just re-setup GRUB. You should be all set from there!
 
Old 01-28-2004, 03:24 PM   #5
Smartcat99S
Member
 
Registered: Jan 2004
Location: NE
Distribution: Arch Linux, SUSE, Gentoo
Posts: 56

Rep: Reputation: 15
Always install windows first!!!

You always need to install windows first.
That way grub is autoconfigged to boot windows.
Solves a lot of headaches!
 
Old 01-29-2004, 04:27 AM   #6
JohnHawes
LQ Newbie
 
Registered: Jan 2004
Location: UK
Distribution: RedHat9
Posts: 3

Original Poster
Rep: Reputation: 0
Install Windows Last

Cheers for the advice, not had time to try yet but hopefully it should work. I've realised that installing Windows first saves a lot of hassles, but windows being what it is, fresh installs are a regular task! Is there way to avoid this happening? Is Grub best installed on the MBR or the /boot partition?
 
Old 01-29-2004, 04:33 AM   #7
Mistshadow
LQ Newbie
 
Registered: Jan 2004
Distribution: several, mostly SuSE, Slack & RH 9
Posts: 25

Rep: Reputation: 15
My advice: save that boot floppy you make during the RH installation. Then when you re/install Windows, boot off the floppy, log in as root and reconfigure Grub. Note that you may have to do this more than once to get it right; this sort of thing can be tricky.
 
Old 01-29-2004, 07:57 AM   #8
DaFrEQ
Member
 
Registered: Mar 2002
Location: Earth... for now
Distribution: SuSE9.2 AMD64; LFS; GentooAMD64; Ubuntu10.04; RHEL 5.5; Solaris10(SPARC)
Posts: 418

Rep: Reputation: 30
Which ever OS is installed LAST usually overwrites the MBR.
Which is why, as mentioned above, you should install M$ first and Linux last. (save the best for last)
 
Old 02-03-2004, 07:28 AM   #9
JohnHawes
LQ Newbie
 
Registered: Jan 2004
Location: UK
Distribution: RedHat9
Posts: 3

Original Poster
Rep: Reputation: 0
Cheers for the advice, I used my boot disk to start Linux and entered

# grub-install /dev/hda

Now I know, its no trouble if I need to install MS again!
 
Old 02-03-2004, 08:33 AM   #10
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Quote:
# grub-install /dev/hda
Probably ridiculously ignorant, but where does that command install grub - on the mbr or what?
 
Old 02-04-2004, 03:50 AM   #11
phatrabt
LQ Newbie
 
Registered: Feb 2004
Location: Atlanta
Distribution: Fedora Core 1
Posts: 1

Rep: Reputation: 0
I may be wrong (I AM learning) but hda is the first partition on the first drive (aka the bootable partition). I've had to re-install grub as well, so I feel your pain!

phatrabt
 
Old 02-04-2004, 04:49 AM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,429

Rep: Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055
Re: Install Windows Last

Quote:
Originally posted by JohnHawes
...I've realised that installing Windows first saves a lot of hassles, but windows being what it is, fresh installs are a regular task! Is there way to avoid this happening? Is Grub best installed on the MBR or the /boot partition?
*Every* time you re-install Windows, it will overwrite the MBR.
Go with the flow - install GRUB to /boot, and let NTLDR have the MBR. Use the Windows boot loader to fire up GRUB. Means you just have to check the boot.ini after each Windows upgrade.
Much easier.
If you *have* to keep a Windows dual-boot (say for work), this is the least painful solution I have found.
 
Old 02-04-2004, 08:41 PM   #13
abs
Member
 
Registered: Oct 2003
Posts: 203

Rep: Reputation: 30
Re: Re: Install Windows Last

Quote:
Originally posted by syg00
Go with the flow - install GRUB to /boot, and let NTLDR have the MBR. Use the Windows boot loader to fire up GRUB. Means you just have to check the boot.ini after each Windows upgrade.
so what do u check in boot.ini? how do u 'give it the mbr' ? does any other partition need to be marked bootable as well?
 
Old 02-05-2004, 04:57 AM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,429

Rep: Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055
Re: Re: Re: Install Windows Last

Quote:
Originally posted by abs
so what do u check in boot.ini? how do u 'give it the mbr' ? does any other partition need to be marked bootable as well?
First-up you'll need to DD your Grub boot record to the XP C: drive - this has been covered extensively on LQ even in my short time on LQ.
Then you'll need to update your boot.ini to include an entry for that record - something like;
[boot loader]
timeout=10
default=c:\linux.bin
[operating systems]
c:\linux.bin="Linux - Redhat 9"
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional"
/fastdetect

You just need to ensure this is still there after each upgrade of Windows.
As I said, Windows will always over-write the MBR, so you don't have to do anything - Bill has looked after that for you

This is all you need - plus GRUB.CONF of course.
 
Old 02-13-2004, 09:23 PM   #15
abs
Member
 
Registered: Oct 2003
Posts: 203

Rep: Reputation: 30
Re: Re: Re: Re: Install Windows Last

Quote:
Originally posted by syg00
First-up you'll need to DD your Grub boot record to the XP C: drive - this has been covered extensively on LQ even in my short time on LQ.
i didn't manage to find the relevant posts.
1. could u post links to them?

2. also, i'd appreciate it if u could show me where i could find the neccessary steps.

3. i checked out the grub documentation, i found this to be closest to what i need.
Code:
     # For booting Windows NT or Windows95
     title Windows NT / Windows 95 boot menu
     root        (hd0,0)
     makeactive
     chainloader +1
     # For loading DOS if Windows NT is installed
     # chainload /bootsect.dos
this applies to xp too?

4. u mentioned a linux.bin file for boot.ini. could u give some more details pls? how'd u get the file, etc.

5. boot.ini: am i correct in assuming that the second hard disk would be '(1)' and it's fifth partition is 'partition(5)'? since 'multi(0)disk(0)rdisk(0)partition(1)' is the first hdisk's first partition.

ty
abs

Last edited by abs; 02-13-2004 at 09:24 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual boot WinXP/Debian, grub error booting WinXP ChemBot Linux - General 5 02-22-2007 05:13 PM
Accidentally overwrote MBR - Grub rrc124 Linux - Newbie 2 05-20-2005 01:24 AM
winxp overwrote MBR :( rohan208 Red Hat 5 05-17-2004 09:05 AM
OOPS! overwrote MBR, GRUB wont boot :( slacker9876 Linux - Newbie 4 04-16-2004 06:04 PM
i got RH8 & WinXP installed and properly working by GRUB. how can i reinstall WINXP? kublador Linux - Newbie 4 06-23-2003 01:00 PM


All times are GMT -5. The time now is 05:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration