OS Manuals

/usr/bin/sg_wr_mode

SCSI utilities for Linux, Unix and Windows

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

Usage: sg_wr_mode [--cfile=CF] [--contents=H,H...] [--dbd] [--force]
                  [--help] [--len=10|6] [--mask=M,M...] [--mfile=MF]
                  [--page=PG_H[,SPG_H]] [--raw] [--rtd] [--save]
                  [--six] [--verbose] [--version] DEVICE
  where:
    --cfile=CF | -C CF    contents in a file called CF
    --contents=H,H... | -c H,H...    comma separated string of hex numbers
                                     that is mode page contents to write
    --contents=- | -c -   read stdin for mode page contents to write
    --dbd | -d            disable block descriptors (DBD bit in cdb)
    --force | -f          force the contents to be written
    --help | -h           print out usage message
    --len=10|6 | -l 10|6    use 10 byte (def) or 6 byte variants of
                            SCSI MODE SENSE/SELECT commands
    --mask=M,M... | -m M,M...   comma separated string of hex
                                numbers that mask contents to write
    --mfile=MF | -M MF        mask in a file called MF
    --page=PG_H | -p PG_H     page_code to be written (in hex)
    --page=PG_H,SPG_H | -p PG_H,SPG_H    page and subpage code to be
                                         written (in hex)
    --raw | -r            contents of CF file decoded as binary
    --rtd | -R            set RTD bit (revert to defaults) in cdb
    --save | -s           set 'save page' (SP) bit; default don't so
                          only 'current' values changed
    --six | -6            do SCSI MODE SENSE/SELECT(6) commands
    --verbose | -v        increase verbosity
    --version | -V        print version string and exit

writes given mode page with SCSI MODE SELECT (10 or 6) command
Options (15)
OptionDescriptionSource
--cfile, -C CFwhere CF is a file name containing the mode page.help + man
--contents, -c Hcomma separated string of hex numbers that is mode page contents to writehelp + man
--dbd, -ddisable block descriptors (DBD flag in cdb).help + man
--force, -fforce the contents string to be taken as the new mode page, or at least doesn't do checks on the existing mode page.help + man
--help, -houtput the usage message then exit.help + man
--len, -l 10|6use 10 byte (def) or 6 byte variants of SCSI MODE SENSE/SELECT commandshelp + man
--mask, -m Mcomma separated string of hex numbers that mask contents to writehelp + man
--mfile, -M MFwhere MF is a file name containing the mode page mask.help + man
--page, -p PG_Hwhere PG_H is the page code value to fetch and modify.help + man
--raw, -rwhen this option is given then the file given by the --cfile=CF option is treated as binary (the default is to treat it as ASCII hexadecimal).help + man
--rtd, -Rwhen this option is given most other actions are bypassed and a MODE SELECT(6 or 10) command is sent to the DEVICE with the RTD bit set.help + man
--save, -schanges the "saved" mode page when MODE SELECT is successful.help + man
--six, -6this option will cause the 6 byte variants of MODE SENSE and MODE SELECT commands to be used.help + man
--verbose, -vincrease the level of verbosity, (i.e. debug output).help + man
--version, -Vprint the version string and then exit.help + man
Exit status (1) from the manual page
0it is successful
Examples (5) from the manual page, untested

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