OS Manuals

/usr/bin/sg_inq

SCSI utilities for Linux, Unix and Windows

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

Usage: sg_inq [--ata] [--block=0|1] [--cmddt] [cns=CNS] [--descriptors]
              [--export] [--extended] [--help] [--hex] [--id]
              [--inhex=FN] [--json[=JO]] [--js-file=JFN] [--len=LEN]
              [--long] [--maxlen=LEN] [--only] [--page=PG] [--raw]
              [--sinq_inraw=RFN] [--vendor] [--verbose] [--version]
              [--vpd] DEVICE
  where:
    --ata|-a        treat DEVICE as (directly attached) ATA device
    --block=0|1     0-> open(non-blocking); 1-> open(blocking)
      -B 0|1        (def: depends on OS; Linux pt: 0)
    --cmddt|-c      command support data mode (obsolete, see sg_opcodes)
    --cns=CNS       value for NVMe Identify command
    --descriptors|-d    display standard inquiry version descriptors
    --export|-u     SCSI_IDENT_<assoc>_<type>=<ident> output format.
                    Defaults to device id page (0x83) if --page not given,
                    only supported for VPD pages 0x80 and 0x83
    --extended|-E|-x    decode extended INQUIRY data VPD page (0x86)
    --force|-f      skip VPD page 0 check; directly fetch requested page
    --help|-h       print usage message then exit
    --hex|-H        output response in hex
    --id|-i         decode device identification VPD page (0x83)
    --inhex=FN|-I FN    read ASCII hex from file FN instead of DEVICE;
                        if used with --raw then read binary from FN
    --json[=JO]|-j[=JO]    output in JSON instead of plain text
                          Use --json=? for JSON help
    --js-file=JFN|-J JFN    JFN is a filename to which JSON output is
                            written (def: stdout); truncates then writes
    --len=LEN|-l LEN    requested response length (def: 0 -> fetch 36
                        bytes first, then fetch again as indicated)
    --long|-L       supply extra information on NVMe devices
    --maxlen=LEN|-m LEN    same as '--len='
    --old|-O        use old interface (use as first option)
    --only|-o       for std inquiry do not fetch serial number vpd page;
                    for NVMe device only do Identify controller
    --page=PG|-p PG     Vital Product Data (VPD) page number or
                        abbreviation (opcode number if '--cmddt' given)
    --quiet|-q      suppress some decoding and error output
    --raw|-r        output response in binary (to stdout)
    --sinq_inraw=RFN|-Q RFN    read raw (binary) standard INQUIRY
                               response from the RFN filename
    --vendor|-s     show vendor specific fields in std inquiry
    --verbose|-v    increase verbosity
    --version|-V    print this utility's version string then exit
    --vpd|-e        vital product data (set page with '--page=PG')

Sends a SCSI INQUIRY command to the DEVICE and decodes the response.
Alternatively it decodes the INQUIRY response held in file FN. If no
options given then it sends a 'standard' INQUIRY command to DEVICE. Can
list VPD pages with '--vpd' or '--page=PG' option.
Options (36)
OptionDescriptionSource
--block 0|10-> open(non-blocking);help
-B 0|1this option controls how the file handle to the DEVICE is opened.help + man
--cns CNSvalue for NVMe Identify commandhelp
--inhex, -I FN|-IFN is expected to be a file name (or '-' for stdin) which contains ASCII hexadecimal or binary representing an INQUIRY (including VPD page) response.help + man
--json JO]|-j[=JOoutput in JSON instead of plain text Use --json=? for JSON helphelp
--js-file, -J JFN|-JJFN is a filename to which JSON output is written (def: stdout);help + man
--len, -l LEN|-lrequested response length (def: 0 -> fetch 36 bytes first, then fetch again as indicated)help + man
--maxlen, -m LEN|-mthis option has the same action as the --len=LEN option above.help + man
--page, -p PG|-pVital Product Data (VPD) page number or abbreviation (opcode number if '--cmddt' given)help + man
--sinq_inraw, -Q RFN|-Qwhere RFN is a filename containing binary standard INQUIRY response data that matches either DEVICE or FN.help + man
-a, --ataThis option is only available in Linux. (in the manual page but not in --help)man
-c, --cmddtset the Command Support Data (CmdDt) bit (defaults to clear(0)). (in the manual page but not in --help)man
-d, --descriptorsdecodes and prints the version descriptors found in a standard INQUIRY response. (in the manual page but not in --help)man
-esee entry below for --vpd. (in the manual page but not in --help)man
-f, --forceAs a sanity check, the normal action when fetching VPD pages other than page 0x0 (the "Supported VPD pages" VPD page), is to first fetch page 0x0 and only if the requested page is one of the… (in the manual page but not in --help)man
-u, --exportprints out information obtained from the device. (in the manual page but not in --help)man
-E, -x, --extendedprints the extended INQUIRY VPD page [0x86]. (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, --hexrather than decode a standard INQUIRY response, a VPD page or command support data; (in the manual page but not in --help)man
-i, --idprints the device identification VPD page [0x83]. (in the manual page but not in --help)man
-L, --longthis option causes more information to be decoded from the Identify command sent to a NVMe 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
-o, --onlyDo not attempt to additionally retrieve the serial number VPD page (0x80) to enhance the output of a standard INQUIRY. (in the manual page but not in --help)man
-q, --quietsuppress the amount of decoding and error output. (in the manual page but not in --help)man
-r, --rawin the absence of the --inhex=FN option, the response is output in binary. (in the manual page but not in --help)man
-s, --vendoroutput a standard INQUIRY response's vendor specific fields from offset 36 to 55 in ASCII. (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
-36only requests 36 bytes of response data for an INQUIRY. (in the manual page but not in --help)man
-AAssume given DEVICE is an ATA or ATAPI device. (in the manual page but not in --help)man
-bdecodes the Block Limits VPD page [0xb0]. (in the manual page but not in --help)man
-cllists the command data for all supported commands (followed by the command name) by looping through all 256 opcodes. (in the manual page but not in --help)man
-Mdecodes the Mode page policy VPD page [0x87]. (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
-Pdecodes the Unit Path Report VPD page [0xc0] which is EMC specific. (in the manual page but not in --help)man
-?output usage message and 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.