SG_ZONE(8)
π SG_ZONE(8) β like, the sg3_utils zone-modifying era
okay bestie so real quick: this is the SG_ZONE(8) page from the sg3_utils fam. sit down, hydrate, and let's get into it π«Ά
β¨ NAME β¨
sg_zone β sends a SCSI ZONE modifying command. that's the whole vibe. it pokes zones. slay.
π¦ SYNOPSIS π¦
sg_zone [--all] [--close] [--count=ZC] [--element=EID] [--finish]
[--help] [--open] [--remove] [--sequentialize] [--timeout=SE]
[--verbose] [--version] [--zone=ID] DEVICE
πΈ DESCRIPTION πΈ
so what this icon actually does: it sends one of these SCSI commands to DEVICE:
- OPEN ZONE
- CLOSE ZONE
- FINISH ZONE
- REMOVE ELEMENT AND MODIFY ZONES
- SEQUENTIALIZE ZONE
all but the last two live in the ZBC standard (INCITS 536-2016), no cap. the REMOVE ELEMENT AND MODIFY ZONES command was added in zbc2r07, and the SEQUENTIALIZE ZONE command got added in zbc2r01b. glow-up history fr.
β οΈ okay this part is important: one and only one of the--open,--close,--finish,--removeand--sequentializeoptions can be chosen. pick ONE. this is not a build-your-own-combo situation π
and since we're being all organized here β the REPORT ZONES, REPORT REALMS and REPORT ZONE DOMAINS commands? those are accessible via the sg_rep_zones utility. the ZONE ACTIVATE and ZONE QUERY commands? those live over in sg_z_act_query. and the RESET WRITE POINTER command? that's sg_reset_wp, bestie. we stan a modular ecosystem β¨
π OPTIONS π
heads up, bestie: arguments to long options are mandatory for short options as well. iykyk.
-a,--allβ sets the ALL field in the cdb. that's it. that's the whole thing π-c,--closeβ causes the CLOSE ZONE command to be sent to theDEVICE.-C,--count=ZCβZCgets placed in the Zone Count field in the cdb of all four commands supported by this utility.ZCshould be a value from 0 to 65535 (0xffff) inclusive. keep it in range, queen.-e,--element=EIDβ whereEIDis an element identifier, which is a 32 bit unsigned integer starting at one. this field is used by the REMOVE ELEMENT AND MODIFY ZONES command, and its default value is zero β which is, lowkey, invalid π so like, the user needs to supply a valid element identifier when--removeis used. no validEID, no party.-f,--finishβ causes the FINISH ZONE command to be sent to theDEVICE.-h,--helpβ output the usage message then exit. classic.-o,--openβ causes the OPEN ZONE command to be sent to theDEVICE.-r,--removeβ causes the REMOVE ELEMENT AND MODIFY ZONES command to be sent to theDEVICE. in practice,--element=EIDneeds to be also given. so like, don't forget it π-S,--sequentializeβ causes the SEQUENTIALIZE ZONE command to be sent to theDEVICE.-t,--timeout=SEβ whereSEis the command timeout in seconds. the default is 60 seconds, and if0is given, it is mapped to 60. there's also an alternate form:--tmo=SE. same energy, different spelling π-v,--verboseβ increase the level of verbosity, (i.e. debug output). the more the merrier, honestly.-V,--versionβ print the version string and then exit.-z,--zone=IDβ whereIDis placed in the cdb's ZONE ID field. a zone id is a zone start logical block address (LBA). the default value is 0.IDis assumed to be in decimal unless prefixed with'0x'or has a trailing'h'which indicate hexadecimal. math girlie behavior β¨
π NOTES π
so after a REMOVE ELEMENT AND MODIFY ZONES command has completed, the element in question is said to be depopulated, and any affected zones are placed in the 'offline' zone condition. okay? okay.
SBC-4 has a similar command to REMOVE ELEMENT AND MODIFY ZONES called REMOVE ELEMENT AND TRUNCATE. the difference? the latter "changes the association between LBAs and physical blocks" and the former does not change that association. literally the one distinguishing detail and it matters.
in both cases, depopulated elements that have the 'Restoration Allowed' (RALWD) bit set (see sg_get_elem_status) may be restored with the RESTORE ELEMENTS AND REBUILD command β see the sg_rem_rest_elem utility. and plot twist: the sg_rem_rest_elem utility can also issue the REMOVE ELEMENT AND MODIFY ZONES command with its --modify option. multi-talented fr fr π
β EXIT STATUS β
the exit status of sg_zone is 0 when it is successful. otherwise, see the sg3_utils(8) man page. simple as that π¦
π AUTHORS π
Written by Douglas Gilbert. the icon who wrote it. we thank him for his service π«Ά
π REPORTING BUGS π
Report bugs to <dgilbert at interlog dot com>. be nice about it please π
π§ COPYRIGHT π§
Copyright Β© 2014-2026 Douglas Gilbert
This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. like, none. zero. nada. don't come for them if it breaks π
π₯ SEE ALSO π₯
sg_rem_rest_elem, sg_rep_zones, sg_reset_wp, sg_z_act_query (all in sg3_utils)
and that's the page, bestie π this whole thing is SG_ZONE(8) from sg3_utils-1.49, dated 2026-07-01. go forth and modify some zones responsibly, mwah πβ¨
π¦ where this page comes from
- arch rolling: sg3_utils 1.49-1 Β· GPL-2.0-or-later AND BSD-2-Clause
- nixpkgs unstable: sg3_utils 1.49
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms