{
    "mode": "man",
    "parameter": "sg_ident",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/sg_ident/8/json",
    "generated": "2026-10-08T09:25:02Z",
    "synopsis": "sgident  [--ascii]  [--clear]  [--help] [--itype=IT] [--raw] [--set] [--verbose] [--version]\nDEVICE",
    "sections": {
        "NAME": {
            "content": "sgident - send SCSI REPORT/SET IDENTIFYING INFORMATION command\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sgident  [--ascii]  [--clear]  [--help] [--itype=IT] [--raw] [--set] [--verbose] [--version]\nDEVICE\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Send a SCSI REPORT IDENTIFYING INFORMATION or SET IDENTIFYING INFORMATION command to  DEVICE.\nPrior  to  SPC-4 (revision 7) these commands were called REPORT DEVICE IDENTIFIER and SET DE‐\nVICE IDENTIFIER respectively. SCSI devices that support these two  commands  allow  users  to\nwrite (set) identifying information and report it back at some later time. The information is\npersistent  (i.e. stored on some non-volatile medium within the SCSI device that will survive\na power outage).\n\nTypically the space allocated for the information is limited: SPC-4 (revision 7) states  that\nfor  information  type  0,  the  minimum length is 64 bytes and the maximum is 512 bytes. For\nother information types (1 to 126 inclusive) the maximum length is 256 bytes.  Also  informa‐\ntion types 1 to 126 (inclusive) should contain a null terminated UTF-8 string. The author has\nseen older disks that only support 16 bytes.\n\nThe  default action when no options are given is to invoke the Report Identifying Information\ncommand with the information type defaulting to zero. Error reports are sent  to  stderr.  By\ndefault  the information is shown in ASCII-HEX (up to 16 bytes per line) with an ASCII repre‐\nsentation to the right with dots replacing non printable characters.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "Arguments to long options are mandatory for short options as well.\n",
            "subsections": [
                {
                    "name": "-A --ascii",
                    "content": "invokes the Report Identifying Information command and if anything is found interprets\nit as ASCII (or UTF-8 which is locale dependent) and prints the information to stdout.\n",
                    "flag": "-A",
                    "long": "--ascii"
                },
                {
                    "name": "-C --clear",
                    "content": "invokes the Set Identifying Information command with an information  length  of  zero.\nThis has the effect of clearing the existing information.\n",
                    "flag": "-C",
                    "long": "--clear"
                },
                {
                    "name": "-h --help",
                    "content": "output the usage message then exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-i --itype",
                    "content": "where  IT is the information type. Defaults to zero. The maximum value is 127 which is\nspecial and cannot be used with --set or --clear. The information type of 127 (if sup‐\nported) causes the REPORT IDENTIFYING INFORMATION command to respond with  a  list  of\navailable  information  types and their maximum lengths in bytes. The odd numbered in‐\nformation types between 3 and 125 (inclusive) are not to be used (as they  clash  with\nthe SCC-2 standard).\n",
                    "flag": "-i",
                    "long": "--itype"
                },
                {
                    "name": "-r --raw",
                    "content": "invokes  the Report Identifying information command and if anything is found sends the\ninformation (which may be binary) to stdout. Nothing else is sent  to  stdout  however\nerror reports, if any, are sent to stderr.\n",
                    "flag": "-r",
                    "long": "--raw"
                },
                {
                    "name": "-S --set",
                    "content": "first  reads  stdin until an EOF is detected then invokes the Set Identifying Informa‐\ntion command to set what has been fetched from stdin as the information. The amount of\ndata read must be between 1 and 512 bytes length (inclusive).\n",
                    "flag": "-S",
                    "long": "--set"
                },
                {
                    "name": "-v --verbose",
                    "content": "increase the level of verbosity, (i.e. debug output).\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-V --version",
                    "content": "print the version string and then exit.\n\nThis utility permits users to write their own identifying information to their SCSI  devices.\nThere  are  several  other types of descriptors (or designators) that the user cannot change.\nThese include the SCSI INQUIRY command with its standard vendor  and  product  identification\nstrings  and the product revision level; plus the large amount of information provided by the\n\"Device Identification\" VPD page (see sgvpd). There is also the  READ  MEDIA  SERIAL  NUMBER\ncommand (see sgrmsn). The MMC-4 command set for CD and DVDs has a \"media serial number\" fea‐\nture  (0x109)  [and  a  \"logical  unit  serial number\" feature]. These can be viewed with the\nsggetconfig utility.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "EXAMPLES": {
            "content": "First, to see if there is an existing information whose format is  unknown  (for  information\ntype 0), use no options:\n\n# sgident /dev/sdb\n00     31 32 33 34 35 36 37 38  39 30          1234567890\n\nIf it is ASCII then it can printed as such:\n\n# sgident --ascii /dev/sdb\n1234567890\n\nThe information can be copied to a file, cleared and then re-asserted with this sequence:\n\n# sgident --raw /dev/sdb > t\n# sgident --clear /dev/sdb\n# cat t | sgident --set /dev/sdb\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "The  exit  status  of sgident is 0 when it is successful. Otherwise see the sg3utils(8) man\npage.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Written by Douglas Gilbert.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "Report bugs to <dgilbert at interlog dot com>.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2005-2018 Douglas Gilbert\nThis software is distributed under a FreeBSD license. There is NO warranty; not even for MER‐\nCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "",
            "subsections": [
                {
                    "name": "sg_vpd(sg3_utils), sg_rmsn(sg3_utils), sg_get_config(sg3_utils)",
                    "content": "sg3utils-1.43                               August 2018                                 SGIDENT(8)"
                }
            ]
        }
    },
    "summary": "sgident - send SCSI REPORT/SET IDENTIFYING INFORMATION command",
    "flags": [
        {
            "flag": "-A",
            "long": "--ascii",
            "arg": null,
            "description": "invokes the Report Identifying Information command and if anything is found interprets it as ASCII (or UTF-8 which is locale dependent) and prints the information to stdout."
        },
        {
            "flag": "-C",
            "long": "--clear",
            "arg": null,
            "description": "invokes the Set Identifying Information command with an information length of zero. This has the effect of clearing the existing information."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "output the usage message then exit."
        },
        {
            "flag": "-i",
            "long": "--itype",
            "arg": null,
            "description": "where IT is the information type. Defaults to zero. The maximum value is 127 which is special and cannot be used with --set or --clear. The information type of 127 (if sup‐ ported) causes the REPORT IDENTIFYING INFORMATION command to respond with a list of available information types and their maximum lengths in bytes. The odd numbered in‐ formation types between 3 and 125 (inclusive) are not to be used (as they clash with the SCC-2 standard)."
        },
        {
            "flag": "-r",
            "long": "--raw",
            "arg": null,
            "description": "invokes the Report Identifying information command and if anything is found sends the information (which may be binary) to stdout. Nothing else is sent to stdout however error reports, if any, are sent to stderr."
        },
        {
            "flag": "-S",
            "long": "--set",
            "arg": null,
            "description": "first reads stdin until an EOF is detected then invokes the Set Identifying Informa‐ tion command to set what has been fetched from stdin as the information. The amount of data read must be between 1 and 512 bytes length (inclusive)."
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "increase the level of verbosity, (i.e. debug output)."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "print the version string and then exit. This utility permits users to write their own identifying information to their SCSI devices. There are several other types of descriptors (or designators) that the user cannot change. These include the SCSI INQUIRY command with its standard vendor and product identification strings and the product revision level; plus the large amount of information provided by the \"Device Identification\" VPD page (see sgvpd). There is also the READ MEDIA SERIAL NUMBER command (see sgrmsn). The MMC-4 command set for CD and DVDs has a \"media serial number\" fea‐ ture (0x109) [and a \"logical unit serial number\" feature]. These can be viewed with the sggetconfig utility."
        }
    ],
    "examples": [
        "First, to see if there is an existing information whose format is  unknown  (for  information",
        "type 0), use no options:",
        "# sgident /dev/sdb",
        "00     31 32 33 34 35 36 37 38  39 30          1234567890",
        "If it is ASCII then it can printed as such:",
        "# sgident --ascii /dev/sdb",
        "1234567890",
        "The information can be copied to a file, cleared and then re-asserted with this sequence:",
        "# sgident --raw /dev/sdb > t",
        "# sgident --clear /dev/sdb",
        "# cat t | sgident --set /dev/sdb"
    ],
    "see_also": []
}