1SG_VPD(8)                          SG3_UTILS                         SG_VPD(8)
2
3
4

NAME

6       sg_vpd  -  fetches  Vital Product Data (VPD) pages using a SCSI INQUIRY
7       command
8

SYNOPSIS

10       sg_vpd [--enumerate] [--help] [--hex] [--ident] [--long] [--maxlen=LEN]
11       [--page=PG] [--quiet] [--raw] [--verbose] [--version] DEVICE
12

DESCRIPTION

14       This  utility  fetches a Vital Product Data page and decodes it or out‐
15       puts it in ASCII hexadecimal or binary. VPD pages are  fetched  with  a
16       SCSI INQUIRY command.
17
18       Probably  the most important page is the Device Identification VPD page
19       (page number: 0x83). Since  SPC-3,  support  for  this  page  has  been
20       flagged  as  mandatory.  This  page can be fetched by using the --ident
21       option.
22
23       When no options are given, other than a DEVICE, then the "Supported VPD
24       pages" (0x0) VPD page is fetched and decoded.
25

OPTIONS

27       Arguments to long options are mandatory for short options as well.  The
28       options are arranged in alphabetical order based  on  the  long  option
29       name.
30
31       -e, --enumerate
32              list the names of the known VPD pages, first the standard pages,
33              then the vendor specific pages. Each group is sorted in abbrevi‐
34              ation  order.  The DEVICE and other options are ignored and this
35              utility exits afte listing the VPD page names.
36
37       -h, --help
38              outputs the usage message summarizing command line options  then
39              exits.  Ignores DEVICE if given.
40
41       -H, --hex
42              outputs the requested VPD page in ASCII hexadecimal. Can be used
43              multiple times, see section on the ATA information vpd page.
44
45       -i, --ident
46              decode the device identification (0x83) VPD page. When used once
47              this  option  has the same effect as '--page=di'. When use twice
48              then the short form of the device identification VPD page's log‐
49              ical  unit designator is decoded. In the latter case this option
50              has the same effect as '--quiet --page=di_lu'.
51
52       -l, --long
53              when decoding some VPD pages, give a  little  more  output.  For
54              example  the  ATA  Information VPD page only shows the signature
55              (in hex) and the IDENTIFY (PACKET) DEVICE  (in  hex)  when  this
56              option is given.
57
58       -m, --maxlen=LEN
59              where  LEN  is  the  (maximum)  response  length in bytes. It is
60              placed in the cdb's "allocation length" field. If not given  (or
61              LEN  is  zero)  then 252 is used (apart from the ATA Information
62              VPD page which defaults to 572) and, if the  response  indicates
63              this value is insufficient, another INQUIRY command is sent with
64              a larger value in the cdb's "allocation length" field.  If  this
65              option  is given and LEN is greater than 0 then only one INQUIRY
66              command is sent. Since many simple devices implement the INQUIRY
67              command  badly  (and  do  not support VPD pages) then the safest
68              value to use for LEN is 36. See the sg_inq man page for the more
69              information.
70
71       -p, --page=PG
72              where  PG  is the VPD page to be decoded or output. The PG argu‐
73              ment can either be an abbreviation, a number or a pair  or  num‐
74              bers  separated  by  a  comma. The VPD page abbreviations can be
75              seen by using the --enumerate option. If a number is given it is
76              assumed  to  be  decimal  unless  it has a hexadecimal indicator
77              which is either a leading '0x' or a trailing 'h'. If one  number
78              is given then it is assumed to be a VPD page number. If two num‐
79              bers are given the second number indicates which vendor specific
80              VPD  page  to  decode when several pages share the same VPD page
81              number. If this option is not given (nor '-i',  '-l'  nor  '-V')
82              then  the  "Supported  VPD  pages" (0x0) VPD page is fetched and
83              decoded.
84
85       -q, --quiet
86              suppress the amount of decoding output.
87
88       -r, --raw
89              output requested VPD page in binary. The output should be  piped
90              to  a  file  or  another  utility  when this option is used. The
91              binary is sent to stdout, and errors are sent to stderr.
92
93       -v, --verbose
94              increases the level or verbosity.
95
96       -V, --version
97              print out version string then exit.
98

ATA INFORMATION VPD PAGE

100       This VPD page (0x89 or 'ai') is defined by the SCSI to ATA  Translation
101       standard.  It contains information about the SAT layer, the "signature"
102       of the ATA device and the response to the ATA IDENTIFY (PACKET)  DEVICE
103       command. The latter part has 512 bytes of identity, capability and set‐
104       tings data which the hdparm utility is capable  of  decoding  (so  this
105       utility doesn't decode it).
106
107       To  unclutter  the output for this page, the signature and the IDENTIFY
108       (PACKET) DEVICE response are not output unless the  --long  option  (or
109       --hex or --raw) are given. When the --long option is given the IDENTIFY
110       (PACKET) DEVICE response is output as 256 (16  bit)  words  as  is  the
111       fashion  for ATA devices. To see that response as a string of bytes use
112       the '-HH' option. To format the output suitable for  hdparm  to  decode
113       use  either  the  '-HHH' or '-rr' option. For example if 'dev/sdb' is a
114       SATA disk behind a SAT layer then this  command:  'sg_vpd  -p  ai  -HHH
115       /dev/sdb  |  hdparm  --Istdin'  should decode the ATA IDENTIFY (PACKET)
116       DEVICE response.
117

NOTES

119       In the 2.4 series of Linux kernels the DEVICE must be  a  SCSI  generic
120       (sg)  device.  In  the  2.6  series block devices (e.g. disks and ATAPI
121       DVDs) can also be specified. For example "sg_inq /dev/sda" will work in
122       the  2.6  series  kernels. From lk 2.6.6 other SCSI "char" device names
123       may be used as well (e.g. "/dev/st0m").
124

EXIT STATUS

126       The exit status of sg_vpd is 0 when it is successful. Otherwise see the
127       sg3_utils(8) man page.
128

AUTHOR

130       Written by Doug Gilbert
131

REPORTING BUGS

133       Report bugs to <dgilbert at interlog dot com>.
134
136       Copyright © 2006-2008 Douglas Gilbert
137       This  software is distributed under a FreeBSD license. There is NO war‐
138       ranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR  PUR‐
139       POSE.
140

SEE ALSO

142       sg_inq(sg3_utils), sdparm(sdparm), hdparm(hdparm)
143
144
145
146sg3_utils-1.26                   February 2008                       SG_VPD(8)
Impressum