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

NAME

6       sg_vpd  -  fetch Vital Product Data (VPD) pages via a SCSI INQUIRY com‐
7       mand
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       The reference document used for interpreting VPD pages (and the INQUIRY
24       standard  response)  is T10/1713-D Revision 36e (SPC-4, 24 August 2012)
25       found at http://www.t10.org . Obsolete and reserved items in the  stan‐
26       dard INQUIRY response output are displayed in square brackets.
27
28       When no options are given, other than a DEVICE, then the "Supported VPD
29       pages" (0x0) VPD page is fetched and decoded.
30

OPTIONS

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

ATA INFORMATION VPD PAGE

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

NOTES

125       Since some VPD pages (e.g. the Extended INQUIRY page)  depend  on  set‐
126       tings  in  the  standard  INQUIRY  response,  then the standard INQUIRY
127       response is output as a pseudo VPD page when  PG  is  set  to  '-1'  or
128       'sinq'.  Also  the  decoding  of some fields (e.g. the Extended INQUIRY
129       page's SPT field) is expanded when the '--long' option is  given  using
130       the standard INQUIRY response information (e.g. the PDT and the PROTECT
131       fields).
132
133       In the 2.4 series of Linux kernels the DEVICE must be  a  SCSI  generic
134       (sg)  device.  In  the  2.6  series block devices (e.g. disks and ATAPI
135       DVDs) can also be specified. For example "sg_inq /dev/sda" will work in
136       the  2.6  series  kernels. From lk 2.6.6 other SCSI "char" device names
137       may be used as well (e.g. "/dev/st0m").
138

EXIT STATUS

140       The exit status of sg_vpd is 0 when it is successful. Otherwise see the
141       sg3_utils(8) man page.
142

EXAMPLES

144       The  examples  in this page use Linux device names. For suitable device
145       names in other supported Operating Systems  see  the  sg3_utils(8)  man
146       page.
147
148       To  see  the VPD pages that a device supports, use with no options. The
149       command line invocation is shown first followed by a typical response:
150
151          # sg_vpd /dev/sdb
152       Supported VPD pages VPD page:
153         Supported VPD pages [sv]
154         Unit serial number [sn]
155         Device identification [di]
156         Extended inquiry data [ei]
157         Block limits (SBC) [bl]
158
159       To see the VPD page numbers associated with each  supported  page  then
160       add  the  '--long' option to the above command line. To view a VPD page
161       either its number or abbreviation can be given to the '--page=' option.
162       The  page name abbreviations are shown within square brackets above. In
163       the next example the Extended inquiry data VPD page is listed:
164
165          # sg_vpd --page=ei /dev/sdb
166       extended INQUIRY data VPD page:
167         ACTIVATE_MICROCODE=0 SPT=0 GRD_CHK=0 APP_CHK=0 REF_CHK=0
168         UASK_SUP=0 GROUP_SUP=0 PRIOR_SUP=0 HEADSUP=1 ORDSUP=1 SIMPSUP=1
169         WU_SUP=0 CRD_SUP=0 NV_SUP=0 V_SUP=0
170         P_I_I_SUP=0 LUICLR=0 R_SUP=0 CBCS=0
171         Multi I_T nexus microcode download=0
172         Extended self-test completion minutes=0
173         POA_SUP=0 HRA_SUP=0 VSA_SUP=0
174
175       To check if any protection types  are  supported  by  a  disk  use  the
176       '--long' option on the Extended inquiry data VPD page:
177
178          # sg_vpd --page=ei --long /dev/sdb
179          extended INQUIRY data VPD page:
180            ACTIVATE_MICROCODE=0
181            SPT=1 [protection types 1 and 2 supported]
182            GRD_CHK=1
183            ....
184
185       Further       examples       can       be       found       on      the
186       http://sg.danny.cz/sg/sg3_utils.html web page.
187

AUTHOR

189       Written by Douglas Gilbert
190

REPORTING BUGS

192       Report bugs to <dgilbert at interlog dot com>.
193
195       Copyright © 2006-2012 Douglas Gilbert
196       This software is distributed under a FreeBSD license. There is NO  war‐
197       ranty;  not  even  for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
198       POSE.
199

SEE ALSO

201       sg_inq(sg3_utils), sg3_utils(sg3_utils), sdparm(sdparm), hdparm(hdparm)
202
203
204
205sg3_utils-1.35                   November 2012                       SG_VPD(8)
Impressum