Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
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.
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.
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.
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!
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
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.