Two SATA Drives: Which One Is Master?

T

tb

I have a PC with two SATA hard drives installed. One has the OS and
various software programs installed and the other one is my data storage
drive. It is my understanding (I did not build the PC!) that SATA hard
drives do not have jumpers like IDE hard drives do that would allow the
master/slave setting.

So... just out of curiosity: How does the system know which one of the
two SATA drives is to be used for booting up? Is it perhaps that the
boot up drive is always the one plugged into the SATA 0 port of the
motherboard?
 
D

David W. Hodgins

So... just out of curiosity: How does the system know which one of the
two SATA drives is to be used for booting up? Is it perhaps that the
boot up drive is always the one plugged into the SATA 0 port of the
motherboard?

See http://support.microsoft.com/kb/937251

With sata, there is no way to guarantee the order of the drives,
when the bios detects them. Without hardware changes, the order
will almost always be consistent, but that is not guaranteed.

That's why the bios has options to specify which order the drives
should be used in, for booting from.

That's also partly why most linux distributions now use uuid or
filesystem labels, to figure out where the filesystem is located,
rather then using drive identifiers.

Regards, Dave Hodgins
 
P

Paul

tb said:
I have a PC with two SATA hard drives installed. One has the OS and
various software programs installed and the other one is my data storage
drive. It is my understanding (I did not build the PC!) that SATA hard
drives do not have jumpers like IDE hard drives do that would allow the
master/slave setting.

So... just out of curiosity: How does the system know which one of the
two SATA drives is to be used for booting up? Is it perhaps that the
boot up drive is always the one plugged into the SATA 0 port of the
motherboard?

No, your BIOS allows you to select a boot drive, from all of
the drives on the computer. The BIOS is capable of doing the boot
selection, and was set up by your system builder.

For any hard drive, there is a partition table, with room for
up to four primary partitions (and lots of logical partitions
if you want them, but they have nothing to do with this discussion
about booting). Only primary partitions are bootable.

Now, I'll draw two hard drives. The MBR, stored in the very
first sector of each disk, has partition information. Notice that
one of the disks has a partition marked "active", which implies
somebody installed an OS on that partition (#2).

<---- Disk #1 -----> <---- Disk #2 ----->

Active Partition Active Partition
------ --------- ------ ---------

Partition #1 Partition #1
0x80 Partition #2 Partition #2
Partition #3 Partition #3
Partition #4 Partition #4

You can use this tool in Windows, if you want to see much the same
info I just drew in my picture. This is a free download. You can check
each disk, to see how your table is set up. Don't change anything in
here, until you understand the consequences a bit better. I've only
used this once, to make actual changes to the MBR table. Most of the
time, I use this for a "quick peek" at how the thing is set up. This
tool was actually part of Partition Magic at one time.

ftp://ftp.symantec.com/public/english_us_canada/tools/pq/utilities/PTEDIT32.zip

Now, if you go into the BIOS, there is a menu where you can put
hard drives into an order. The first drive in the list, is the
first one to be searched.

A disk can only have one active partition, but can have more
than one OS present on the disk. If you want an OS to be bootable,
which is not the active partition, a "Boot Manager" must be present
on the active partition, to handle both OSes. From the Boot
Manager menu, you make your OS choice, and the Boot Manager vectors
off to an OS partition that you've set up. (And I don't understand
the mechanics of that vectoring yet.)

So, say we enter the BIOS setup screen. The BIOS is the thing that
you see on the screen of the computer, just after the power comes on.
There is a series of setup screens in there, which you can reach by
pressing a particular key. On my Asus motherboard, the <Delete> key
gets me into these setup screens. (Your user manual may mention the
key to use.) In the BIOS, I might make my "drive type" list look like this:

Floppy
CDROM
Hard Drive

and using the two sample disks I drew above, I might make my Hard Drive
sub-list look like this:

Disk #2
Disk #1

The BIOS would check the floppy drive, check the CDROM drive, and
perhaps find both of them empty. Then, it moves on to the Hard Drive
list.

Well, the BIOS can check Disk #2 if it wants, but no partition is
marked active. The BIOS treats Disk #2 like it is a "data" disk, because
there is no evidence of a bootable OS present.

Next, the BIOS checks Disk #1, and finds an active partition. Let's say
the partition contents are as follows on my Disk #1.

<---- Disk #1 ----->

Active Partition
------ ---------

Partition #1
0x80 Partition #2 WinXP
Partition #3 Win2K
Partition #4

In this case, WinXP provides the boot manager. When WinXP boots, you'd
see a black screen, with two OS choices listed in it. The menu is
based on the contents of the boot.ini file. Say, for example, there were
lines like this in the boot.ini, on the WinXP partition.

multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Professional" /fastdetect
multi(0)disk(0)rdisk(0)partition(3)\WINNT="Windows 2000 Professional" /fastdetect

The Boot Menu in the black window, would show

Windows XP Professional
Windows 2000 Professional

and you'd select which one you wanted to boot from.

That means, the BIOS is responsible for the "first level" of selection.
The active partition can control a "second level" of OS choosing.

I assume, by looking at the boot.ini, that if I wanted, I could actually
boot an OS stored on Disk #2, even though there is no active partition
marked on Disk #2. But the "active" or "boot flag" is needed, to get the
BIOS to consider some hard drive as a boot choice. If no hard drive
has a primary partition marked active, I presume the BIOS would attempt
to network boot via PXE or the like. Or put up a dumb prompt to "try again".

The BIOS actually has two methods to do that choosing. The "Floppy,CDROM,HDD"
and "Disk2,Disk1" method described above, is a "persistent" boot choosing system,
where you can just turn the PC power on, and it does the same thing every
time. The settings are stored in CMOS RAM, for usage each time by the BIOS.

But if you want, some BIOS offer a function key, for "temporary" boot
choosing ("BIOS popup boot menu"). Say, for example, both Disk #1 and Disk #2
have active partitions. On my current computer, I can press "F8" right after
power-up, and I get a "boot menu" offered by the BIOS. (My other computer
uses the "F10" key, so not all the computers use the same key presses.)
Note that F8 is a poor choice, because it is also used to get into
"Safe Mode" in Windows, so you should not continue to hammer F8 forever.
You have to stop hammering F8, when the popup boot menu finally shows up.

I can cursor down and select whatever storage device I want for booting. All
storage devices are enumerated in the list, whether they have media present
or not. Attempting to boot from an empty floppy drive, would not be too smart.
And if I select a hard drive, it better have a partition with the active flag set.
If nothing bootable is found, you'll likely get an appropriate BIOS error message.

http://i203.photobucket.com/albums/aa279/Von_klumpen/boot_pop.jpg

So you use the pop-up boot option, for temporary selections. And store
your "normal" choice as a "persistent" setup thing. The beauty of the
persistent setup, is you just turn the power on, and go make yourself
a coffee while the computer "warms up". And that is what you've been
doing, up to this point in time. Making lots of coffee. And leaving
the choice to the BIOS.

So that should give you a rough idea how some of it works.

If you wish to change the persistent settings, you can always enter
the BIOS at power-up, and use the setup screens to change things.

*******

You'll notice in that discussion, I didn't mention Master/Slave/Primary/Secondary
at all. They're terms used in the dual ribbon cable era of computing, for
IDE drives. SATA drives don't really have Master and Slave, but for labeling
purposes, if the computer is in "Compatible" mode, the computer actually
emulates that kind of labeling. So a SATA computer can still use
Master/Slave/Primary/Secondary for "bookkeeping", but not in any practical way
(jumpers etc).

SATA drives can have room for jumpers, but the jumpers select
"Force 150" or "Spread Spectrum Clocking", and those are entirely different
jumper choices. "Force 150" puts the cable in its slowest transmission mode,
of 150MB/sec (this is useful for hardware that doesn't support auto-negotiation,
or when your SATA cable has gone bad and you need the disk to work).
"Spread Spectrum Clocking" jumper is hardly ever needed, but on older
Macintosh computers, some of them can't "see" the disk, until you use the SS jumper.
The Force 150 jumper is used mainly with VIA chipsets (the exception being the
VT8237S, which doesn't need to be pampered and doesn't care about that jumper).

Some brands of SATA drives, like Hitachi, don't have jumpers on the back.
A separate setup program can be used with those drives, to change
things like "Force 150", but using a program to do that, is less
convenient than plugging in a jumper. The Hitachi drive stores the
user's choice inside the drive.

A drive like a Seagate, uses the jumper scheme to hold that same info.
My main problem here, with the jumper scheme, is I've only got one 2mm jumper
in the house, and I lost it :) You can't use the older 0.1" jumper pegs,
because they'll bend the pins on the drive and eventually break them.
So now I need to buy some 2mm jumpers, for emergencies. It's a good
thing that currently, I don't need any jumpers to make those drives
work the way I want.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top