LinuxQuestions.org
Register a domain and help support LQ
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 03-11-2008, 12:05 PM   #1
scocha
LQ Newbie
 
Registered: Sep 2000
Location: hemet, ca
Distribution: Slackware
Posts: 26

Rep: Reputation: 15
Booting from second HD.


I've been intrigued with Linux for a long time and now I'm taking the plunge. I'm totally new to Linux (other than reading about it) and I'm no computer expert either, and while I'm waiting for my new HD to show up I was hoping to get a leg up on what to expect. My PC is set up with XP, and at this point I don't want to screw anything up so I bought a second 200GB sata HD that will be dedicated to Linux, and I'd like to boot that drive and dual boot either OS from there. What would be the best way to set up the second drive for this? (bios will support this), can I (or should I)put LILO on the MBR of sdb? I'm sure that with experience I won't be so paranoid but for now I'd really like to leave that first drive alone, including its MBR. thanks.
 
Old 03-11-2008, 12:27 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
For your purposes it would probably be best to install the Linux bootloader (either LILO or Grub) to the MBR of the second disk, then setup your XP ntldr to give you the choice of either XP or Linux to boot.

Unplug the windows disk (as insurance that you don't inadvertantly install something it), put the Linux install cd in the drive, and run the installation to the second drive. Install the bootloader in the MBR of the second disk. Reboot if it is required at any time. It would be a good idea to make a boot floppy or cd during installation.

Once you are satisfied it works, re-attach the first hard drive. At this point, you probably can't boot Linux without the boot disk. But, you can edit your XP ntldr to allow you to boot Linux.

Instructions here: http://www.linux.com/feature/113945

Others may have better instructions, but this has worked for me when installing Linux on my wifes computer.

Last edited by bigrigdriver; 03-11-2008 at 12:29 PM.
 
Old 03-11-2008, 12:47 PM   #3
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
booting from second hard drive

A other option is I have on one hdd drive windows X and suse 10.3 in a dual boot
On a other hdd drive I have at this moment just Fedora 8

When I like to change from windows Xp / suse 10.3 to fedora 8
I enter the BIOS set up to change the boot able drive of course you,re BiOS
must allow you to chance the boot devices between the two hard drives
In my case first boot device DVD player second one of the two Hard drives

So in you,re case on each drive one operating system and change between the
the hard drives

best of luck
 
Old 03-11-2008, 01:05 PM   #4
scocha
LQ Newbie
 
Registered: Sep 2000
Location: hemet, ca
Distribution: Slackware
Posts: 26

Original Poster
Rep: Reputation: 15
Yes, my bios will support booting from either of the hard drives. When I read about the LILO install, it says the choices are to write LILO to MBR of sda, or to a HD partition, or a floppy (which I don't have) but It's not clear to me if it will just write to the MBR of the second HD, or if that's even what I need to do.
Thanks
 
Old 03-11-2008, 01:18 PM   #5
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,589

Rep: Reputation: 187Reputation: 187
Quote:
Originally Posted by scocha View Post
Yes, my bios will support booting from either of the hard drives. When I read about the LILO install, it says the choices are to write LILO to MBR of sda, or to a HD partition, or a floppy (which I don't have) but It's not clear to me if it will just write to the MBR of the second HD, or if that's even what I need to do.
Thanks

You can set the BIOS to boot from the MBR of the first hard drive or to boot from a floppy. You can put your LILO or Grub boot record someplace other than the first hard drive or the floppy. In that case you have to set up the boot loader that the BIOS boots to chainload to the bootloader you have placed elsewhere.

----------------
Steve Stites
 
Old 03-11-2008, 01:26 PM   #6
sandgroper
Member
 
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Rep: Reputation: 15
Quote:
Originally Posted by scocha View Post
I've been intrigued with Linux for a long time and now I'm taking the plunge. I'm totally new to Linux (other than reading about it) and I'm no computer expert either, and while I'm waiting for my new HD to show up I was hoping to get a leg up on what to expect. My PC is set up with XP, and at this point I don't want to screw anything up so I bought a second 200GB sata HD that will be dedicated to Linux, and I'd like to boot that drive and dual boot either OS from there. What would be the best way to set up the second drive for this? (bios will support this), can I (or should I)put LILO on the MBR of sdb? I'm sure that with experience I won't be so paranoid but for now I'd really like to leave that first drive alone, including its MBR. thanks.
There are 2 ways of creating a dual boot system with Windows and Linux

1) install the second HDD and when you go to install linux , you will be prompted to install Grub as a bootloader and you will be given the choice of where to install it.
In this set up , you should install Grub on the first bootable HDD , in this case this is your Windows drive , which will be sda.
What will happen is Grub will be installed on the first 512 bytes of the MBR on sda and will not interfere with your Windows set-up.
On boot up , you will be presented with the Grub Menu in which you will be able to select either Windows or linux.

2) If you are too paranoid to install Grub on your Windows HDD , then this is an easier option.
Get a removable caddy for your new HDD and install the caddy case in your 5.25 bay and connect the caddy case up so that it is sdb.
Once you do that , go into the BIOS to detect the sdb HDD and then change the boot sequence to boot to the CD/DVD drive first , sdb second and then sda third.
( Once you have installed linux , change the boot sequence to sdb , sda and then the CD/DVD drive )

Reboot the system and install linux and when prompted , install the Grub bootloader on sdb .

So when you want to boot to Windows , you remove the removable caddy with linux on it and it will boot to Windows.
When you want to boot into linux , insert the removable caddy with linux and you will boot into linux.

.
 
Old 03-11-2008, 01:31 PM   #7
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,139

Rep: Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127
I don't know LILO. I think Grub is better and more flexible.

You have several reasonable choices:
1) Leave the Windows mbr on drive 0 and leave the BIOS set to boot drive 0. Install stage 0 of grub elsewhere (such as either the mbr of drive 1 or the partition boot sector of your root or boot partition on drive 1). Then add the info to Windows boot.ini file to make booting Grub a choice from within ntldr.

