OS Manuals

/usr/bin/sg_modes

SCSI utilities for Linux, Unix and Windows

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

Usage: sg_modes [--all] [--control=PC] [--dbd] [--dbout] [--examine]
                [--flexible] [--help] [--hex] [--list] [--llbaa]
                [--maxlen=LEN] [--multiple] [--page=PG[,SPG]] [--raw] [-R]
                [--readwrite] [--six] [--verbose] [--version] [DEVICE]
  where:
    --all|-a        get all mode pages supported by device
                    use twice to get all mode pages and subpages
    --control=PC|-c PC    page control (if not given: 0)
                       0: current, 1: changeable,
                       2: (manufacturer's) defaults, 3: saved
    --dbd|-d        disable block descriptors (DBD field in cdb)
    --dbout|-D      disable block descriptor output
    --examine|-e    examine pages # 0 through to 0x3e, note if found
    --flexible|-f    be flexible, cope with MODE SENSE 6/10 response mixup
    --help|-h       print usage message then exit
    --hex|-H        output full response in hex
                    use twice to output page number and header in hex
    --list|-l       list common page codes for device peripheral type,
                    if no device given then assume disk type
    --llbaa|-L      set Long LBA Accepted (LLBAA field in mode sense (10) cdb)
    --maxlen=LEN|-m LEN    max response length (allocation length in cdb)
                           (def: 0 -> 4096 or 252 (for MODE SENSE 6) bytes)
    --multiple|-M    output multiple page controls rather`than one
    --page=PG|-p PG    page code to fetch (def: 63). May be acronym
    --page=PG,SPG|-p PG,SPG
                       page code and subpage code to fetch (defs: 63,0)
    --raw|-r        output response in binary to stdout
    -R              mode page response to stdout, a byte per line in ASCII
                    hex (same result as '--raw --raw')
    --readwrite|-w    open DEVICE read-write (def: open read-only)
    --six|-6|-s     use MODE SENSE(6), by default uses MODE SENSE(10)
    --verbose|-v    increase verbosity
    --old|-O        use old interface (use as first option)
    --version|-V    output version string then exit

Performs a SCSI MODE SENSE (10 or 6) command. To access and possibly change
mode page fields see the sdparm utility.
Options (24)
OptionDescriptionSource
--control, -c PC|-cpage control (if not given: 0) 0: current, 1: changeable, 2: (manufacturer's) defaults, 3: savedhelp + man
--maxlen, -m LEN|-mmax response length (allocation length in cdb) (def: 0 -> 4096 or 252 (for MODE SENSE 6) bytes)help + man
--page, -p PG|-ppage code to fetch (def: 63).help + man
-Rmode page response to stdout, a byte per line in ASCII hex (same result as '--raw --raw')help + man
-a, --alloutput all the mode pages reported by the DEVICE. (in the manual page but not in --help)man
-A, --ALLsame meaning as using the --all option twice. (in the manual page but not in --help)man
-d, --dbddisable block descriptors. (in the manual page but not in --help)man
-D, --dboutdisable outputting block descriptors. (in the manual page but not in --help)man
-e, --examineif the --page=PG[,SPG] option is not given, examine each mode page in the range 0 through to 62 (inclusive). (in the manual page but not in --help)man
-f, --flexibleSome devices, bridges and/or drivers attempt crude translations between MODE SENSE 6 and 10 byte commands without correcting the response. (in the manual page but not in --help)man
-h, --helpprint out the usage message then exit. (in the manual page but not in --help)man
-H, --hexSince this utility shows the structure of a MODE SENSE command response (i.e. its parameter header, zero or more block descriptors followed by zero or more mode pages) but outputs most of the… (in the manual page but not in --help)man
-l, --listlists all common page and subpage codes and their names that are found in the command set that matches the peripheral type of the given DEVICE. (in the manual page but not in --help)man
-L, --llbaaset the Long LBA Accepted (LLBAA) bit in the MODE SENSE (10) cdb. (in the manual page but not in --help)man
-M, --multiplefor each mode page (and mode subpage), fetch all available page controls. (in the manual page but not in --help)man
-O, --oldSwitch to older style options. (in the manual page but not in --help)man
-r, --rawoutput the response in binary to stdout. (in the manual page but not in --help)man
-w, --readwriteopen DEVICE in "read-write" mode. (in the manual page but not in --help)man
-6, -s, --sixby default this utility sends a 10 byte MODE SENSE command to the DEVICE. (in the manual page but not in --help)man
-v, --verboseincrease level of verbosity. (in the manual page but not in --help)man
-V, --versionprint out version string then exit. (in the manual page but not in --help)man
-N, --newSwitch to the newer style options. (in the manual page but not in --help)man
-subp SPGsub page code to fetch. (in the manual page but not in --help)man
-?output usage message 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.