{
    "mode": "man",
    "parameter": "sg_rep_zones",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/sg_rep_zones/8/json",
    "generated": "2026-06-16T10:34:24Z",
    "synopsis": "sgrepzones  [--help]  [--hex]  [--maxlen=LEN]  [--num=NUM] [--partial] [--raw] [--readonly]\n[--report=OPT] [--start=LBA] [--verbose] [--version] [--wp] DEVICE",
    "sections": {
        "NAME": {
            "content": "sgrepzones - send SCSI REPORT ZONES command\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sgrepzones  [--help]  [--hex]  [--maxlen=LEN]  [--num=NUM] [--partial] [--raw] [--readonly]\n[--report=OPT] [--start=LBA] [--verbose] [--version] [--wp] DEVICE\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Sends a SCSI REPORT ZONES command to DEVICE and outputs the data returned.  This  command  is\nfound in the ZBC draft standard, revision 5 (zbc-r05.pdf).\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": "-H --hex",
                    "content": "output  the  response  in  hexadecimal to stdout. When used once the whole response is\noutput in ASCII hexadecimal with a leading address (starting at 0) on each line.  When\nused  twice  each zone descriptor in the response is output separately in hexadecimal.\nWhen used thrice the whole response is output in hexadecimal with no  leading  address\n(on each line).\n",
                    "flag": "-H",
                    "long": "--hex"
                },
                {
                    "name": "-m --maxlen",
                    "content": "where  LEN is the (maximum) response length in bytes. It is placed in the cdb's \"allo‐\ncation length\" field. If not given (or LEN is zero) then 8192 is used. The maximum al‐\nlowed value of LEN is 1048576.\n",
                    "flag": "-m",
                    "long": "--maxlen"
                },
                {
                    "name": "-n --num",
                    "content": "where NUM is the (maximum) number of zone descriptors to print out.  The default value\nis zero which is taken to mean print out all zone descriptors returned by  the  REPORT\nZONES command.\n",
                    "flag": "-n",
                    "long": "--num"
                },
                {
                    "name": "-p --partial",
                    "content": "set the PARTIAL bit in the cdb.\n",
                    "flag": "-p",
                    "long": "--partial"
                },
                {
                    "name": "-r --raw",
                    "content": "output the SCSI response (i.e. the data-out buffer) in binary (to stdout).\n",
                    "flag": "-r",
                    "long": "--raw"
                },
                {
                    "name": "-R --readonly",
                    "content": "open  the  DEVICE  read-only (e.g. in Unix with the ORDONLY flag).  The default is to\nopen it read-write.\n",
                    "flag": "-R",
                    "long": "--readonly"
                },
                {
                    "name": "-o --report",
                    "content": "where OPT will become the contents of the REPORTING OPTION field in the cdb.  The  de‐\nfault  value is 0 which means report a list of all zones.  Some other values are 1 for\nlist zones with a zone condition of empty; 2 for list zones with a zone  condition  of\nimplicitly  opened; 3 for list zones with a zone condition of explicitly opened; 4 for\nlist zones with a zone condition of closed; 5 for list zones with a zone condition  of\nfull;  6  for  list  zones with a zone condition of read only; 7 for list zones with a\nzone condition of offline. Other values are 0x10 for list zones with  RWP  recommended\nset to true; 0x11 for list zones with non-sequential write resource active set to true\nand 0x3f for list zones with a zone condition of not write pointer.\n",
                    "flag": "-o",
                    "long": "--report"
                },
                {
                    "name": "-s --start",
                    "content": "where LBA is at the start or within the first zone to be reported. The  default  value\nis 0. If LBA is not a zone start LBA then the preceding zone start LBA is used for re‐\nporting. Assumed to be in decimal unless prefixed with '0x'  or  has  a  trailing  'h'\nwhich indicate hexadecimal.\n",
                    "flag": "-s",
                    "long": "--start"
                },
                {
                    "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"
                },
                {
                    "name": "-w --wp",
                    "content": "print  the  write pointer (in hex) only. In the absence of errors, then a hex LBA will\nbe printed on each line, one line for each zone. Can be  usefully  combined  with  the\n--num=NUM and --start=LBA options.\n",
                    "flag": "-w",
                    "long": "--wp"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "The  exit  status  of sgrepzones is 0 when it is successful. Otherwise see the sg3utils(8)\nman page.\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 © 2014-2021 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": "sgresetwp,sgzone(sg3utils)\n\n\n\nsg3utils-1.46                               March 2021                              SGREPZONES(8)",
            "subsections": []
        }
    },
    "summary": "sgrepzones - send SCSI REPORT ZONES command",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "output the usage message then exit."
        },
        {
            "flag": "-H",
            "long": "--hex",
            "arg": null,
            "description": "output the response in hexadecimal to stdout. When used once the whole response is output in ASCII hexadecimal with a leading address (starting at 0) on each line. When used twice each zone descriptor in the response is output separately in hexadecimal. When used thrice the whole response is output in hexadecimal with no leading address (on each line)."
        },
        {
            "flag": "-m",
            "long": "--maxlen",
            "arg": null,
            "description": "where LEN is the (maximum) response length in bytes. It is placed in the cdb's \"allo‐ cation length\" field. If not given (or LEN is zero) then 8192 is used. The maximum al‐ lowed value of LEN is 1048576."
        },
        {
            "flag": "-n",
            "long": "--num",
            "arg": null,
            "description": "where NUM is the (maximum) number of zone descriptors to print out. The default value is zero which is taken to mean print out all zone descriptors returned by the REPORT ZONES command."
        },
        {
            "flag": "-p",
            "long": "--partial",
            "arg": null,
            "description": "set the PARTIAL bit in the cdb."
        },
        {
            "flag": "-r",
            "long": "--raw",
            "arg": null,
            "description": "output the SCSI response (i.e. the data-out buffer) in binary (to stdout)."
        },
        {
            "flag": "-R",
            "long": "--readonly",
            "arg": null,
            "description": "open the DEVICE read-only (e.g. in Unix with the ORDONLY flag). The default is to open it read-write."
        },
        {
            "flag": "-o",
            "long": "--report",
            "arg": null,
            "description": "where OPT will become the contents of the REPORTING OPTION field in the cdb. The de‐ fault value is 0 which means report a list of all zones. Some other values are 1 for list zones with a zone condition of empty; 2 for list zones with a zone condition of implicitly opened; 3 for list zones with a zone condition of explicitly opened; 4 for list zones with a zone condition of closed; 5 for list zones with a zone condition of full; 6 for list zones with a zone condition of read only; 7 for list zones with a zone condition of offline. Other values are 0x10 for list zones with RWP recommended set to true; 0x11 for list zones with non-sequential write resource active set to true and 0x3f for list zones with a zone condition of not write pointer."
        },
        {
            "flag": "-s",
            "long": "--start",
            "arg": null,
            "description": "where LBA is at the start or within the first zone to be reported. The default value is 0. If LBA is not a zone start LBA then the preceding zone start LBA is used for re‐ porting. Assumed to be in decimal unless prefixed with '0x' or has a trailing 'h' which indicate hexadecimal."
        },
        {
            "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."
        },
        {
            "flag": "-w",
            "long": "--wp",
            "arg": null,
            "description": "print the write pointer (in hex) only. In the absence of errors, then a hex LBA will be printed on each line, one line for each zone. Can be usefully combined with the --num=NUM and --start=LBA options."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "sgzone",
            "section": "sg3utils",
            "url": "https://www.chedong.com/phpMan.php/man/sgzone/sg3utils/json"
        }
    ]
}