* scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id
@ 2008-06-10 21:07 John Huttley
2008-06-10 21:19 ` scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id fame Ken Brush
2008-06-11 16:30 ` Ken Brush
0 siblings, 2 replies; 3+ messages in thread
From: John Huttley @ 2008-06-10 21:07 UTC (permalink / raw)
To: linux-hotplug
Hi folks, I've been pokeing in scsi_id trying to understand the
serialnumber part.
I don't understand the choices patrick made in doing this.
My note to patrick follows:
Hi patrick,
I'm trying to undertstand your scsi_id program.
I'm testing on an LTO drive and the code
seems to call
do_scsi_page83_inquiry() which returns the (not really) serial number.
Why are you doing that? The page is.
sg_inq -vpd --page=0x83 /dev/st2
VPD INQUIRY: Device Identification page
inquiry cdb: 12 01 83 00 fc 00
inquiry: requested 252 bytes but got 42 bytes
Designation descriptor number 1, descriptor length: 38
id_type: T10 vendor identification, code_set: ASCII
associated with the addressed logical unit
vendor id: HP
vendor specific: C7438A HU107108XD
Why not get the real serial number from page 0x80??
sg_inq -vpd --page=0x80 /dev/st2
VPD INQUIRY: Unit serial number page
inquiry cdb: 12 01 80 00 fc 00
inquiry: requested 252 bytes but got 14 bytes
Unit serial number: HU107108XD
close error: No medium found
Mike Anderson wrote:
> John Huttley <John@mib-infotech.co.nz> wrote:
>> The email address in the source file (@ibm) is wrong.
>> Anyone know where he is?
>>
>
> He is not working for IBM anymore.
>
> If you have a scsi_id question you can post to this list as scsi_id is
> maintained as part of udev extras.
>
> -andmike
> --
> Michael Anderson
> andmike@linux.vnet.ibm.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id fame
2008-06-10 21:07 scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id John Huttley
@ 2008-06-10 21:19 ` Ken Brush
2008-06-11 16:30 ` Ken Brush
1 sibling, 0 replies; 3+ messages in thread
From: Ken Brush @ 2008-06-10 21:19 UTC (permalink / raw)
To: linux-hotplug
On Tue, Jun 10, 2008 at 2:07 PM, John Huttley <John@mib-infotech.co.nz> wrote:
> Hi folks, I've been pokeing in scsi_id trying to understand the serialnumber
> part.
>
> I don't understand the choices patrick made in doing this.
> My note to patrick follows:
>
>
> Hi patrick,
>
> I'm trying to undertstand your scsi_id program.
>
> I'm testing on an LTO drive and the code
> seems to call
>
> do_scsi_page83_inquiry() which returns the (not really) serial number.
>
> Why are you doing that? The page is.
>
> sg_inq -vpd --page=0x83 /dev/st2
> VPD INQUIRY: Device Identification page
> inquiry cdb: 12 01 83 00 fc 00
> inquiry: requested 252 bytes but got 42 bytes
> Designation descriptor number 1, descriptor length: 38
> id_type: T10 vendor identification, code_set: ASCII
> associated with the addressed logical unit
> vendor id: HP
> vendor specific: C7438A HU107108XD
>
>
>
> Why not get the real serial number from page 0x80??
>
> sg_inq -vpd --page=0x80 /dev/st2
> VPD INQUIRY: Unit serial number page
> inquiry cdb: 12 01 80 00 fc 00
> inquiry: requested 252 bytes but got 14 bytes
> Unit serial number: HU107108XD
> close error: No medium found
Did you read the scsi_id man page?
From the description part:
-- Start --
Description
scsi_id queries a SCSI device via the SCSI INQUIRY vital product data
(VPD) page 0x80 or 0x83 and uses the resulting data to generate a
value that is unique across all SCSI devices that properly support
page 0x80 or page 0x83.
If a result is generated it is sent to standard output, and the
program exits with a zero value. If no identifier is output, the
program exits with a non-zero value.
scsi_id is primarily for use by other utilities such as udev that
require a unique SCSI identifier.
By default all devices are assume black listed, the -g option must be
specified on the command line or in the config file for any useful
behaviour.
SCSI commands are sent directly to the device via the SG_IO ioctl interface.
In order to generate unique values for either page 0x80 or page 0x83,
the serial numbers or world wide names are prefixed as follows.
Identifiers based on page 0x80 are prefixed by the character 'S', the
SCSI vendor, the SCSI product (model) and then the the serial number
returned by page 0x80. For example:
# scsi_id -p 0x80 -s /block/sdg
SIBM 3542 1T05078453
Identifiers based on page 0x83 are prefixed by the identifier type
followed by the page 0x83 identifier. For example, a device with a NAA
(Name Address Authority) type of 3 (also in this case the page 0x83
identifier starts with the NAA value of 6):
# /sbin/scsi_id -p 0x83 -s /block/sdg
3600a0b80000b174b000000d63efc5c8c
-- End --
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id fame
2008-06-10 21:07 scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id John Huttley
2008-06-10 21:19 ` scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id fame Ken Brush
@ 2008-06-11 16:30 ` Ken Brush
1 sibling, 0 replies; 3+ messages in thread
From: Ken Brush @ 2008-06-11 16:30 UTC (permalink / raw)
To: linux-hotplug
On Tue, Jun 10, 2008 at 6:46 PM, John Huttley <John@mib-infotech.co.nz> wrote:
> Ken Brush wrote:
>
> On Tue, Jun 10, 2008 at 2:07 PM, John Huttley <John@mib-infotech.co.nz>
> wrote:
>
>
> Hi folks, I've been pokeing in scsi_id trying to understand the serialnumber
> part.
>
> I don't understand the choices patrick made in doing this.
> My note to patrick follows:
>
>
> Hi patrick,
>
> I'm trying to undertstand your scsi_id program.
>
> I'm testing on an LTO drive and the code
> seems to call
>
> do_scsi_page83_inquiry() which returns the (not really) serial number.
>
> Why are you doing that? The page is.
>
> sg_inq -vpd --page=0x83 /dev/st2
> VPD INQUIRY: Device Identification page
> inquiry cdb: 12 01 83 00 fc 00
> inquiry: requested 252 bytes but got 42 bytes
> Designation descriptor number 1, descriptor length: 38
> id_type: T10 vendor identification, code_set: ASCII
> associated with the addressed logical unit
> vendor id: HP
> vendor specific: C7438A HU107108XD
>
>
>
> Why not get the real serial number from page 0x80??
>
> sg_inq -vpd --page=0x80 /dev/st2
> VPD INQUIRY: Unit serial number page
> inquiry cdb: 12 01 80 00 fc 00
> inquiry: requested 252 bytes but got 14 bytes
> Unit serial number: HU107108XD
> close error: No medium found
>
>
> Did you read the scsi_id man page?
>
>
> Yes Ken, I have.
>
>
> It says nothing of why it works the way it does
> .
>
> The code is ignoring a perfectly good 0x80 page and grovelling through 0x83
> for vendor_specific
> information and passing that off as the serial number.
>
> Why?
>
> I want to "fix" it so that serial_short really is the serial number.
> Patrick chose not do so for reasons I don't understand.
> I don't want to bust things, particularly for hardware or situations I can't
> test for.
>
One simple answer is because SPC-3 requires that page 83 [Device
Identification]
is mandatory but page 80 [Unit Serial Number] is optional.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-11 16:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10 21:07 scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id John Huttley
2008-06-10 21:19 ` scsi_id design choices, was: Looking for Patrick Mansfield of scsi_id fame Ken Brush
2008-06-11 16:30 ` Ken Brush
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).