OS Manuals

/usr/bin/sg_write_buffer

SCSI utilities for Linux, Unix and Windows

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

Usage: sg_write_buffer [--bpw=CS] [--dry-run] [--help] [--id=ID] [--in=FILE]
                       [--length=LEN] [--mode=MO] [--offset=OFF]
                       [--read-stdin] [--skip=SKIP] [--specific=MS]
                       [--timeout=TO] [--verbose] [--version] DEVICE
  where:
    --bpw=CS|-b CS         CS is chunk size: bytes per write buffer
                           command (def: 0 -> as many as possible)
    --dry-run|-d           skip WRITE BUFFER commands, do everything else
    --help|-h              print out usage message then exit
    --id=ID|-i ID          buffer identifier (0 (default) to 255)
    --in=FILE|-I FILE      read from FILE ('-I -' read from stdin)
    --length=LEN|-l LEN    length in bytes to write; may be deduced from
                           FILE
    --mode=MO|-m MO        write buffer mode, MO is number or acronym
                           (def: 0 -> 'combined header and data' (obs))
    --offset=OFF|-o OFF    buffer offset (unit: bytes, def: 0)
    --read-stdin|-r        read from stdin (same as '-I -')
    --skip=SKIP|-s SKIP    bytes in file FILE to skip before reading
    --specific=MS|-S MS    mode specific value; 3 bit field (0 to 7)
    --timeout=TO|-t TO     command timeout in seconds (def: 300)
    --verbose|-v           increase verbosity
    --version|-V           print version string and exit

Performs one or more SCSI WRITE BUFFER commands. Use '-m xxx' to list
available modes. A chunk size of 4 KB ('--bpw=4k') seems to work well.
Example: sg_write_buffer -b 4k -I xxx.lod -m 7 /dev/sg3
Options (14)
OptionDescriptionSource
--bpw, -b CS|-bCS is chunk size: bytes per write buffer command (def: 0 -> as many as possible)help + man
--id, -i ID|-ithis option sets the buffer id field in the cdb.help + man
--in, -I FILE|-Iread data from file FILE that will be sent with the WRITE BUFFER command.help + man
--length, -l LEN|-lwhere LEN is the length, in bytes, of data to be written to the device.help + man
--mode, -m MO|-mwrite buffer mode, MO is number or acronym (def: 0 -> 'combined header and data' (obs))help + man
--offset, -o OFF|-othis option sets the BUFFER OFFSET field in the cdb.help + man
--skip, -s SKIP|-sthis option is only active when --in=FILE is given and FILE is a regular file, rather than stdin.help + man
--specific, -S MS|-SMS is the MODE SPECIFIC field in the cdb.help + man
--timeout, -t TO|-tTO is the command timeout (in seconds) for each WRITE BUFFER command issued by this utility.help + man
-d, --dry-runDo all the command line processing and sanity checks including reading the input file. (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
-r, --read-stdinread data from stdin until an EOF is detected. (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.