{
    "mode": "man",
    "parameter": "sg_rmsn",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/sg_rmsn/8/json",
    "generated": "2026-06-16T10:12:12Z",
    "synopsis": "sgrmsn [--help] [--raw] [--readonly] [--verbose] [--version] DEVICE",
    "sections": {
        "NAME": {
            "content": "sgrmsn - send SCSI READ MEDIA SERIAL NUMBER command\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sgrmsn [--help] [--raw] [--readonly] [--verbose] [--version] DEVICE\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Send a SCSI READ MEDIA SERIAL NUMBER command to DEVICE and outputs the response.\n\nThis command is described in SPC-3 found at www.t10.org . It was originally added to SPC-3 in\nrevision 11 (2003/2/12). It is not an mandatory command and the author has not seen any  SCSI\ndevices that support it.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "Arguments to long options are mandatory for short options as well.\n",
            "subsections": [
                {
                    "name": "-h --help",
                    "content": "output the usage message then exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-r --raw",
                    "content": "sends  the  serial  number (if found) to stdout. This output may contain non-printable\ncharacters (e.g. the serial number is padded with NULLs at the end so its length is  a\nmultiple of 4). The default action is to print the serial number out in ASCII-HEX with\nASCII characters to the right. All error messages are sent to stderr.\n",
                    "flag": "-r",
                    "long": "--raw"
                },
                {
                    "name": "-R --readonly",
                    "content": "opens the DEVICE read-only rather than read-write which is the default. The  Linux  sg\ndriver needs read-write access for the SCSI READ MEDIA SERIAL NUMBER command but other\naccess methods may require read-only access.\n",
                    "flag": "-R",
                    "long": "--readonly"
                },
                {
                    "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",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "NOTES": {
            "content": "Device identification information is also found in a standard INQUIRY response  and  its  VPD\npages  (see  sgvpd).  The  relevant VPD pages are the \"device identification page\" (VPD page\n0x83) and the \"unit serial number\" page (VPD page 0x80).\n\nThe MMC-4 command set for CD/DVD/HD-DVD/BD drives has a \"media serial number\" feature (0x109)\n[and a \"logical unit serial number\" feature]. These can be viewed with sggetconfig.\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "The  exit  status  of  sgrmsn 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-2012 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": "sgvpd(sg3utils), sggetconfig(sg3utils)\n\n\n\nsg3utils-1.31                              November 2012                                 SGRMSN(8)",
            "subsections": []
        }
    },
    "summary": "sgrmsn - send SCSI READ MEDIA SERIAL NUMBER command",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "output the usage message then exit."
        },
        {
            "flag": "-r",
            "long": "--raw",
            "arg": null,
            "description": "sends the serial number (if found) to stdout. This output may contain non-printable characters (e.g. the serial number is padded with NULLs at the end so its length is a multiple of 4). The default action is to print the serial number out in ASCII-HEX with ASCII characters to the right. All error messages are sent to stderr."
        },
        {
            "flag": "-R",
            "long": "--readonly",
            "arg": null,
            "description": "opens the DEVICE read-only rather than read-write which is the default. The Linux sg driver needs read-write access for the SCSI READ MEDIA SERIAL NUMBER command but other access methods may require read-only access."
        },
        {
            "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."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "sgvpd",
            "section": "sg3utils",
            "url": "https://www.chedong.com/phpMan.php/man/sgvpd/sg3utils/json"
        },
        {
            "name": "sggetconfig",
            "section": "sg3utils",
            "url": "https://www.chedong.com/phpMan.php/man/sggetconfig/sg3utils/json"
        }
    ]
}