2) Leave the Windows mbr on drive 0 and change the BIOS to boot drive 1. Install stage 0 of grub in the mbr of drive 1. Then add the info to Linux menu.lst file to make booting ntldr a choice from within Grub.

3) Leave the BIOS set to boot drive 0 and install stage 0 of grub in the mbr of drive 0. Then add the info to Linux menu.lst file to make booting ntldr a choice from within Grub.

Quote:
Originally Posted by bigrigdriver View Post
Unplug the windows disk (as insurance that you don't inadvertantly install something it), put the Linux install cd in the drive, and run the installation to the second drive.
It would be nice to have that safety. But it would cause extra problems. When you put the Windows drive back as drive 0 the new drive would change from drive 0 to drive 1 and from sda to sdb. That then requires editing menu.lst and fstab and maybe other things.

Hopefully you can pay enough attention to what you are doing during the Linux install to not overwrite anything on drive 0. It does take a little care, especially with beginner friendly GRUB installers that default to putting stage 0 in the mbr of drive 0 regardless of where everything else goes.

When I installed Mepis Linux on drive 1 with Windows already on drive 0, it defaulted to my choice 3 above. There was a fairly clear choice available to override that and not put stage 0 in the mbr of drive 0, but that was accompanied by an excessive (in my opinion) warning that only an expert should try installing Grub with stage 0 not in the mbr of drive 0. Also in that Mepis install, when I did accept the defaults, it put the required info into menu.lst for ntldr, so when I went to edit that in, it was already there.

Last edited by johnsfine; 03-11-2008 at 01:36 PM.
 
Old 03-11-2008, 01:56 PM   #8
rg.viza
Member
 
Registered: Aug 2006
Posts: 73

Rep: Reputation: 15
The easy (and safe) way

Since you are new to this, and would like to keep your windows partition, read on. The concerns mentioned by other posters about changing the number on the windows drive from 0 to 1 are handled with my solution.

First, disconnect the data cable from your windows drive after turning the machine off. If it's not connected to the motherboard, you can't accidentally clobber it. I have 18 years of professional IT experience, 10 with linux; I still do this. An accidental keystroke during partitioning can easily destroy your data. We want your first experience with installing a linux/windows dual boot system to be a happy one 8)

Hook up the new drive. Install a linux distro. Which one you use is up to you, but for ease of use, use the more modern grub bootloader if given the choice.

Hook up the windows drive once linux is installed. Adjust the hard disk boot order in your BIOS to boot the drive with linux first. You will be chainloading windows from grub. This will enable you to boot windows, and do it without needing to modify your windows drive.

Now you should be booting to linux, and have your windows drive in second place in your BIOS boot priority. Simply by flipping the order of the sections in menu.lst you can change which OS boots by default.

