LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   2 hd,2 os startup question (https://www.linuxquestions.org/questions/linux-newbie-8/2-hd-2-os-startup-question-359904/)

MRDucks 09-03-2005 03:02 PM

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

jailbait 09-03-2005 04:58 PM

"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

Steve50 09-03-2005 05:10 PM

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.

Steve50 09-03-2005 06:21 PM

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.

terrus 09-03-2005 06:37 PM

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!

MRDucks 09-03-2005 07:50 PM

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. :p :p

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 :mad: ) 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

boxerboy 09-03-2005 09:19 PM

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)

terrus 09-04-2005 12:50 AM

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.

Steve50 09-04-2005 07:27 AM

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.

boxerboy 09-04-2005 10:19 AM

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


All times are GMT -5. The time now is 04:25 PM.