xref: /freebsd/usr.sbin/zonectl/zonectl.8 (revision 28b475b01832af786f3bbd2aafec9caf121b9ca8)
19a6844d5SKenneth D. Merry.\"
29a6844d5SKenneth D. Merry.\" Copyright (c) 2015 Spectra Logic Corporation
39a6844d5SKenneth D. Merry.\" All rights reserved.
49a6844d5SKenneth D. Merry.\"
59a6844d5SKenneth D. Merry.\" Redistribution and use in source and binary forms, with or without
69a6844d5SKenneth D. Merry.\" modification, are permitted provided that the following conditions
79a6844d5SKenneth D. Merry.\" are met:
89a6844d5SKenneth D. Merry.\" 1. Redistributions of source code must retain the above copyright
99a6844d5SKenneth D. Merry.\"    notice, this list of conditions, and the following disclaimer,
109a6844d5SKenneth D. Merry.\"    without modification.
119a6844d5SKenneth D. Merry.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
129a6844d5SKenneth D. Merry.\"    substantially similar to the "NO WARRANTY" disclaimer below
139a6844d5SKenneth D. Merry.\"    ("Disclaimer") and any redistribution must be conditioned upon
149a6844d5SKenneth D. Merry.\"    including a substantially similar Disclaimer requirement for further
159a6844d5SKenneth D. Merry.\"    binary redistribution.
169a6844d5SKenneth D. Merry.\"
179a6844d5SKenneth D. Merry.\" NO WARRANTY
189a6844d5SKenneth D. Merry.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
199a6844d5SKenneth D. Merry.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
209a6844d5SKenneth D. Merry.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
219a6844d5SKenneth D. Merry.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
229a6844d5SKenneth D. Merry.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
239a6844d5SKenneth D. Merry.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
249a6844d5SKenneth D. Merry.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
259a6844d5SKenneth D. Merry.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
269a6844d5SKenneth D. Merry.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
279a6844d5SKenneth D. Merry.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
289a6844d5SKenneth D. Merry.\" POSSIBILITY OF SUCH DAMAGES.
299a6844d5SKenneth D. Merry.\"
309a6844d5SKenneth D. Merry.\" Authors: Ken Merry           (Spectra Logic Corporation)
319a6844d5SKenneth D. Merry.\"
329a6844d5SKenneth D. Merry.\" $FreeBSD$
338ef23578SGordon Bergling.\"
349a6844d5SKenneth D. Merry.Dd May 18, 2016
359a6844d5SKenneth D. Merry.Dt ZONECTL 8
369a6844d5SKenneth D. Merry.Os
379a6844d5SKenneth D. Merry.Sh NAME
389a6844d5SKenneth D. Merry.Nm zonectl
399a6844d5SKenneth D. Merry.Nd Shingled Magnetic Recording Zone Control utility
409a6844d5SKenneth D. Merry.Sh SYNOPSIS
419a6844d5SKenneth D. Merry.Nm
429a6844d5SKenneth D. Merry.Aq Fl d Ar dev
439a6844d5SKenneth D. Merry.Aq Fl c Ar cmd
449a6844d5SKenneth D. Merry.Op Fl a
459a6844d5SKenneth D. Merry.Op Fl l Ar LBA
469a6844d5SKenneth D. Merry.Op Fl o Ar rep_opts
479a6844d5SKenneth D. Merry.Op Fl P Ar print_opts
489a6844d5SKenneth D. Merry.Sh DESCRIPTION
499a6844d5SKenneth D. MerryManage
509a6844d5SKenneth D. Merry.Tn SCSI
519a6844d5SKenneth D. Merryand
529a6844d5SKenneth D. Merry.Tn ATA
539a6844d5SKenneth D. MerryZoned Block devices.
549a6844d5SKenneth D. MerryThis allows managing devices that conform to the
559a6844d5SKenneth D. Merry.Tn SCSI
569a6844d5SKenneth D. MerryZoned Block Commands (ZBC) and
579a6844d5SKenneth D. Merry.Tn ATA
589a6844d5SKenneth D. MerryZoned ATA Command Set (ZAC)
599a6844d5SKenneth D. Merryspecifications.
609a6844d5SKenneth D. MerryDevices using these command sets are usually hard drives using Shingled
619a6844d5SKenneth D. MerryMagnetic Recording (SMR).
629a6844d5SKenneth D. MerryThere are three types of SMR drives:
639a6844d5SKenneth D. Merry.Bl -tag -width 13n
649a6844d5SKenneth D. Merry.It Drive Managed
659a6844d5SKenneth D. MerryDrive Managed drives look and act just like a standard random access block
669a6844d5SKenneth D. Merrydevice, but underneath, the drive reads and writes the bulk of its capacity
679a6844d5SKenneth D. Merryusing SMR zones.
689a6844d5SKenneth D. MerrySequential writes will yield better performance, but writing sequentially
699a6844d5SKenneth D. Merryis not required.
709a6844d5SKenneth D. Merry.It Host Aware
719a6844d5SKenneth D. MerryHost Aware drives expose the underlying zone layout via
729a6844d5SKenneth D. Merry.Tn SCSI
739a6844d5SKenneth D. Merryor
749a6844d5SKenneth D. Merry.Tn ATA
759a6844d5SKenneth D. Merrycommands and allow the host to manage the zone conditions.
769a6844d5SKenneth D. MerryThe host is not required to manage the zones on the drive, though.
779a6844d5SKenneth D. MerrySequential writes will yield better performance in Sequential Write
789a6844d5SKenneth D. MerryPreferred zones, but the host can write randomly in those zones.
799a6844d5SKenneth D. Merry.It Host Managed
809a6844d5SKenneth D. MerryHost Managed drives expose the underlying zone layout via
819a6844d5SKenneth D. Merry.Tn SCSI
829a6844d5SKenneth D. Merryor
839a6844d5SKenneth D. Merry.Tn ATA
849a6844d5SKenneth D. Merrycommands.
859a6844d5SKenneth D. MerryThe host is required to access the zones according to the rules described
869a6844d5SKenneth D. Merryby the zone layout.
879a6844d5SKenneth D. MerryAny commands that violate the rules will be returned with an error.
889a6844d5SKenneth D. Merry.El
899a6844d5SKenneth D. Merry.Pp
909a6844d5SKenneth D. MerrySMR drives are divided into zones (typically in the range of 256MB each)
919a6844d5SKenneth D. Merrythat fall into three general categories:
929a6844d5SKenneth D. Merry.Bl -tag -width 20n
939a6844d5SKenneth D. Merry.It Conventional
949a6844d5SKenneth D. MerryThese are also known as Non Write Pointer zones.
959a6844d5SKenneth D. MerryThese zones can be randomly written without an unexpected performance penalty.
969a6844d5SKenneth D. Merry.It Sequential Preferred
979a6844d5SKenneth D. MerryThese zones should be written sequentially starting at the write pointer
989a6844d5SKenneth D. Merryfor the zone.
999a6844d5SKenneth D. MerryThey may be written randomly.
1009a6844d5SKenneth D. MerryWrites that do not conform to the zone layout may be significantly slower
1019a6844d5SKenneth D. Merrythan expected.
1029a6844d5SKenneth D. Merry.It Sequential Required
1039a6844d5SKenneth D. MerryThese zones must be written sequentially.
1049a6844d5SKenneth D. MerryIf they are not written sequentially, starting at the write pointer, the
1059a6844d5SKenneth D. Merrycommand will fail.
1069a6844d5SKenneth D. Merry.El
1079a6844d5SKenneth D. Merry.Bl -tag -width 12n
1089a6844d5SKenneth D. Merry.It Fl c Ar cmd
1099a6844d5SKenneth D. MerrySpecify the zone subcommand:
1109a6844d5SKenneth D. Merry.Bl -tag -width 6n
1119a6844d5SKenneth D. Merry.It params
1129a6844d5SKenneth D. MerryDisplay device parameters, including the type of device (Drive Managed,
1139a6844d5SKenneth D. MerryHost Aware, Host Managed, Not Zoned), the zone commands supported, and
1149a6844d5SKenneth D. Merryhow many open zones it supports.
1159a6844d5SKenneth D. Merry.It rz
1169a6844d5SKenneth D. MerryIssue the Report Zones command.
1179a6844d5SKenneth D. MerryAll zones are returned by default.
1189a6844d5SKenneth D. MerrySpecify report options with
1199a6844d5SKenneth D. Merry.Fl o
1209a6844d5SKenneth D. Merryand printing options with
1219a6844d5SKenneth D. Merry.Fl P .
1229a6844d5SKenneth D. MerrySpecify the starting LBA with
1239a6844d5SKenneth D. Merry.Fl l .
1249a6844d5SKenneth D. MerryNote that
1259a6844d5SKenneth D. Merry.Dq reportzones
1269a6844d5SKenneth D. Merryis also accepted as a command argument.
1279a6844d5SKenneth D. Merry.It open
1289a6844d5SKenneth D. MerryExplicitly open the zone specified by the starting LBA.
1299a6844d5SKenneth D. Merry.It close
1309a6844d5SKenneth D. MerryClose the zone specified by starting LBA.
1319a6844d5SKenneth D. Merry.It finish
1329a6844d5SKenneth D. MerryFinish the zone specified by the starting LBA.
1339a6844d5SKenneth D. Merry.It rwp
1349a6844d5SKenneth D. MerryReset the write pointer for the zone specified by the starting LBA.
1359a6844d5SKenneth D. Merry.El
1369a6844d5SKenneth D. Merry.It Fl a
1379a6844d5SKenneth D. MerryFor the Open, Close, Finish, and Reset Write Pointer operations, apply the
1389a6844d5SKenneth D. Merryoperation to all zones on the drive.
1399a6844d5SKenneth D. Merry.It Fl l Ar lba
1409a6844d5SKenneth D. MerrySpecify the starting LBA.
1419a6844d5SKenneth D. MerryFor the Report Zones command, this tells the drive to report starting with
1429a6844d5SKenneth D. Merrythe zone that starts at the given LBA.
1439a6844d5SKenneth D. MerryFor the other commands, this allows the user to identify the zone requested
1449a6844d5SKenneth D. Merryby its starting LBA.
1459a6844d5SKenneth D. MerryThe LBA may be specified in decimal, hexadecimal or octal notation.
1469a6844d5SKenneth D. Merry.It Fl o Ar rep_opt
1479a6844d5SKenneth D. MerryFor the Report Zones command, specify a subset of zones to report.
1489a6844d5SKenneth D. Merry.Bl -tag -width 8n
1499a6844d5SKenneth D. Merry.It all
1509a6844d5SKenneth D. MerryReport all zones.
1519a6844d5SKenneth D. MerryThis is the default.
1529a6844d5SKenneth D. Merry.It emtpy
1539a6844d5SKenneth D. MerryReport only empty zones.
1549a6844d5SKenneth D. Merry.It imp_open
1559a6844d5SKenneth D. MerryReport zones that are implicitly open.
1569a6844d5SKenneth D. MerryThis means that the host has sent a write to the zone without explicitly
1579a6844d5SKenneth D. Merryopening the zone.
1589a6844d5SKenneth D. Merry.It exp_open
1599a6844d5SKenneth D. MerryReport zones that are explicitly open.
1609a6844d5SKenneth D. Merry.It closed
1619a6844d5SKenneth D. MerryReport zones that have been closed by the host.
1629a6844d5SKenneth D. Merry.It full
1639a6844d5SKenneth D. MerryReport zones that are full.
1649a6844d5SKenneth D. Merry.It ro
1659a6844d5SKenneth D. MerryReport zones that are in the read only state.
1669a6844d5SKenneth D. MerryNote that
1679a6844d5SKenneth D. Merry.Dq readonly
1689a6844d5SKenneth D. Merryis also accepted as an argument.
1699a6844d5SKenneth D. Merry.It offline
1709a6844d5SKenneth D. MerryReport zones that are in the offline state.
1719a6844d5SKenneth D. Merry.It reset
1729a6844d5SKenneth D. MerryReport zones that the device recommends should have their write pointers reset.
1739a6844d5SKenneth D. Merry.It nonseq
1749a6844d5SKenneth D. MerryReport zones that have the Non Sequential Resources Active flag set.
1759a6844d5SKenneth D. MerryThese are zones that are Sequential Write Preferred, but have been written
1769a6844d5SKenneth D. Merrynon-sequentially.
1779a6844d5SKenneth D. Merry.It nonwp
1789a6844d5SKenneth D. MerryReport Non Write Pointer zones, also known as Conventional zones.
1799a6844d5SKenneth D. Merry.El
1809a6844d5SKenneth D. Merry.It Fl P Ar print_opt
1819a6844d5SKenneth D. MerrySpecify a printing option for Report Zones:
1829a6844d5SKenneth D. Merry.Bl -tag -width 7n
1839a6844d5SKenneth D. Merry.It normal
1849a6844d5SKenneth D. MerryNormal Report Zones output.
1859a6844d5SKenneth D. MerryThis is the default.
1869a6844d5SKenneth D. MerryThe summary and column headings are printed, fields are separated by spaces
1879a6844d5SKenneth D. Merryand the fields themselves may contain spaces.
1889a6844d5SKenneth D. Merry.It summary
1899a6844d5SKenneth D. MerryJust print the summary:  the number of zones, the maximum LBA (LBA of the
1909a6844d5SKenneth D. Merrylast logical block on the drive), and the value of the
1919a6844d5SKenneth D. Merry.Dq same
1929a6844d5SKenneth D. Merryfield.
1939a6844d5SKenneth D. MerryThe
1949a6844d5SKenneth D. Merry.Dq same
1959a6844d5SKenneth D. Merryfield describes whether the zones on the drive are all identical, all
1969a6844d5SKenneth D. Merrydifferent, or whether they are the same except for the last zone, etc.
1979a6844d5SKenneth D. Merry.It script
1989a6844d5SKenneth D. MerryPrint the zones in a script friendly format.
1999a6844d5SKenneth D. MerryThe summary and column headings are omitted, the fields are separated by
2009a6844d5SKenneth D. Merrycommas, and the fields do not contain spaces.
2019a6844d5SKenneth D. MerryThe fields contain underscores where spaces would normally be used.
2029a6844d5SKenneth D. Merry.El
2039a6844d5SKenneth D. Merry.El
2049a6844d5SKenneth D. Merry.Sh EXAMPLES
2059a6844d5SKenneth D. Merry.Bd -literal -offset indent
2069a6844d5SKenneth D. Merryzonectl -d /dev/da5 -c params
2079a6844d5SKenneth D. Merry.Ed
2089a6844d5SKenneth D. Merry.Pp
2099a6844d5SKenneth D. MerryDisplay basic zoning information for disk da5.
2109a6844d5SKenneth D. Merry.Bd -literal -offset indent
2119a6844d5SKenneth D. Merryzonectl -d /dev/da5 -c rz
2129a6844d5SKenneth D. Merry.Ed
2139a6844d5SKenneth D. Merry.Pp
2149a6844d5SKenneth D. MerryIssue the Report Zones command to disk da5, and print out all
2159a6844d5SKenneth D. Merryzones on the drive in the default format.
2169a6844d5SKenneth D. Merry.Bd -literal -offset indent
2179a6844d5SKenneth D. Merryzonectl -d /dev/da5 -c rz -o reset -P script
2189a6844d5SKenneth D. Merry.Ed
2199a6844d5SKenneth D. Merry.Pp
2209a6844d5SKenneth D. MerryIssue the Report Zones command to disk da5, and print out all
2219a6844d5SKenneth D. Merryof the zones that have the Reset Write Pointer Recommended bit set to true.
2229a6844d5SKenneth D. MerryPrint the zones in a script friendly form.
2239a6844d5SKenneth D. Merry.Bd -literal -offset indent
2249a6844d5SKenneth D. Merryzonectl -d /dev/da5 -c rwp -l 0x2c80000
2259a6844d5SKenneth D. Merry.Ed
2269a6844d5SKenneth D. Merry.Pp
2279a6844d5SKenneth D. MerryIssue the Reset Write Pointer command to disk da5 for the zone
2289a6844d5SKenneth D. Merrythat starts at LBA 0x2c80000.
229*28b475b0SEdward Tomasz Napierala.Sh SEE ALSO
230*28b475b0SEdward Tomasz Napierala.Xr camcontrol 8
2319a6844d5SKenneth D. Merry.Sh AUTHORS
2329a6844d5SKenneth D. Merry.An Kenneth Merry Aq ken@FreeBSD.org
233