If you decide that linux is not for you, you can simply change the boot order in BIOS, repartition the linux drive and use the drive for storage or something, you won't have any cleaning up to do on your windows partition.

Boot to linux and mount your /boot partition (Some distros unmount this after booting for better boot partition "protection") if you need to.

In /boot there is a subdirectory called grub
Within /boot/grub, there is a file called menu.lst. It's either a link or not but opening this file will open your grub configuration. Grub doesn't care, it looks for menu.lst.

You will see something like:
Code:
title  Gentoo Linux 2007.0 
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda1 ro 
initrd /kernel26.img
leave this section alone. Yours may look a lot different than this, but whatever. It doesn't matter. Anything above the part "title" is configuration for grub and has nothing to do with the items in your boot menu, so don't worry about this stuff for now.

add a new section for your windows partition:
Code:
title Windows XP(or whatever) #put what you like for title
map (hd0)(hd1) #perform a switch so WinXP thinks it's on drive 0
map (hd1)(hd0) #make sure you remap both drives
rootnoverify (hd1,0) #hd1 is drive 2 to us humans, hd0 is drive 1.
             #even though we've mapped the drives, this doesn't
             #take effect until grub does it's thing
             #for now, we need to tell grub where windows *really* is
             #not where it will be after grub does the mapping.
makeactive
chainloader +1
Strip out these comments so things look nice.

Windows should now happily boot as selection 2 on the boot menu. If you have trouble, try this alternate menu section config which does the same thing, sort of:
Code:
title Windows XP
map (hd0)(hd1)
map (hd1)(hd0) 
root (hd1,0) 
chainloader +1
Have fun not destroying your windows setup!

-Viz
 
Old 03-11-2008, 02:00 PM   #9
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
What I meant one grub is written on one hdd to boot windows xp/suse this hdd is called sda
Fedora is booting from sdb and grub is installed on sdb
Because I have 3 hdd in sata called sda ,sdb ,sdc all the 3 drives are in the box
That means that I can choose between the sata hd drive to boot




all the best
 
Old 03-11-2008, 02:49 PM   #10
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,139

Rep: Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127
Quote:
Originally Posted by rg.viza View Post
Hook up the windows drive once linux is installed. Adjust the hard disk boot order in your BIOS to boot the drive with linux first.
Just to be sure I and the OP are understanding you:

You mean (after installing Linux) leave the new drive connected to SATA connector 0 and hook up the old drive to SATA connector 1.

So the BIOS isn't just booting the new drive first. It is numbering the new drive first. The new drive is drive 0 (however it is connected) when it is the only drive connected. You're making the new drive be drive 0 even with both connected, which requires it be on connector 0.

Then you make Grub cause ntldr to believe that the BIOS numbered the drives backwards, so ntldr installed on the true drive 0 (when the old drive was the only drive) will be willing to boot from the old drive connected as drive 1.

Then Windows will find its C partition on drive 1 and since almost everything in Windows is tied to that partition letter rather than the drive number, nothing should need to be reconfigured. Windows quietly transitions from using the old drive as the fake drive 0 through the BIOS to using the old drive as the real drive 1 through its internal disk driver.

Earlier, I assumed the suggestion to disconnect the old drive while installing Linux meant to later reconnect the old drive to connector 0 and fix Linux installed on drive 0 to work on drive 1.

Each of those methods can work. I'm not thrilled with either of them. But you do have a point about safety.
 
Old 03-11-2008, 06:31 PM   #11
scocha
LQ Newbie
 
Registered: Sep 2000
Location: hemet, ca
Distribution: Slackware
Posts: 26

Original Poster
Rep: Reputation: 15
I was hoping to just go through the installation and put Slackware on sdb including LILO, set bios to boot sdb, where LILO will give me the choice to boot Linux (sdb) or XP (sda). Not that simple? What got me thinking about all this is while reading through how to do this, the example screenshot showed the options for where to write LILO. Root partition superblock, MBR, or floppy. The description given for MBR said "master boot record of your first hard drive". This makes me wonder if you just don't put anything on the mbr of a second hard drive, otherwise why wouldn't that be an option. What does it mean to write it to the root partition superblock? I just don't understand this stuff yet. Thanks for all your responses.
 
Old 03-11-2008, 06:50 PM   #12
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,139

Rep: Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127
Quote:
Originally Posted by scocha View Post
I was hoping to just go through the installation and put Slackware on sdb including LILO, set bios to boot sdb, where LILO will give me the choice to boot Linux (sdb) or XP (sda). Not that simple?
Of course it can be that simple.

The discussion was about the safety aspect. If you make some mistake while installing Linux on sdb, you might mess up XP on drive 0. If you pull XP's drive while installing Linux, you can't make that mistake.

But if you pull out XP's drive then however you connect Linux's drive, it will be sda while you are installing it.

Then when you put back XP's drive, one or the other (either can be made to work) must be redirected to work from physical drive 1.

Quote:
the example screenshot showed the options for where to write LILO. Root partition superblock, MBR, or floppy. The description given for MBR said "master boot record of your first hard drive". This makes me wonder if you just don't put anything on the mbr of a second hard drive, otherwise why wouldn't that be an option.
That GUI just doesn't give you that option. The second drive certainly has an MBR position and the BIOS can boot from it (long ago BIOS's couldn't).

Using the grub installer in command line mode (and from some of its GUI front ends) does give the option to put stage 1 in the mbr of dev/sdb.

I don't know what choices normally exist for LILO.

Quote:
What does it mean to write it to the root partition superblock?
Every partition has its own boot block. Those are often unused. I don't know where GRUB normally puts stage 1.5 (when it puts stage 1 in the MBR). Maybe that uses the partition boot block.

In the early days of partitioned hard drives, the first stage boot of the OS went in the partition boot block (so the partition boot block, not the MBR, was the functional equivalent of a floppy boot sector). Fdisk put a simple routine in the MBR that just loaded and ran the boot block of the selected (within Fdisk) only bootable partition. Many programmers (including me) wrote their own replacements that put a simple menu into the MBR to dispatch to the partition chosen at boot time.

LILO and GRUB and ntldr are all more complex than that early design. But the boot block of each partition still exists to be used as part of the boot process.

BTW, why Slackware?
Wouldn't you be better off with an easier distribution?

Last edited by johnsfine; 03-11-2008 at 06:58 PM.
 
Old 03-11-2008, 08:48 PM   #13
scocha
LQ Newbie
 
Registered: Sep 2000
Location: hemet, ca
Distribution: Slackware
Posts: 26

Original Poster
Rep: Reputation: 15
Like I said, I've been just reading about Linux all this time and Slackware had a lot of stuff for me to read (Slackware essentials, Slackware basics) that describe the installation and other stuff in detail (other than the details I'm asking about in this post). I'm hoping that by the time I get this going that I'll have learned alot, not only about Linux but about the computer in general, and I don't mind that learning curve.
 
Old 03-11-2008, 09:03 PM   #14
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,589

Rep: Reputation: 187Reputation: 187
Quote:
Originally Posted by johnsfine View Post


Every partition has its own boot block. Those are often unused. I don't know where GRUB normally puts stage 1.5 (when it puts stage 1 in the MBR). Maybe that uses the partition boot block.
I think that stage 1.5 is in /boot/grub under these file names:

/boot/grub/e2fs_stage1_5
/boot/grub/fat_stage1_5
/boot/grub/jfs_stage1_5

When I look at these files using ghex they contain the message:
"Loading stage 1.5"

There is a copy of the grub MBR in /boot/grub/stage1 and grub stage 2 is in /boot/grub/stage2.

-------------------
Steve Stites
 
Old 03-12-2008, 08:52 AM   #15
scocha
LQ Newbie
 
Registered: Sep 2000
Location: hemet, ca
Distribution: Slackware
Posts: 26

Original Poster
Rep: Reputation: 15
Well, if I choose the menu option to just write LILO to the superblock of the first (/root)partition of sdb, then does that make sdb bootable?
 
  


Reply

Tags
drives


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
Booting error in puppy linux while booting it from fedora why ? senthilarumugam LinuxQuestions.org Member Intro 1 02-22-2007 03:43 PM
Dual-booting and Multi-Booting trainee Slackware - Installation 6 06-18-2006 08:50 PM
booting Linux from an image that lost booting capabilities tgr Linux - Software 1 03-05-2006 12:28 PM
Booting into Single User on MDK 9 asks for root password instead of booting into root acadcworks Linux - General 6 01-10-2006 07:51 AM
Are you dual booting and Windows stopped working (booting) then here's the answer: rberry88 Linux - General 1 02-12-2004 10:05 AM


All times are GMT -5. The time now is 10:45 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration