Discussion:
How does a SCSI device gets a target ID?
Guy
2005-03-09 16:54:57 UTC
Permalink
A narrow SCSI bus will support 8 devices.
A wide SCSI bus will support 16 devices.
A narrow bus uses 50 pins.
A wide bus uses 68 pins.

The SCSI card is a device, normally ID 7.

The SCSI ID is configured on the device. You will need to look at the
manual, some devices may have cryptic notes on the device. Each device must
have a unique ID.

There is a standard for auto selecting the SCSI ID. I have never used this.
SCAM (SCSI Configures Auto Magically).

The below speeds assume wide, divide by 2 is narrow.
There are many electrical standards.
SE - Single ended (20M/s)
DF (HVD) High voltage differential (20M/s)
U Ultra (40M/s)
U2 (LVD, U-80, Ultra 2) Low voltage differential (80M/s)
U-160 Ultra 160 (160M/s)
U-320 Ultra 320 (320M/s)
U-640 Ultra 640 (640M/s) Not sure this is a standard yet.

Mixing devices with different electrical standards can be tricky. Some
can't be mixed. HVD is not compatible with any other.

Both ends of the SCSI bus must be terminated. Some devices have an internal
terminator that can be enabled or disabled. The SCSI card normally is a
terminator. 1 device must supply terminator power. I believe it is ok if
more than 1 device supplies terminator power, but not sure. Normally the
SCSI card supplies terminator power.

I hope this answers your questions! :)

This link may help, but it is very out of date. It stops at Ultra!!!!

http://www.adaptec.com/worldwide/support/supporteditorial.jsp?sess=no&langua
ge=English+US&prodkey=SCSI_glossary

Guy

-----Original Message-----
From: linux-scsi-***@vger.kernel.org
[mailto:linux-scsi-***@vger.kernel.org] On Behalf Of Rajat Jain, Noida
Sent: Wednesday, March 09, 2005 11:04 AM
To: linux-***@vger.kernel.org
Subject: How does a SCSI device gets a target ID?

Hi,

I'm new to SCSI. I would appreciate if some one can solve my query:

When a new SCSI device is added to a SCSI channel, how can we find out what
is the target ID of that device?

1) If a channel supports 8 SCSI devices, then each of the 8 ports will have
a specific Target ID. And any device attached to that port will have that
Target ID.

2) Is it done one the fly? I mean (starting from zero), the SCSI device is
given a target ID that is 1 greater that the last SCSI device's ID. Who
assigns this ID?

TIA,

Rajat
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Matthew Wilcox
2005-03-09 17:29:43 UTC
Permalink
Post by Guy
A narrow SCSI bus will support 8 devices.
A wide SCSI bus will support 16 devices.
A narrow bus uses 50 pins.
A wide bus uses 68 pins.
We need a SCSI Wiki for all this kind of information ... maybe Wikipedia?
Post by Guy
There is a standard for auto selecting the SCSI ID. I have never used this.
SCAM (SCSI Configures Auto Magically).
I think the SCSI vendors prefer to sell SCA drives rather than SCAM
drives ;-) Drives with the SCA connector have power supplied to them and
their SCSI ID configured automatically depending on which slot they're
plugged into. If you're doing hotplug SCSI, it's probably with SCA drives.
Post by Guy
Mixing devices with different electrical standards can be tricky. Some
can't be mixed. HVD is not compatible with any other.
And plugging any SE devince onto an LVD bus causes the whole bus to fall
back to SE. This includes terminators.
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Guy
2005-03-10 04:38:53 UTC
Permalink
You said:
"And plugging any SE device onto an LVD bus causes the whole bus to fall
back to SE. This includes terminators."

True, but if your terminator is LVD only, it will get hot!!! Not sure if it
can be damaged, but it does get hot (or warm). :)

I also believe some LVD devices do not support SE.

Guy

-----Original Message-----
From: linux-scsi-***@vger.kernel.org
[mailto:linux-scsi-***@vger.kernel.org] On Behalf Of Matthew Wilcox
Sent: Wednesday, March 09, 2005 12:30 PM
To: Guy
Cc: 'Rajat Jain, Noida'; linux-***@vger.kernel.org
Subject: Re: How does a SCSI device gets a target ID?
Post by Guy
A narrow SCSI bus will support 8 devices.
A wide SCSI bus will support 16 devices.
A narrow bus uses 50 pins.
A wide bus uses 68 pins.
We need a SCSI Wiki for all this kind of information ... maybe Wikipedia?
Post by Guy
There is a standard for auto selecting the SCSI ID. I have never used this.
SCAM (SCSI Configures Auto Magically).
I think the SCSI vendors prefer to sell SCA drives rather than SCAM
drives ;-) Drives with the SCA connector have power supplied to them and
their SCSI ID configured automatically depending on which slot they're
plugged into. If you're doing hotplug SCSI, it's probably with SCA drives.
Post by Guy
Mixing devices with different electrical standards can be tricky. Some
can't be mixed. HVD is not compatible with any other.
And plugging any SE devince onto an LVD bus causes the whole bus to fall
back to SE. This includes terminators.
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Bryan Henderson
2005-03-09 18:45:45 UTC
Permalink
It's not clear what you're asking. You start off with the question
Post by Guy
When a new SCSI device is added to a SCSI channel, how can we find out
what
Post by Guy
is the target ID of that device?
That's clear enough, except I don't know who "we" is. Depending on who
you are, i.e. from what perspective you're looking, you would get this
information differently.

But then you give two hypotheses that describe how a device comes to have
its target ID, not how someone finds out what target ID it has.
Post by Guy
1) If a channel supports 8 SCSI devices, then each of the 8 ports will
have
Post by Guy
a specific Target ID. And any device attached to that port will have that
Target ID.
2) Is it done one the fly? I mean (starting from zero), the SCSI device
is
Post by Guy
given a target ID that is 1 greater that the last SCSI device's ID. Who
assigns this ID?
Others have read a particular question into your question and answered it,
but it might not be what you were looking for.

Let me give a shot at answering a few of the questions that it might be:

A device traditionally gets its target ID from a physical switch on the
device. The person who installs the device sets the switch and can tell
the target ID by looking at it the switch. That person chooses the target
IDs to be anything he wants, but makes sure that no two devices plugged
into the same bus have the same target ID.

In modern times, some devices (disk devices, anyway) get their target ID
by being plugged into a backplane or cable in a certain place. In that
case, you can tell the target ID by noting where it's plugged in and
knowing how the thing you plugged it into is configured. SCA is one
standard for allowing this kind of target ID assignment.

Some devices even get their target IDs dynamically with SCAM, but I don't
know anything about SCAM.

If you're inside the computer and trying to figure out what target ID an
attached device has, all you can do is search the namespace. You try each
target ID and if a device answers, you can ask it for information about
itself (model, serial number, etc.). But you don't necessarily ever know
what target ID a particular device has -- you just know that there exists
a device with a certain target ID.

At various levels of Linux, matching up target IDs with devices is done
via various interfaces, most of them quite tortured.

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Rajat Jain, Noida
2005-03-09 16:03:51 UTC
Permalink
Hi,

I'm new to SCSI. I would appreciate if some one can solve my query:

When a new SCSI device is added to a SCSI channel, how can we find out what
is the target ID of that device?

1) If a channel supports 8 SCSI devices, then each of the 8 ports will have
a specific Target ID. And any device attached to that port will have that
Target ID.

2) Is it done one the fly? I mean (starting from zero), the SCSI device is
given a target ID that is 1 greater that the last SCSI device's ID. Who
assigns this ID?

TIA,

Rajat
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Rajat Jain, Noida
2005-03-10 04:49:24 UTC
Permalink
BINGO !!!!!

That answered to a lot extent what I was looking for. Yes, I accept my
question was a little cloudy. I wanted to ask both the perspectives: How
does a SCSI device gets its ID ... And How can the software (kernel / user)
find out the target ID of the new disk.

I'm using a HS disk (Hot Swappable SCSI disk, they call it). I have 4 slots
in the front panel of my computer. And when ever I plug the disk into a
different port, the target ID changes. I wanted to confirm that the target
Ids are binded to the PORTS in my case. I got my answer, in my case, the
target ID depends upon which port you plug the disk into.

Every time I plug / unplug the disk, I have to echo "scsi
add-single-device"/"scsi remove single-device" (with correct traget ID) to
/proc/scsi/scsi. I wanted to automate this process, I wanted the disk to get
detected and installed the moment it is inserted / removed. Can I do that? I
don't mind writing a kernel module if need be.

Currently after reading the mail, what I am planning to do is to write a
user level script that would echo "add-single device" to the proc interface,
for ALL the possible target Ids on the Bus. But again, I would have to RUN
that script manually, and it will have to ITERATE on the the possible target
Ids. Is there a better way?

Thanx a ton,

Rajat


-----Original Message-----
From: Bryan Henderson [mailto:***@us.ibm.com]
Sent: Thursday, March 10, 2005 12:16 AM
To: Rajat Jain, Noida
Cc: linux-***@vger.kernel.org
Subject: Re: How does a SCSI device gets a target ID?

It's not clear what you're asking. You start off with the question
Post by Guy
When a new SCSI device is added to a SCSI channel, how can we find out
what
Post by Guy
is the target ID of that device?
That's clear enough, except I don't know who "we" is. Depending on who you
are, i.e. from what perspective you're looking, you would get this
information differently.

But then you give two hypotheses that describe how a device comes to have
its target ID, not how someone finds out what target ID it has.
Post by Guy
1) If a channel supports 8 SCSI devices, then each of the 8 ports will
have
Post by Guy
a specific Target ID. And any device attached to that port will have
that Target ID.
2) Is it done one the fly? I mean (starting from zero), the SCSI device
is
Post by Guy
given a target ID that is 1 greater that the last SCSI device's ID. Who
assigns this ID?
Others have read a particular question into your question and answered it,
but it might not be what you were looking for.

Let me give a shot at answering a few of the questions that it might be:

A device traditionally gets its target ID from a physical switch on the
device. The person who installs the device sets the switch and can tell the
target ID by looking at it the switch. That person chooses the target IDs
to be anything he wants, but makes sure that no two devices plugged into the
same bus have the same target ID.

In modern times, some devices (disk devices, anyway) get their target ID by
being plugged into a backplane or cable in a certain place. In that case,
you can tell the target ID by noting where it's plugged in and knowing how
the thing you plugged it into is configured. SCA is one standard for
allowing this kind of target ID assignment.

Some devices even get their target IDs dynamically with SCAM, but I don't
know anything about SCAM.

If you're inside the computer and trying to figure out what target ID an
attached device has, all you can do is search the namespace. You try each
target ID and if a device answers, you can ask it for information about
itself (model, serial number, etc.). But you don't necessarily ever know
what target ID a particular device has -- you just know that there exists a
device with a certain target ID.

At various levels of Linux, matching up target IDs with devices is done via
various interfaces, most of them quite tortured.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Bryan Henderson
2005-03-11 20:39:19 UTC
Permalink
Post by Rajat Jain, Noida
Every time I plug / unplug the disk, I have to echo "scsi
add-single-device"/"scsi remove single-device" (with correct traget ID) to
/proc/scsi/scsi. I wanted to automate this process, I wanted the disk to get
detected and installed the moment it is inserted / removed. Can I do that? I
don't mind writing a kernel module if need be.
This is the wonderful world of hotplug. I don't know anything about
hotplug -- my expertise on SCSI comes from an era when it wasn't even
electrically possible (allowable, anyway) to add a disk to a SCSI bus
without powering down.

So I hope someone on the list will give us an overview of the state of
hotplug and SCSI.

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Continue reading on narkive:
Loading...