{
    "mode": "man",
    "parameter": "sginfo",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/sginfo/8/json",
    "generated": "2026-10-04T13:43:18Z",
    "synopsis": "sginfo [OPTIONS] [DEVICE] [REPLACEMENTPARAMETERS]",
    "sections": {
        "NAME": {
            "content": "sginfo - access mode page information for a SCSI (or ATAPI) device\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sginfo [OPTIONS] [DEVICE] [REPLACEMENTPARAMETERS]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "sginfo  is  a port of the Linux scsiinfo program by Eric Youngdale. It uses SCSI generic (sg)\ndevices; however in some cases the high level device name (i.e. sd, sr, st, osst, or hd)  can\nalso be used. The primary role of this program is to access mode page information. If permit‐\nted,  mode page information can be altered. In addition information from the INQUIRY and READ\nDEFECTS commands are also available.\n\nThis utility is in legacy mode, only obvious bugs will be fixed. Options like -l (to list de‐\nvices) are broken in recent versions of Linux (e.g. 2.6  series  and  later);  the  lsscsi(8)\nutility can be used instead. Also mode pages are not being updated as http://www.t10.org adds\nand  modifies mode page fields. Those interested in SCSI mode pages may find the sdparm util‐\nity more up to date and easier use, especially for changing parameters.\n\nFour sets of values are maintained by a SCSI device for each mode page: current (active), de‐\nfault (manufacturer's supplied values), saved (values that are retained if the SCSI device is\npowered down), and changeable (mask indicating those values that can be changed).  By default\nwhen a mode page is displayed the current values are shown. This can be  overridden  by  \"-M\"\n(defaults), \"-S\" (saved) or \"-m\" (modifiable (i.e. changeable)).\n\nMany  mode pages are decoded: for disks (see SBC-2), for CD/DVDs (see MMC-2/3/4/5), for tapes\n(see SSC-2) and for enclosures (see SES-2).  Some mode pages common to  all  SCSI  peripheral\ndevice types are defined in SPC-4 (primary commands). A decoded mode page has its field names\nin the first column and the corresponding value in the second column.  A \"hex\" mode page (and\nsubpage)  has its byte position in the first column (in hex and starting at 0x2) and the cor‐\nresponding hex value in the second column. Decoded pages can be viewed with the  '-t'  option\nor with a specific option (e.g. 'c' for the caching mode page).  Naturally decoded pages must\nbe supplied by the DEVICE and recognised by this program. If supported by the device, decoded\npages  may  be modified. All mode pages (and subpages) that the device supports can be viewed\nin hex (and potentially modified) via the \"-u\" option\n\nIf no options are given that will cause mode page(s) or INQUIRY data to be printed out,  then\na  brief  INQUIRY response is output. This includes the vendor, product and revision level of\nthe device.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-6",
                    "content": "are used.\n",
                    "flag": "-6"
                },
                {
                    "name": "-a",
                    "content": "ported by the device. It is similar to the '-t 0x3f' option. If the mode page is known\nthen it is output in decoded form otherwise it is output in hexadecimal.\n",
                    "flag": "-a"
                },
                {
                    "name": "-A",
                    "content": "all mode subpages reported by the device.  It is similar to the '-t 0x3f,0xff' option.\nIf  a mode (sub)page is known then it is output in decoded form otherwise it is output\nin hexadecimal.\n",
                    "flag": "-A"
                },
                {
                    "name": "-c",
                    "content": "",
                    "flag": "-c"
                },
                {
                    "name": "-C",
                    "content": "",
                    "flag": "-C"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-D",
                    "content": "",
                    "flag": "-D"
                },
                {
                    "name": "-e",
                    "content": "",
                    "flag": "-e"
                },
                {
                    "name": "-E",
                    "content": "",
                    "flag": "-E"
                },
                {
                    "name": "-f",
                    "content": "",
                    "flag": "-f"
                },
                {
                    "name": "-F_",
                    "content": "-Flogical  - logical block addresses (32 bit)\n-Flba64    - logical block addresses (64 bit)\n-Fphysical - physical blocks\n-Findex    - defect bytes from index\n-Fhead     - sort by head\nUsed in conjunction with \"-d\" or \"-G\". If a format is not given \"index\" is assumed.\n"
                },
                {
                    "name": "-g",
                    "content": "",
                    "flag": "-g"
                },
                {
                    "name": "-G",
                    "content": "",
                    "flag": "-G"
                },
                {
                    "name": "-i",
                    "content": "",
                    "flag": "-i"
                },
                {
                    "name": "-I",
                    "content": "",
                    "flag": "-I"
                },
                {
                    "name": "-l",
                    "content": "csi(8) in the Linux 2.6 series and later. List known SCSI devices on the system.\n",
                    "flag": "-l"
                },
                {
                    "name": "-n",
                    "content": "",
                    "flag": "-n"
                },
                {
                    "name": "-N",
                    "content": "changes go to the current and the saved page).  Only active when  used  together  with\n'-R'.\n",
                    "flag": "-N"
                },
                {
                    "name": "-P",
                    "content": "",
                    "flag": "-P"
                },
                {
                    "name": "-r",
                    "content": "are /dev/sda, /dev/st1 and /dev/scd2. Does not list sg device names so devices such as\na SCSI enclosure which only have an sg device name are not listed.\n",
                    "flag": "-r"
                },
                {
                    "name": "-s",
                    "content": "",
                    "flag": "-s"
                },
                {
                    "name": "-t _",
                    "content": "Display  information  from mode page number PN (and optionally sub page number SPN) in\ndecoded format (if known, otherwise in hex form).  PN is a mode page number in a deci‐\nmal number from 0 to 63 inclusive.  SPN is the mode subpage number and is  assumed  to\nbe  0 if not given.  SPN is a decimal number from 1 to 255 inclusive. A page number of\n63 returns all pages supported by the device in ascending  order  except  for  page  0\nwhich, if present, is last. Page 0 is vendor specific and not necessarily in mode page\nformat.  Alternatively  hex  values can be given for both PN and SPN (both prefixed by\n'0x').\n",
                    "flag": "-t"
                },
                {
                    "name": "-T",
                    "content": "mands are shown (in hex) and any errors from these SCSI commands are spelt  out  (i.e.\nwith  a  decoded and raw sense buffer). When used twice, the additional data sent with\nmode select and the response from mode sense are shown (in hex).\n",
                    "flag": "-T"
                },
                {
                    "name": "-u _",
                    "content": "Display information from mode page number PN (and optionally SPN) in hex form. PN is a\nmode page number in a decimal number from 0 to 63 inclusive. SPN is the  mode  subpage\nnumber  and is assumed to be 0 if not given. SPN is a decimal number from 1 to 255 in‐\nclusive. A page number of 63 returns all pages supported by the  device  in  ascending\norder  except for page 0 which, if present, is last. Page 0 is vendor specific and not\nnecessarily in mode page format. Alternatively hex values can be given for both PN and\nSPN (both prefixed by '0x'). For example 63 and 0x3f are equivalent.\n",
                    "flag": "-u"
                },
                {
                    "name": "-v",
                    "content": "utilities in this package as outlined in 'man 8 sg3utils'.  This  odd  usage  is  for\nbackward compatibility with the scsiinfo utility.]\n",
                    "flag": "-v"
                },
                {
                    "name": "-V",
                    "content": "the version string then exits in most other utilities in this package as  outlined  in\n'man  8  sg3utils'.  This  odd  usage is for backward compatibility with the scsiinfo\nutility.]\n",
                    "flag": "-V"
                },
                {
                    "name": "-z",
                    "content": "response).  The default action is to do a double fetch, the first fetch is to find the\nresponse length that could be returned. Devices that closely adhere to SCSI  standards\nshould not require this option, some real world devices do require it.\n",
                    "flag": "-z"
                }
            ]
        },
        "ADVANCED OPTIONS": {
            "content": "Only  one  of  the following three options can be specified.  None of these three implies the\ncurrent values are returned.\n",
            "subsections": [
                {
                    "name": "-m",
                    "content": "",
                    "flag": "-m"
                },
                {
                    "name": "-M",
                    "content": "",
                    "flag": "-M"
                },
                {
                    "name": "-S",
                    "content": "The following are advanced options, not generally suited for most users:\n",
                    "flag": "-S"
                },
                {
                    "name": "-X",
                    "content": "to the '-R' (replace command).\n",
                    "flag": "-X"
                },
                {
                    "name": "-R",
                    "content": "",
                    "flag": "-R"
                }
            ]
        },
        "CHANGING MODE PAGE PARAMETERS": {
            "content": "Firstly  you  should  know what you are doing before changing existing parameters. Taking the\ncontrol page as an example, first list it out normally (e.g. \"sginfo -C /dev/sda\") and decide\nwhich parameter is to be changed (note its position relative to the other lines output). Then\nexecute the same sginfo command with the \"-X\" option added; this will  output  the  parameter\nvalues  in  a  single row in the same relative positions as the previous command. Now execute\n\"sginfo -CXR /dev/sda ...\" with the \"...\" replaced by the single row of values output by  the\nprevious command, with the relevant parameter changed. Here is a simplified example:\n\n$ sginfo -C /dev/sda\nControl mode page (0xa)\n-----------------------\nTST                        0\nDSENSE                    0\nGLTSD                      1\nRLEC                       0\n\n[Actually  the  Control page has more parameters that shown above.] Next output those parame‐\nters in single line form:\n\n$ sginfo -CX /dev/sda\n0 0 1 0\n\nLet us assume that the GLTSD bit is to be cleared. The command that will clear it is:\n\n$ sginfo -CXR /dev/sda 0 0 0 0\n\nThe same number of parameters output by the \"-CX\" command needs to be placed at  the  end  of\nthe \"-CXR\" command line (after the device name).  Now check that the change took effect:\n\n$ sginfo -C /dev/sda\nControl mode page (0xa)\n-----------------------\nTST                        0\nDSENSE                    0\nGLTSD                      0\nRLEC                       0\n\nWhen  a mode page is \"replaced\" the default action is to change both the current page and the\nsaved page. [For some reason versions of sginfo and scsiinfo prior to 2.0 did not change  the\n\"saved\"  page.] To change only the current mode page but not the corresponding saved page use\nthe \"-N\" option.\n",
            "subsections": []
        },
        "GENERATING SCRIPT FILES AND HEX PAGES": {
            "content": "The \"-aX\" or \"-AX\" option generates output suitable for a script file.  Mode pages are output\nin list format (after the INQUIRY and serial number) one page per line. To facilitate running\nthe output as (part of) a script file to assert chosen mode page values, each  line  is  pre‐\nfixed  by  \"sginfo -t PN[,SPN] -XR \". When such a script file is run, it will have the effect\nof re-asserting the mode page values to what they were when the \"-aX\" generated the output.\n\nAll mode pages (and subpages) supported by the device can be accessed via the -t and  -u  op‐\ntions.  To see all mode pages supported by the device use \"-u 63\". [To see all mode pages and\nall subpages use \"-u 63,255\".] To list the control mode page in hex (mode page index  in  the\nfirst  column and the corresponding byte value in the second column) use \"-u 0xa\". Mode pages\n(subpage code == 0) start at index position 2 while subpages start at index position  4.   If\nthe  \"-Xu  ...\" option is used then a list a hex values each value prefixed by \"@\" is output.\nMode (sub)page values can then be modified with the \"-RXu ...\" option.\n",
            "subsections": []
        },
        "RESTRICTIONS": {
            "content": "The SCSI MODE SENSE command yields block descriptors as well as a mode page(s). This  utility\nignores  block  descriptors  and does not display them. The \"disable block descriptor\" switch\n(DBD) in the MODE SENSE command is not set since some devices yield errors when  it  is  set.\nWhen mode page values are being changed (the \"-R\" option), the same block descriptor obtained\nby  reading  the mode page (i.e. via a MODE SENSE command) is sent back when the mode page is\nwritten (i.e. via a MODE SELECT command).\n",
            "subsections": []
        },
        "REFERENCES": {
            "content": "SCSI (draft) standards can be found at http://www.t10.org . The relevant documents are  SPC-4\n(mode  pages  common  to all device types), SBC-2 (direct access devices [e.g. disks]), MMC-4\n(CDs and DVDs) and SSC-2 (tapes).\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Written by Eric Youngdale, Michael Weller, Douglas Gilbert, Kurt Garloff, Thomas Steudten\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "scsiinfo version 1.0 was released by Eric Youngdale on 1st November 1993.   The  most  recent\nversion of scsiinfo is version 1.7 with the last patches by Michael Weller. sginfo is derived\nfrom  scsiinfo and uses the sg interface to get around the 4 KB buffer limit in scsiinfo that\ncramped the display of defect lists especially. sginfo was written by  Douglas  Gilbert  with\npatches from Kurt Garloff. This manpage corresponds with version 2.25 of sginfo.\n\nThis software is distributed under the GPL version 2. There is NO warranty; not even for MER‐\nCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "",
            "subsections": [
                {
                    "name": "lsscsi(lsscsi), scsiinfo(internet); sg_modes, sg_inq, sg_vpd (sg3_utils), sdparm(sdparm)",
                    "content": "sg3utils-1.38                              January 2014                                   SGINFO(8)"
                }
            ]
        }
    },
    "summary": "sginfo - access mode page information for a SCSI (or ATAPI) device",
    "flags": [
        {
            "flag": "-6",
            "long": null,
            "arg": null,
            "description": "are used."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "ported by the device. It is similar to the '-t 0x3f' option. If the mode page is known then it is output in decoded form otherwise it is output in hexadecimal."
        },
        {
            "flag": "-A",
            "long": null,
            "arg": null,
            "description": "all mode subpages reported by the device. It is similar to the '-t 0x3f,0xff' option. If a mode (sub)page is known then it is output in decoded form otherwise it is output in hexadecimal."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-E",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "-Flogical - logical block addresses (32 bit) -Flba64 - logical block addresses (64 bit) -Fphysical - physical blocks -Findex - defect bytes from index -Fhead - sort by head Used in conjunction with \"-d\" or \"-G\". If a format is not given \"index\" is assumed."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-G",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-I",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "csi(8) in the Linux 2.6 series and later. List known SCSI devices on the system."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": "changes go to the current and the saved page). Only active when used together with '-R'."
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": "are /dev/sda, /dev/st1 and /dev/scd2. Does not list sg device names so devices such as a SCSI enclosure which only have an sg device name are not listed."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "Display information from mode page number PN (and optionally sub page number SPN) in decoded format (if known, otherwise in hex form). PN is a mode page number in a deci‐ mal number from 0 to 63 inclusive. SPN is the mode subpage number and is assumed to be 0 if not given. SPN is a decimal number from 1 to 255 inclusive. A page number of 63 returns all pages supported by the device in ascending order except for page 0 which, if present, is last. Page 0 is vendor specific and not necessarily in mode page format. Alternatively hex values can be given for both PN and SPN (both prefixed by '0x')."
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "mands are shown (in hex) and any errors from these SCSI commands are spelt out (i.e. with a decoded and raw sense buffer). When used twice, the additional data sent with mode select and the response from mode sense are shown (in hex)."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "Display information from mode page number PN (and optionally SPN) in hex form. PN is a mode page number in a decimal number from 0 to 63 inclusive. SPN is the mode subpage number and is assumed to be 0 if not given. SPN is a decimal number from 1 to 255 in‐ clusive. A page number of 63 returns all pages supported by the device in ascending order except for page 0 which, if present, is last. Page 0 is vendor specific and not necessarily in mode page format. Alternatively hex values can be given for both PN and SPN (both prefixed by '0x'). For example 63 and 0x3f are equivalent."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "utilities in this package as outlined in 'man 8 sg3utils'. This odd usage is for backward compatibility with the scsiinfo utility.]"
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "the version string then exits in most other utilities in this package as outlined in 'man 8 sg3utils'. This odd usage is for backward compatibility with the scsiinfo utility.]"
        },
        {
            "flag": "-z",
            "long": null,
            "arg": null,
            "description": "response). The default action is to do a double fetch, the first fetch is to find the response length that could be returned. Devices that closely adhere to SCSI standards should not require this option, some real world devices do require it."
        }
    ],
    "examples": [],
    "see_also": []
}