NAME
sg_inq - outputs data retrieved from the SCSI INQUIRY command
SYNOPSIS
sg_inq
[
-c] [
-cl>] [
-e] [
-h] [
-o=<opcode_page>]
[
-p] [
-r] [
-V] [
-36] [
-?]
<sg_device>
DESCRIPTION
This utility sends an INQUIRY SCSI command to the given device and then
outputs the response. All SCSI devices are meant to respond to
a "standard" INQUIRY command with at least a 36 byte response (in SCSI 2
and higher). An INQUIRY is termed as "standard" when both the EVPD and
CmdDt bits are clear.
The reference document used for interpreting an INQUIRY is T10/1416-D Revision
16 (5 December 2003) found at http://www.t10.org . Obsolete items are
displayed in brackets.
- -c
-
set the Command Support Data (CmdDt) bit (defaults to clear(0)). Used
in conjunction with the '-o=<opcode>' option to specify the SCSI command
opcode to supply the support data for. The command support data is a mask of
the same length as the command with bits set in positions that are
modifiable. For example, '12 03 ff 00 ff 01' shows the device
supports the EVPD and CmdDt bits ]byte 1 bits 0 and 1] in an INQUIRY command.
The CmdDt bit is now obsolete. There is now a REPORT SUPPORTED OPERATION CODES
command that yields similar information [MAINTENANCE IN, service action = 0xc].
Support will be added in the future.
- -cl
-
lists the command data for all supported commands (followed by the command
name) by looping through all 256 opcodes. This option uses the CmdDt bit
which is now obsolete.
- -e
-
enable (i.e. sets) the Vital Product Data (EVPD) bit (defaults to clear(0)).
Used in conjunction with the '-o=<page>' option to specify the VPD page
to fetch. According to the SCSI 2 standard VPD page 0 lists the supported
VPD page numbers.
- -h
-
outputs INQUIRY response in hex rather than trying to decode it.
- -o=<opcode_page>
-
used in conjunction with the '-c' option in which case the argument is
a command opcode. Alternatively it can be used in conjunction with
the '-e' option in which case the argument is a VPD page number. Argument
is hexadecimal and expected to be in the range 0 to ff inclusive.
- -p
-
outputs PCI slot information of the given device (if there is any) after
the INQUIRY response.
- -r
-
outputs the INQUIRY response in binary. Standard output should be redirected
to a file or some other program that can process binary data.
- -V
-
print out version string
- -36
-
only requires 36 bytes of response data for an INQUIRY. Furthermore even
if the device indicates in its response it can supply more data, a
second (longer) INQUIRY is not performed.
- -?
-
output usage message. Ignore all other parameters.
Some device with weak SCSI command set implementations lock up when
they receive commands they don't understand (or even response lengths
that they don't expect). Such devices need to be treated carefully
hence the '-36' option. Without this option this utility will issue
a standard INQUIRY requesting 36 bytes of response data. If the device
indicates it could have supplied more data then a second INQUIRY is
issued to fetch the longer response.
In the 2.4 series of Linux kernels the given device must be
a SCSI generic (sg) device. In the 2.6 series block devices (e.g. disks
and SCSI DVDs) can also be specified. For example "sg_inq /dev/sda"
will work in the 2.6 series kernels.
AUTHOR
Written by Doug Gilbert
REPORTING BUGS
Report bugs to <
dgilbert@interlog.com>.
COPYRIGHT
Copyright © 2001-2003 Douglas Gilbert
This software is distributed under the GPL version 2. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
sgdiag(scsirastools), sg_modes(sg3_utils), sg_logs(sg3_utils)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- AUTHOR
-
- REPORTING BUGS
-
- COPYRIGHT
-
- SEE ALSO
-