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

NAME

6       sg_get_lba_status - send SCSI GET LBA STATUS(16 or 32) command
7

SYNOPSIS

9       sg_get_lba_status  [--16]  [--32]  [--brief] [--element-id=EI] [--help]
10       [--hex]     [--lba=LBA]     [--maxlen=LEN]     [--raw]     [--readonly]
11       [--report-type=RT] [--scan-len=SL] [--verbose] [--version] DEVICE
12

DESCRIPTION

14       Send  the  SCSI GET LBA STATUS(16) or GET LBA STATUS(32) command to the
15       DEVICE and output the response. The 16 byte command variant was  intro‐
16       duced  in  (draft)  SBC-3  revision 20 and devices that support logical
17       block provisioning should support this command. The GET LBA  STATUS(32)
18       command was added in (draft) SBC-4 revision 14.
19
20       The  default  action  is  to  decode  the  response into one LBA status
21       descriptor per line output to stdout. The descriptor LBA is  output  in
22       hex  (prefixed  by  '0x') and the number of blocks is output in decimal
23       followed by the provisioning status and additional status  in  decimal.
24       The  provisioning  status  can  be in the range 0 to 15 of which only 0
25       (mapped or unknown), 1 (unmapped),  2  (anchored),  3  (mapped)  and  4
26       (unknown)  are  used  currently. The amount of output can be reduced by
27       the --brief option.
28

OPTIONS

30       Arguments to long options are mandatory for short options as well.
31
32       -S, --16
33              send SCSI GET LBA STATUS(16) command which is the 16 byte  vari‐
34              ant. In the absence of the --16 or the --32 options the SCSI GET
35              LBA STATUS(16) command is  sent.  If  both  --16  and  the  --32
36              options are given then the GET LBA STATUS(16) command is sent.
37
38       -T, --32
39              send  SCSI GET LBA STATUS(32) command which is the 32 byte vari‐
40              ant. When given together with the --16 option then  this  option
41              is ignored (so the GET LBA STATUS(16) command is sent).
42
43       -b, --brief
44              when  use once then one LBA status descriptor per line is output
45              to stdout.   Each  line  has  this  format:  "0x<descriptor_LBA>
46              0x<blocks>  <provisioning_status>  <additional_status>".  So the
47              descriptor's starting LBA and number of blocks are output in hex
48              while the provisioning status and additional status are in deci‐
49              mal. When used twice (e.g. '-bb' or '--brief --brief') then  the
50              provisioning  status  of  the  given  LBA (or LBA 0 if the --lba
51              option is not given) is output to stdout. A check is  made  that
52              the given LBA lies in the range of the first returned LBA status
53              descriptor (as it should according to  SBC-3  revision  20)  and
54              warnings are sent to stderr if it doesn't.
55
56       -e, --element-id=EI
57              where  EI  is the element identifier of the physical element for
58              which the LBAs shall be reported  based  on  the  value  in  the
59              report  type  field  (i.e.  RT). This option is only active with
60              the SCSI GET LBA STATUS(32) command (i.e. it is ignored  if  the
61              GET LBA STATUS(16) command is sent).
62              Valid  element identifiers are non-zero. The default value of EI
63              is 0 which means in the context that no  element  identifier  is
64              specified.
65
66       -h, --help
67              output the usage message then exit.
68
69       -H, --hex
70              output response to this command in ASCII hex.
71
72       -l, --lba=LBA
73              where  LBA  is the starting Logical Block Address (LBA) to check
74              the provisioning status for. Note that the  DEVICE  chooses  how
75              many  following  blocks  that it will return provisioning status
76              for.
77
78       -m, --maxlen=LEN
79              where LEN is the (maximum)  response  length  in  bytes.  It  is
80              placed in the cdb's "allocation length" field. If not given then
81              24 is used. 24 is enough space for the response header  and  one
82              LBA  status  descriptor.   LEN should be 8 plus a multiple of 16
83              (e.g. 24, 40, and 56 are suitable).
84
85       -r, --raw
86              output response in binary (to stdout).
87
88       -R, --readonly
89              open the DEVICE read-only (e.g. in Unix with the O_RDONLY flag).
90              The default is to open it read-write.
91
92       -t, --report-type=RT
93              where  RT  is  0  for  report  all LBAs; 1 for report LBAs using
94              non-zero provisioning status; 2 for report LBAs that are mapped;
95              3  for report LBAs that are de-allocated; 4 for report LBAs that
96              are anchored; 16 for report LBAs that may return an  unrecovered
97              error. The REPORT TYPE field was added to the GET LBA STATUS cdb
98              in sbc4r12.
99              Since the REPORT TYPE field  is  newer  than  the  command,  the
100              response  contains  the  RTP  bit to indicate whether or not the
101              DEVICE acts on the REPORT TYE field (set when it does act on it,
102              clear otherwise).
103
104       -s, --scan-len=SL
105              where  SL is the scan length which is the maximum number of con‐
106              tiguous logical blocks to be scanned  for  logical  blocks  that
107              meet the given report type (i.e. RT). This option is only active
108              with the SCSI GET LBA STATUS(32) command (i.e. it is ignored  if
109              the GET LBA STATUS(16) command is sent).
110              The  default value of SL is 0 which should be interpreted by the
111              DEVICE as there is no limits to the number of LBAs that shall be
112              scanned.
113
114       -v, --verbose
115              increase the level of verbosity, (i.e. debug output). Additional
116              output caused by this option is sent to stderr.
117
118       -V, --version
119              print the version string and then exit.
120

NOTES

122       In SBC-3 revision 25 the calculation associated with the Parameter Data
123       Length  field in the response was modified. Prior to that the byte off‐
124       set was 8 and in revision 25 it was changed to 4.
125
126       For a discussion of logical  block  provisioning  see  section  4.7  of
127       sbc4r14.pdf  at  http://www.t10.org  (or the corresponding section of a
128       later draft).
129

EXIT STATUS

131       The exit status of sg_get_lba_status is 0 when it is successful. Other‐
132       wise see the sg3_utils(8) man page.
133

AUTHORS

135       Written by Douglas Gilbert.
136

REPORTING BUGS

138       Report bugs to <dgilbert at interlog dot com>.
139
141       Copyright © 2009-2018 Douglas Gilbert
142       This  software is distributed under a FreeBSD license. There is NO war‐
143       ranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR  PUR‐
144       POSE.
145

SEE ALSO

147       sg_write_same(8), sg_unmap(8)
148
149
150
151sg3_utils-1.43                    August 2018             SG_GET_LBA_STATUS(8)
Impressum