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] [--readonly] [--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's starting
33 LBA and number of blocks are output in hex and the provisioning
34 status in decimal. When used twice (e.g. '-bb' or '--brief
35 --brief') then the provisioning status of the given LBA (or LBA
36 0 if the --lba option is not given) is output to stdout. A check
37 is made that the given LBA lies in the range of the first
38 returned LBA status descriptor (as it should according to SBC-3
39 revision 20) and warnings are 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 -R, --readonly
64 open the DEVICE read-only (e.g. in Unix with the O_RDONLY flag).
65 The default is to open it read-write.
66
67 -v, --verbose
68 increase the level of verbosity, (i.e. debug output). Additional
69 output caused by this option is sent to stderr.
70
71 -V, --version
72 print the version string and then exit.
73
75 In SBC-3 revision 25 the calculation associated with the Parameter Data
76 Length field in the response was modified. Prior to that the byte off‐
77 set was 8 and in revision 25 it was changed to 4.
78
79 For a discussion of logical block provisioning see section 4.7 of
80 sbc3r29.pdf at http://www.t10.org (or the corresponding section of a
81 later draft).
82
84 The exit status of sg_get_lba_status is 0 when it is successful. Other‐
85 wise see the sg3_utils(8) man page.
86
88 Written by Douglas Gilbert.
89
91 Report bugs to <dgilbert at interlog dot com>.
92
94 Copyright © 2009-2014 Douglas Gilbert
95 This software is distributed under a FreeBSD license. There is NO war‐
96 ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
97 POSE.
98
100 sg_write_same(8), sg_unmap(8)
101
102
103
104sg3_utils-1.39 May 2014 SG_GET_LBA_STATUS(8)