LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 09-03-2005, 04:02 PM   #1
MRDucks
Member
 
Registered: Aug 2005
Location: Tennessee
Distribution: Mandriva 2006,Gentoo,Linspire
Posts: 86

Rep: Reputation: 15
2 hd,2 os startup question


I have 2 hds in my box.I bought the newest one just for my linux os.The other has winxp home on it.Both are seagate 80gb.I was manually switching the ide cable from hd to hd as I was learning to install various linux distros.If i designate the win hd as slave and plug both in will the default bootloader for mand10.1(grub i think) see this as another os and ask which one to start?I remember putting the boot loader in the mbr during install.
What I'm after is when I turn on my box to have a choice of which os/hd to boot.
Thanks
 
Old 09-03-2005, 05:58 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,795

Rep: Reputation: 292Reputation: 292Reputation: 292
"If i designate the win hd as slave and plug both in will the default bootloader for mand10.1(grub i think) see this as another os and ask which one to start?"

No. grub does not automatically detect operating systems. You have to tell grub what operating systems you have and where they are located. If you are going to rearrange your hard drives then you must reconfigure grub (/boot/grub/grub.conf) and fstab (/etc/fstab) before you make the hard drive rearrangement.

As an alternative you can make the hard drive rearrangement and then use a rescue CD to boot into your Linux OS to do the repair work on grub and fstab.

--------------------------
Steve Stites
 
Old 09-03-2005, 06:10 PM   #3
Steve50
Member
 
Registered: Nov 2004
Location: Coventry, UK
Distribution: Debian Lenny, Ubuntu Feisty
Posts: 121

Rep: Reputation: 15
Unfortunately, because you've been using the two hard drives seperately, they each have their own master boot record and Grub won't automatically recognise windows when you hook up a second disk. You'll need to edit the /boot/grub/menu.lst file on your linux disc and add something like the following:

# For booting windows
title windows
# Specify /dev/hda1 as the root partition
root (hd0,0)
#Set the active flag in the partition
makeactive
# Then boot the windows boot loader
chainloader +1

The problem, I believe, is that windows expects to be the master hard drive, so you should set your windows drive as master and your linux drive as slave. The problem then, of course, is that windows will boot when you switch on, and you won't get the option of booting linux.

The easiest way round this that I can think of is to set up everything as above, and then boot the system with a live linux cd such as knoppix. You can then mount your linux root directory; if it's installed on disc hdb the command in knoppix is sudo mount -o dev /dev/hdb1 /mnt/hdb1. You can then install grub to the mbr of the windows hard disc by typing sudo chroot /mnt/hda1 grub-install /dev/hda.

This will work as long as the partition tables on your discs recognise the windows disc as hda (master) and the linux disc as hdb (slave). If you've been using the discs seperately your linux file system will probably name all its partitions as hda as well. I don't know if there's a way round this other than setting up the discs and reinstalling linux from scratch so that it automatically sets itself up as hdb. In fact, the more I think about this, I'm almost certain that you'll have this problem and have to start again, or keep swapping disks.

Does anyone else know a workround for this problem? I've just seen the above post since I've been writing this. Will editing fstab sort everything out? If not the rescue option could work.

Last edited by Steve50; 09-03-2005 at 06:14 PM.
 
Old 09-03-2005, 07:21 PM   #4
Steve50
Member
 
Registered: Nov 2004
Location: Coventry, UK
Distribution: Debian Lenny, Ubuntu Feisty
Posts: 121

Rep: Reputation: 15
OK an update. I've been reading up on this problem and I found a solution in good old Linux in a nutshell. To avoid messing about with the partition names on your linux drive you can install it as the master drive (hda) and windows as the slave drive (hdb). When you first boot you won't be able to access the windows drive but once you're in linux you can modify your grub configuration as described above. However, you need to insert an extra mapping entry:

title windows
map (hd0) (hd1)
map (hd1) (hdo)
root (hd1,0)
makeactive
chainloader +1

This tricks windows into thinking its the first hard drive so it will boot. As linux is now your first hard drive you don't need to install grub on the mbr of the windows disk. Let me know if this works.

Last edited by Steve50; 09-03-2005 at 07:24 PM.
 
Old 09-03-2005, 07:37 PM   #5
terrus
LQ Newbie
 
Registered: Sep 2005
Location: caltech
Posts: 9

Rep: Reputation: 0
i am having a similar problem. I installed linux as a second os on my laptop(which had windows xp). Now I cant get my laptop to boot in windows and its pretty frustrating. I am also a newbie and dont know the first thing to do to fix this problem. Please help!
 
Old 09-03-2005, 08:50 PM   #6
MRDucks
Member
 
Registered: Aug 2005
Location: Tennessee
Distribution: Mandriva 2006,Gentoo,Linspire
Posts: 86

Original Poster
Rep: Reputation: 15
Well you wont believe this.I switched cables to get win running and guess what?......blue screen calling for the rescue disk so I can copy some files from a previous restore point.I think I'll keep it this way for awhile so when I get frustrated with linux I can plug in hd2 and remind myself why I'm using linux and loving it.

