1SG_GET_LBA_STATUS(8) SG3_UTILS SG_GET_LBA_STATUS(8)
2
3
4
6 sg_get_lba_status - send SCSI GET LBA STATUS command
7
9 sg_get_lba_status [--brief] [--help] [--hex] [--lba=LBA] [--maxlen=LEN]
10 [--raw] [--verbose] [--version] DEVICE
11
13 Send the SCSI GET LBA STATUS command to the DEVICE and outputs the
14 response. This command was introduced in (draft) SBC-3 revision 20 and
15 devices that support logical block provisioning should support this
16 command.
17
18 The default action is to decode the response into one LBA status
19 descriptor per line output to stdout. The descriptor LBA is output in
20 hex (prefixed by '0x') and the number of blocks is output in decimal
21 followed by the provisioning status in decimal. The provisioning status
22 can be in the range 0 to 15 of which only 0 (mapped), 1 (unmapped) and
23 2 (anchored) are used currently. The amount of output can be reduced by
24 the --brief option.
25
27 Arguments to long options are mandatory for short options as well.
28
29 -b, --brief
30 when use once then one LBA status descriptor per line is output
31 to stdout. Each line has this format: "0x<descriptor_LBA>
32 0x<blocks> <provisioning_status>". So the descriptor LBA and
33 blocks are output in hex and the provisioning status in decimal.
34 When used twice (e.g. '-bb' or '--brief --brief') the provision‐
35 ing status of the given LBA (or LBA 0 if the --lba option is not
36 given) is output to stdout. A check is made that the given LBA
37 lies on the range of the first returned LBA status descriptor
38 (as it should according to SBC-3 revision 20) and warnings are
39 sent to stderr if it doesn't.
40
41 -h, --help
42 output the usage message then exit.
43
44 -H, --hex
45 output response to this command in ASCII hex.
46
47 -l, --lba=LBA
48 where LBA is the starting Logical Block Address (LBA) to check
49 the provisioning status for. Note that the DEVICE chooses how
50 many following blocks that it will return provisioning status
51 for.
52
53 -m, --maxlen=LEN
54 where LEN is the (maximum) response length in bytes. It is
55 placed in the cdb's "allocation length" field. If not given then
56 24 is used. 24 is enough space for the response header and one
57 LBA status descriptor. LEN should be 8 plus a multiple of 16
58 (e.g. 24, 40, and 56 are suitable).
59
60 -r, --raw
61 output response in binary (to stdout).
62
63 -v, --verbose
64 increase the level of verbosity, (i.e. debug output). Additional
65 output caused by this option is sent to stderr.
66
67 -V, --version
68 print the version string and then exit.
69
71 In SBC-3 revision 25 the calculation associated with the Parameter Data
72 Length field in the response was modified. Prior to that the byte off‐
73 set was 8 and in revision 25 it was changed to 4.
74
75 For a discussion of logical block provisioning see section 4.7 of
76 sbc3r29.pdf at http://www.t10.org (or the corresponding section of a
77 later draft).
78
80 The exit status of sg_get_lba_status is 0 when it is successful. Other‐
81 wise see the sg3_utils(8) man page.
82
84 Written by Douglas Gilbert.
85
87 Report bugs to <dgilbert at interlog dot com>.
88
90 Copyright © 2009-2012 Douglas Gilbert
91 This software is distributed under a FreeBSD license. There is NO war‐
92 ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
93 POSE.
94
96 sg_write_same(8), sg_unmap(8)
97
98
99
100sg3_utils-1.35 November 2012 SG_GET_LBA_STATUS(8)