OS Manuals

/usr/bin/sg_read_buffer

SCSI utilities for Linux, Unix and Windows

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

Usage: sg_read_buffer [--16] [--eh_code=EHC] [--help] [--hex] [--id=ID]
                      [--inhex=FN] [--length=LEN] [--long] [--mode=MO]
                      [--no_output] [--offset=OFF] [--raw] [--readonly]
                      [--specific=MS] [--verbose] [--version] DEVICE
  where:
    --16|-L             issue READ BUFFER(16) (def: 10)
    --eh_code=EHC|-e EHC    same as '-m eh -i EHC' where EHC is the
                            error history code
    --help|-h           print out usage message
    --hex|-H            print output in hex
    --id=ID|-i ID       buffer identifier (0 (default) to 255)
    --inhex=FN|-I FN    filename FN contains hex data to decode
                        rather than DEVICE. If --raw given then binary
    --length=LEN|-l LEN    length in bytes to read (def: 4, 64 for eh)
    --long|-L           issue READ BUFFER(16) (def: 10)
    --mode=MO|-m MO     read buffer mode, MO is number or acronym (def: 0)
    --no_output|-N      perform the command then exit
    --offset=OFF|-o OFF    buffer offset (unit: bytes, def: 0)
    --raw|-r            output response in binary to stdout
    --readonly|-R       open DEVICE read-only (def: read-write)
    --specific=MS|-S MS    mode specific value; 3 bit field (0 to 7)
    --verbose|-v        increase verbosity
    --version|-V        print version string and exit

Performs a SCSI READ BUFFER (10 or 16) command. Use '-m xxx' to list
available modes. Some responses are decoded, others are output in hex.
Options (14)
OptionDescriptionSource
--eh_code, -e EHC|-eEHC is the error history code placed in the Buffer ID field of the cdb.help + man
--id, -i ID|-ithis option sets the Buffer ID field in the cdb.help + man
--inhex, -I FN|-IFN is expected to be a file name (or '-' for stdin) which contains ASCII hexadecimal or binary representing a READ BUFFER response.help + man
--length, -l LEN|-lwhere LEN is the length, in bytes, that is placed in the "allocation length" field in the cdb.help + man
--mode, -m MO|-mread buffer mode, MO is number or acronym (def: 0)help + man
--offset, -o OFF|-othis option sets the buffer offset field in the cdb.help + man
--specific, -S MS|-Sthis option sets the mode specific field in the cdb.help + man
-h, --helpoutput the usage message then exit. (in the manual page but not in --help)man
-H, --hexoutput the response in hexadecimal. (in the manual page but not in --help)man
-N, --no_outputwhen this option is given after sending the SCSI command to the DEVICE the response is processed, looking for any errors, and then this utility exits. (in the manual page but not in --help)man
-r, --rawif a response is received then it is sent in binary to stdout. (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.