Really,when i feel like reloading winblows I'll try the above and post back with the results.Thanks a bunch.

The only thing I'm really after win for is my website builder progy.Its homesteads quicksite builder.(and my lexmark printer ) I contacted homestead and they said they I was sol.I cant even log in to check my site stats via linux.

I can however upload pages via homesteads ftp made with another program.Problem is I know nothing about html.Quicksite was a simple drag and drop program for dummies like me.

Anybody know of a linux app similar to quicksite that I can save/export xml files with?I also miss swishmax.Thanks
Jeff
 
Old 09-03-2005, 10:19 PM   #7
boxerboy
Member
 
Registered: Jul 2005
Distribution: ubuntu5.04, ubuntu5.10, suse9.3, mandrake10.1, mandriva2006(beta), FC1-4, redhat9.0, debian sarge
Posts: 519

Rep: Reputation: 32
i have 2 hds in other pc running xp and ubuntu the mbr should be on primary drive for me thats xp drive and grub gives me a choice everytime now about the mand10.1 it usews lilo i had that on it at one point too. anyway i set hd2 as slave (ubuntu) and hd1 as master (xp)
 
Old 09-04-2005, 01:50 AM   #8
terrus
LQ Newbie
 
Registered: Sep 2005
Location: caltech
Posts: 9

Rep: Reputation: 0
well, i didnt touch anything except the power button and now i get an option when i boot up. So I can do either linux or XP. It think linux is the main os but thats ok with me.
 
Old 09-04-2005, 08:27 AM   #9
Steve50
Member
 
Registered: Nov 2004
Location: Coventry, UK
Distribution: Debian Lenny, Ubuntu Feisty
Posts: 121

Rep: Reputation: 15
OK, just to provide some clarification. For those who initially had windows installed and then installed linux - which tends to be the usual way it's done - linux simply installs itself in the mbr and should give you the option of booting to windows when you switch on. In this configuration there's not usually a problem because windows is still on the first primary disc partition.

The problems occur when you try to boot windows from a slave drive - it will refuse to do this unless you trick the windows bootloader into thinking that it is the first primary partition. Linux, on the other hand, doesn't mind where it's installed. However, if you've been using linux on the master drive and then decide to install windows you start to get problems. Windows will overwrite the mbr and you need to reconfigure grub to get it to work. If you change the linux drive to slave and install windows on a new master drive you also have to reconfigure the system.

Terrus, I need more information before I can offer any advice. Did you repartition your drive before installing linux or did you let your linux installer shrink the windows partition? You needed to opt for one of these options otherwise linux would simply take over the hard disc.

I'll assume that you did make room for linux by shrinking windows by some method - your installer might even have done it automatically. You don't say if you can boot into linux. If you can, do so and then open a terminal, log on as root (type su followed by your password) and type fdisk -l. This will bring up the partition table and if windows XP is still there it should be listed as an NTFS partition on /dev/hda1. If you see this everything's still there. You just need to add the following to the bottom of /boot/grub/menu.lst file.

title windows XP
root (hd0,0)
makeactive
chainloader +1

You don't say what distro you're using but if you're using gnome just make sure you're still logged in as root and type gedit /boot/grub/menu.lst to open the file and edit it. If you use kde replace the word gedit with kate.

If you can't see a windows partition you may have overwritten it and have to reinstall windows from scratch and then reconfigure grub.

If you can't even boot into linux what happens when you switch on? Post the details here if you need more help.

Sorry Terrus, I've only just spotted your last post and you seem to have got everything working OK. However, the above might help someone else with the same problem. I've only been dual booting ubuntu linux and xp for the last two months and it's been a steep learning curve, but well worth it. If anyone's just starting out, stick with it. Once you've learned how to configure your system you soon start to wonder why you windows at all, especially if you don't need it for specialised software use.

Last edited by Steve50; 09-04-2005 at 08:35 AM.
 
Old 09-04-2005, 11:19 AM   #10
boxerboy
Member
 
Registered: Jul 2005
Distribution: ubuntu5.04, ubuntu5.10, suse9.3, mandrake10.1, mandriva2006(beta), FC1-4, redhat9.0, debian sarge
Posts: 519

Rep: Reputation: 32
he didnt have to resize windows he put linux on seprate drive.

if u see linux as number one choice in grub it is ur default os if u dont select a os to boot it will boot to linux.have fun hope u enjoy it
 
  


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
program startup question BajaNick Linux - General 2 01-11-2004 01:34 PM
X Startup Question gsibble Linux - General 5 11-27-2003 05:25 AM
Startup Question Mojojo Linux - General 1 06-07-2003 03:27 PM
startup question Ryan_Sutton Linux - Newbie 4 06-04-2002 08:55 PM
Apache startup Question jester_69 Linux - General 7 05-21-2002 09:45 AM


All times are GMT -5. The time now is 04:12 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration