OS Manuals

/usr/bin/sg_get_lba_status

SCSI utilities for Linux, Unix and Windows

From sg3-utils 1.49-r3 (enterprise-packages), captured 2026-11-08 by running sg_get_lba_status --help (exit 0). permalink

Usage: sg_get_lba_status  [--16] [--32] [--blockhex] [--brief]
                          [--element-id=EI] [--help] [--hex] [--inhex=FN]
                          [--json[=JO]] [--js_file=JFN] [--lba=LBA]
                          [--maxlen=LEN] [--raw] [--readonly]
                          [--report-type=RT] [--scan-len=SL] [--verbose]
                          [--version] DEVICE
  where:
    --16|-S           use GET LBA STATUS(16) cdb (def)
    --32|-T           use GET LBA STATUS(32) cdb
    --blockhex|-B     outputs the (number of) blocks field  in hex
    --brief|-b        a descriptor per line:
                          <lba_hex blocks_hex p_status add_status>
                      use twice ('-bb') for given LBA provisioning status
    --element-id=EI|-e EI      Element Identifier (EI) (def: 0 --> all)
    --help|-h         print out usage message
    --hex|-H          output in hexadecimal
    --inhex=FN|-i FN    input taken from file FN rather than DEVICE,
                        assumed to be ASCII hex or, if --raw, in binary
    --json[=JO]|-j[=JO]    output in JSON instead of plain text
                           Use --json=? for JSON help
    --js-file=JFN|-J JFN    JFN is a filename to which JSON output is
                            written (def: stdout); truncates then writes
    --lba=LBA|-l LBA    starting LBA (logical block address) (def: 0)
    --maxlen=LEN|-m LEN    max response length (allocation length in cdb)
                           (def: 0 -> 1024 bytes)
    --raw|-r          output in binary, unless if --inhex=FN is given,
                      in which case input file is binary
    --readonly|-R     open DEVICE read-only (def: read-write)
    --report-type=RT|-t RT    report type: 0->all LBAs (def);
                                1-> LBAs with non-zero provisioning status
                                2-> LBAs that are mapped
                                3-> LBAs that are deallocated
                                4-> LBAs that are anchored
                                16-> LBAs that may return unrecovered error
    --scan-len=SL|-s SL    SL in maximum scan length (unit: logical blocks)
                           (def: 0 which implies no limit)
    --verbose|-v      increase verbosity
    --version|-V      print version string and exit

Performs a SCSI GET LBA STATUS(16) or GET LBA STATUS(32) command (SBC-3 and
SBC-4). The --element-id=EI and the --scan-len=SL fields are only active
on the 32 byte cdb variant. If --inhex=FN is given then contents of FN is
assumed to be a response to this command.
Options (18)
OptionDescriptionSource
--element-id, -e EI|-ewhere EI is the element identifier of the physical element for which the LBAs shall be reported based on the value in the report type field (i.e. RT).help + man
--inhex, -i FN|-iinput taken from file FN rather than DEVICE, assumed to be ASCII hex or, if --raw, in binaryhelp + man
--json JO]|-j[=JOoutput in JSON instead of plain text Use --json=? for JSON helphelp
--js-file, -J JFN|-JJFN is a filename to which JSON output is written (def: stdout);help + man
--lba, -l LBA|-lwhere LBA is the starting Logical Block Address (LBA) to check the provisioning status for.help + man
--maxlen, -m LEN|-mmax response length (allocation length in cdb) (def: 0 -> 1024 bytes)help + man
--report-type, -t RT|-twhere RT is 0 for report all LBAs;help + man
--scan-len, -s SL|-swhere SL is the scan length which is the maximum number of contiguous logical blocks to be scanned for logical blocks that meet the given report type (i.e. RT).help + man
-S, --16send SCSI GET LBA STATUS(16) command which is the 16 byte variant. (in the manual page but not in --help)man
-T, --32send SCSI GET LBA STATUS(32) command which is the 32 byte variant. (in the manual page but not in --help)man
-b, --briefwhen use once then one LBA status descriptor per line is output to stdout. (in the manual page but not in --help)man
-B, --blockhexthe number of blocks in each LBA status descriptor is usually displayed in decimal. (in the manual page but not in --help)man
-h, --helpoutput the usage message then exit. (in the manual page but not in --help)man
-H, --hexoutput response to this command in ASCII hex. (in the manual page but not in --help)man
-r, --rawoutput response in binary (to stdout) unless the --inhex=FN option is also given. (in the manual page but not in --help)man
-R, --readonlyopen the DEVICE read-only (e.g. in Unix with the O_RDONLY flag). (in the manual page but not in --help)man
-v, --verboseincrease the level of verbosity, (i.e. debug output). (in the manual page but not in --help)man
-V, --versionprint the version string and then exit. (in the manual page but not in --help)man
Exit status (1) from the manual page
0it is successful

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.