Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

scsi_id(8) [debian man page]

SCSI_ID(8)						   Linux Administrator's Manual 						SCSI_ID(8)

scsi_id - retrieve and generate a unique SCSI identifier SYNOPSIS
scsi_id [options] 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 assumed black listed, the --whitelisted 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: # /lib/udev/scsi_id --page=0x80 --whitelisted --device=/dev/sda 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): # /lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/sda 3600a0b80000b174b000000d63efc5c8c OPTIONS
--blacklisted The default behaviour - treat the device as black listed, and do nothing unless a white listed device is found in the scsi_id con- fig-file. --device=device Send SG_IO commands to device, such as /dev/sdc. --config=config-file Read configuration and black/white list entries from config-file rather than the default /etc/scsi_id.config file. --whitelisted Treat the device as white listed. The --whitelisted option must be specified on the command line or in the scsi_id configuration file for scsi_id to generate any output. --page=0x80|0x83|pre-spc3-83 Use SCSI INQUIRY VPD page code 0x80, 0x83, or pre-spc3-83. The default behaviour is to query the available VPD pages, and use page 0x83 if found, else page 0x80 if found, else nothing. Page pre-spc3-83 should only be utilized for those scsi devices which are not compliant with the SPC-2 or SPC-3 format for page 83. While this option is used for older model 4, 5, and 6 EMC Symmetrix devices, its use with SPC-2 or SPC-3 compliant devices will fallback to the page 83 format supported by these devices. --replace-whitespace Reformat the output : replace all whitespaces by underscores. --export Export all data in KEY=<value> format used to import in other programs. --verbose Generate verbose debugging output. --version Display version number and exit. FILES
/etc/scsi_id.config Configuration of black/white list entries and per device options: # one config per line, short match strings match longer strings # vendor=string[,model=string],options=<per-device scsi_id command line options> vendor="ATA",options=-p 0x80 SEE ALSO
udev(7) AUTHORS
Developed by Patrick Mansfield <> based on SCSI ID source included in earlier linux 2.5 kernels, sg_utils source, and SCSI specifications. December 2003 SCSI_ID(8)

Check Out this Related Man Page

SG_VPD(8)							     SG3_UTILS								 SG_VPD(8)

sg_vpd - fetches Vital Product Data (VPD) pages using a SCSI INQUIRY command SYNOPSIS
sg_vpd [--enumerate] [--help] [--hex] [--ident] [--long] [--maxlen=LEN] [--page=PG] [--quiet] [--raw] [--verbose] [--version] DEVICE DESCRIPTION
This utility fetches a Vital Product Data page and decodes it or outputs it in ASCII hexadecimal or binary. VPD pages are fetched with a SCSI INQUIRY command. Probably the most important page is the Device Identification VPD page (page number: 0x83). Since SPC-3, support for this page has been flagged as mandatory. This page can be fetched by using the --ident option. When no options are given, other than a DEVICE, then the "Supported VPD pages" (0x0) VPD page is fetched and decoded. OPTIONS
Arguments to long options are mandatory for short options as well. The options are arranged in alphabetical order based on the long option name. -e, --enumerate list the names of the known VPD pages, first the standard pages, then the vendor specific pages. Each group is sorted in abbrevia- tion order. The DEVICE and other options are ignored and this utility exits afte listing the VPD page names. -h, --help outputs the usage message summarizing command line options then exits. Ignores DEVICE if given. -H, --hex outputs the requested VPD page in ASCII hexadecimal. Can be used multiple times, see section on the ATA information vpd page. -i, --ident decode the device identification (0x83) VPD page. When used once this option has the same effect as '--page=di'. When use twice then the short form of the device identification VPD page's logical unit designator is decoded. In the latter case this option has the same effect as '--quiet --page=di_lu'. -l, --long when decoding some VPD pages, give a little more output. For example the ATA Information VPD page only shows the signature (in hex) and the IDENTIFY (PACKET) DEVICE (in hex) when this option is given. -m, --maxlen=LEN where LEN is the (maximum) response length in bytes. It is placed in the cdb's "allocation length" field. If not given (or LEN is zero) then 252 is used (apart from the ATA Information VPD page which defaults to 572) and, if the response indicates this value is insufficient, another INQUIRY command is sent with a larger value in the cdb's "allocation length" field. If this option is given and LEN is greater than 0 then only one INQUIRY command is sent. Since many simple devices implement the INQUIRY command badly (and do not support VPD pages) then the safest value to use for LEN is 36. See the sg_inq man page for the more information. -p, --page=PG where PG is the VPD page to be decoded or output. The PG argument can either be an abbreviation, a number or a pair or numbers sepa- rated by a comma. The VPD page abbreviations can be seen by using the --enumerate option. If a number is given it is assumed to be decimal unless it has a hexadecimal indicator which is either a leading '0x' or a trailing 'h'. If one number is given then it is assumed to be a VPD page number. If two numbers are given the second number indicates which vendor specific VPD page to decode when several pages share the same VPD page number. If this option is not given (nor '-i', '-l' nor '-V') then the "Supported VPD pages" (0x0) VPD page is fetched and decoded. -q, --quiet suppress the amount of decoding output. -r, --raw output requested VPD page in binary. The output should be piped to a file or another utility when this option is used. The binary is sent to stdout, and errors are sent to stderr. -v, --verbose increases the level or verbosity. -V, --version print out version string then exit. ATA INFORMATION VPD PAGE
This VPD page (0x89 or 'ai') is defined by the SCSI to ATA Translation standard. It contains information about the SAT layer, the "signa- ture" of the ATA device and the response to the ATA IDENTIFY (PACKET) DEVICE command. The latter part has 512 bytes of identity, capability and settings data which the hdparm utility is capable of decoding (so this utility doesn't decode it). To unclutter the output for this page, the signature and the IDENTIFY (PACKET) DEVICE response are not output unless the --long option (or --hex or --raw) are given. When the --long option is given the IDENTIFY (PACKET) DEVICE response is output as 256 (16 bit) words as is the fashion for ATA devices. To see that response as a string of bytes use the '-HH' option. To format the output suitable for hdparm to decode use either the '-HHH' or '-rr' option. For example if 'dev/sdb' is a SATA disk behind a SAT layer then this command: 'sg_vpd -p ai -HHH /dev/sdb | hdparm --Istdin' should decode the ATA IDENTIFY (PACKET) DEVICE response. NOTES
In the 2.4 series of Linux kernels the DEVICE must be a SCSI generic (sg) device. In the 2.6 series block devices (e.g. disks and ATAPI DVDs) can also be specified. For example "sg_inq /dev/sda" will work in the 2.6 series kernels. From lk 2.6.6 other SCSI "char" device names may be used as well (e.g. "/dev/st0m"). EXIT STATUS
The exit status of sg_vpd is 0 when it is successful. Otherwise see the sg3_utils(8) man page. AUTHOR
Written by Doug Gilbert REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>. COPYRIGHT
Copyright (C) 2006-2008 Douglas Gilbert This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
sg_inq(sg3_utils), sdparm(sdparm), hdparm(hdparm) sg3_utils-1.26 February 2008 SG_VPD(8)
Man Page

Featured Tech Videos