OS Manuals

/usr/bin/sg_senddiag

SCSI utilities for Linux, Unix and Windows

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

Usage: sg_senddiag [--doff] [--extdur] [--help] [--hex] [--list]
                   [--maxlen=LEN] [--page=PG] [--pf] [--raw=H,H...]
                   [--selftest=ST] [--test] [--timeout=SECS] [--uoff]
                   [--verbose] [--version] [DEVICE]
  where:
    --doff|-d       device online (def: 0, only with '--test')
    --extdur|-e     duration of an extended self-test (from mode page 0xa)
    --help|-h       print usage message then exit
    --hex|-H        output RDR in hex; twice: plus ASCII; thrice: suitable
                    for '--raw=-' with later invocation
    --list|-l       list supported page codes (with or without DEVICE)
    --maxlen=LEN|-m LEN    parameter list length or maximum allocation
                           length (default: 4096 bytes)
    --page=PG|-P PG    do RECEIVE DIAGNOSTIC RESULTS only, set PCV
    --pf|-p         set PF bit (def: 0)
    --raw=H,H...|-r H,H...    sequence of hex bytes to form diag page to send
    --raw=-|-r -    read stdin for sequence of bytes to send
    --selftest=ST|-s ST    self-test code, default: 0 (inactive)
                           1->background short, 2->background extended
                           4->abort test
                           5->foreground short, 6->foreground extended
    --test|-t       default self-test
    --timeout=SECS|-T SECS    timeout for foreground self tests
                            unit: second (def: 7200 seconds)
    --uoff|-u       unit offline (def: 0, only with '--test')
    --verbose|-v    increase verbosity
    --old|-O        use old interface (use as first option)
    --version|-V    output version string then exit

Performs a SCSI SEND DIAGNOSTIC (and/or a RECEIVE DIAGNOSTIC RESULTS) command
Options (22)
OptionDescriptionSource
--maxlen, -m LEN|-mwhere LEN is the value placed in the parameter list length field of a SEND DIAGNOSTIC command or in the allocation length field of a RECEIVE DIAGNOSTIC RESULTS command.help + man
--page, -P PG|-Pwhere PG is the RECEIVE DIAGNOSTIC RESULTS command page code field.help + man
--raw, -r Hstring of comma separated hex numbers each of which should resolve to a byte value (i.e. 0 to ff inclusive).help + man
--selftest, -s ST|-sself-test code, default: 0 (inactive) 1->background short, 2->background extended 4->abort test 5->foreground short, 6->foreground extendedhelp + man
--timeout, -T SECS|-Twhere SECS is a timeout value (in seconds) for foreground self-test operations.help + man
-d, --doffset the Device Offline (DevOffL) bit (default is clear). (in the manual page but not in --help)man
-e, --extduroutputs the expected extended self-test duration. (in the manual page but not in --help)man
-h, --helpprint usage message then exit. (in the manual page but not in --help)man
-H, --hexoutputs response from RECEIVE DIAGNOSTIC RESULTS in hex rather than decode it. (in the manual page but not in --help)man
-l, --listwhen a DEVICE is also given lists the names of all diagnostic pages supported by this device. (in the manual page but not in --help)man
-O, --oldSwitch to older style options. (in the manual page but not in --help)man
-p, --pfset Page Format (PF) bit. (in the manual page but not in --help)man
-t, --testsets the _default_ Self Test (SelfTest) bit. (in the manual page but not in --help)man
-u, --uoffset the Unit Offline (UnitOffL) bit (default is clear). (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
-doffset the Device Offline (DevOffL) bit (default is clear). (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
-pfset Page Format (PF) bit. (in the manual page but not in --help)man
-raw Hstring of comma separated hex numbers each of which should resolve to a byte value (i.e. 0 to ff inclusive). (in the manual page but not in --help)man
-uoffset the Unit Offline (UnitOffL) bit (default is clear). (in the manual page but not in --help)man
-?output usage message. (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.