OS Manuals

/usr/bin/sg_write_attr

SCSI utilities for Linux, Unix and Windows

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

Usage: sg_write_attr [--element=EA] [--enumerate] [--help] [--hex]
                     [--in=FN] [--lvn=LVN] [--partition=PN] [--raw]
                     [--verbose] [--version] [--wtc] DEVICE
                     [attr=value [attr=value ...]]
  where:
    --enumerate|-e     enumerate known attributes and service actions
    --element=EA|-E EA    EA is placed in 'element address' field in
                          cdb [SMC-3] (def: 0)
    --help|-h          print out usage message
    --hex|-H           input file contains attribute list in hex format
    --in=FN|-i FN      FN is a filename containing attribute-value pairs
                       or attribute list in binary/hex format
                       if used with --raw or --hex
    --lvn=LVN|-l LVN        logical volume number (LVN) (def:0)
    --partition=PN|-p PN    partition number (PN) (def:0)
    --raw|-r           input file contains binary attribute list
    --verbose|-v       increase verbosity
    --version|-V       print version string and exit
    --wtc|-c           set WRITE THROUGH CACHE bit in cdn (def: clear)

Performs a SCSI WRITE ATTRIBUTE command. Even though it is defined in
SPC-3 and later it is typically used on tape systems.
Options (12)
OptionDescriptionSource
--element, -E EA|-Ewhere EA is an element address which is placed in the WRITE ATTRIBUTE cdb.help + man
--in, -i FN|-iFN is treated as a file name (or '-' for stdin) which contains attribute-value pairs one per line, ASCII hexadecimal or binary representing the payload of the WRITE ATTRIBUTE command.help + man
--lvn, -l LVN|-lwhere LVN is placed in the "logical volume number" field of the cdb.help + man
--partition PN|-ppartition number (PN) (def:0)help
-e, --enumerateenumerates all known attributes. (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, --hexused together with the input file (-i, --in=FN) to indicate input contents is in hexadecimal format with no leading address (on each line), similar to one produced by sg_read_attr -HHH output. (in the manual page but not in --help)man
-p, --pn PNwhere PN is placed in the "partition number" field of the cdb. (in the manual page but not in --help)man
-r, --rawused together with the input file (-i, --in=FN) to indicate input format is binary, similar to one produced by sg_read_attr --raw output. (in the manual page but not in --help)man
-c, --wtcsets the WRITE THROUGH CACHE bit in the WRITE ATTRIBUTE cdb. (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.