LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-14-2008, 07:56 AM   #1
rapattack
Member
 
Registered: Jan 2008
Posts: 109

Rep: Reputation: 15
Dual boot and hard drive issue


OK so I have a dual boot situation in one of my pc's. Windoze on the primary and Ubuntu on the secondary. I think grub is on the 2nd hd because when the choice comes up on the screen Ubuntu is listed first. Am I right? Anyway the windoze drive has bad sectors and may need to be replaced at some point. I don't know how I should go about retaining the dual boot as I have never delt with this before. I am probably going to have to put windoze on the new primary drive so should I just detach the secondary while I do that and then afterwards reattach the secondary drive? Will grub be fine with that?
 
Old 05-14-2008, 08:14 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
You'll probably have to have grub write a new boot record to the first drive after windows installs. there are plenty of threads on this site about restoring grub after a windows install/reinstall.
 
Old 05-14-2008, 09:39 AM   #3
rapattack
Member
 
Registered: Jan 2008
Posts: 109

Original Poster
Rep: Reputation: 15
So are you saying I am mistaken about the boot record....that it will be on the primary drive?
 
Old 05-14-2008, 09:52 AM   #4
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
The mbr that bios looks at is the first hd in the boot order. The easiest way is to install windows on the hd first in the boot order. If you only have two hds and the operating systems are on the first partition of each one use your ubuntu cd and boot and at command prompt as root (sudo)

grub

root (hd1,0)

setup (hd0)

This will restore your mbr. To answer another part of your question, part of grub resides in the mbr, except when you install windows it does not want to share and takes over the mbr and will only point to windows.

You are partially right, the first part of every hd has an area set aside for a mbr but the mbr will only be stored in the first hd in the boot order.

Last edited by Larry Webb; 05-14-2008 at 09:59 AM.
 
Old 05-14-2008, 10:11 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,534

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
The OS listed first in the Grub menu.lst has nothing to do with the drive it is on. In your menu.lst file there is usually a default entry: default 0, for example. That will boot the first listing of an OS in the menu.lst file and that can be changed as root. Unless you have changed your BIOS settings to boot from the 2nd drive, I expect that Grub is on the first hardrive MBR. Unplug your windows hardrive and try to boot, if it doesn't you'll know. Your intended method will only work if grub is on the mbr of the second drive.

Detaching your drive w/Ubuntu while installing windows would probably be a good idea, less room for error. If grub is on the first drive mbr, you will need to change the boot order in BIOS (if you can), or change the cables or the jumpers. They can all be changed back later if you want. It would be a good idea to copy your windows entry from the menu.lst file so you have it later.

So, you either need to set your 2nd drive as primary or after re-installing xp, use your ubuntu cd to re-install Grub to the drive you currently have windows on.
 
Old 05-14-2008, 10:04 PM   #6
rapattack
Member
 
Registered: Jan 2008
Posts: 109

Original Poster
Rep: Reputation: 15
Thanks for all that info...things are on hold right now as I can't boot into Linux. I thought that someone was trying to help me in another forum but they haven't responded for a couple of days so I may leave that machine for a bit until I can afford another hd. Then I can do a fresh install of both os's. I will visit back and ask more if I need some more help!
 
Old 07-10-2008, 12:14 PM   #7
rapattack
Member
 
Registered: Jan 2008
Posts: 109

Original Poster
Rep: Reputation: 15
All is good now. I ended up downloading Seatools(the primary drive with windoze on it is a seagate drive) and performing a scan on the drive and it detected one bad sector which it repaired. Then I just reinstalled Ubuntu on the secondary drive and things are great. I Have now learnt to do this on other machines and it feels good to be able to do this without any help. Gee a bit of persistance and I got there. Thanks
 
Old 07-10-2008, 01:01 PM   #8
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
As far as I understood it all, the reinstall of Ubuntu was not necessary.
It was on the second HD - and there it still was after you did whatever you dit to the first HD.
All that was necessary would have been booting the computer using your Ubuntu CD and reinstall grub to the mbr of the first HD.
Why? Because windows overwrites it with its own when you install it. No way around that (well - not easy for a novice anyway). You always have to reinstall grub after a windows install.
Just so you know ... you learned how to install the OS again - but reinstalling grub would have been the only thing you needed to learn.
Of course: learning eighter one is useful - you just took the long way.
 
Old 07-10-2008, 11:25 PM   #9
rapattack
Member
 
Registered: Jan 2008
Posts: 109

Original Poster
Rep: Reputation: 15
Yeah i didn't have to reinstall windoze. I was only going to do that if in fact I had to replace the drive if it was really beyond help. As Seatools fixed the one bad sector and the drive is working well I might not have to do anything to that drive for quite a while....you know if it does indeed die then I will have to do what i originally set out to do.
And the other thing people were saying to redo or whatever about the mbr but i got no straight answers on how to do that . It was no big deal reinstalling the os on the secondary drive. Very easy and pretty quick. It is good to practice these things anyway. I remember when I first had to install windoze for the first time it was far worse and harder than these newer Linux Distro's. Very happy!
What is eighter one?
 
Old 07-11-2008, 02:16 AM   #10
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
Quote:
learning eighter one is useful
eighter: reinstalling the bootloader (after windows replaces it and linux does not boot)
or: reinstall linux completely - along with the bootloader (when the only thing which needed to be done was just the bootloader)
That is what I meant - maybe I got you wrong.
 
Old 07-11-2008, 08:05 AM   #11
rapattack
Member
 
Registered: Jan 2008
Posts: 109

Original Poster
Rep: Reputation: 15
Ah

Thanks that term is new to me and I am always glad to learn something as I am very much a newbie.
 
  


Reply



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
Best method for dual boot with dual hard drive? aidano Linux - Software 2 11-16-2006 12:04 PM
Dual boot on second hard drive alukardian Linux - Newbie 3 11-16-2005 08:14 PM
Dual Boot on one hard drive scripttron75 Linux - Newbie 4 09-21-2005 06:39 AM
XP Pro will not boot dual boot Redhat 9 one hard drive mamoose Linux - Newbie 10 03-29-2004 08:28 PM
Dual boot issue with external hard drive asmichael Linux - Laptop and Netbook 2 02-02-2004 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration