xref: /freebsd/usr.sbin/zonectl/zonectl.8 (revision 5ef49c7820d3d79404a28d182ab8401866dfd751)
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.Dd May 18, 2016
339a6844d5SKenneth D. Merry.Dt ZONECTL 8
349a6844d5SKenneth D. Merry.Os
359a6844d5SKenneth D. Merry.Sh NAME
369a6844d5SKenneth D. Merry.Nm zonectl
379a6844d5SKenneth D. Merry.Nd Shingled Magnetic Recording Zone Control utility
389a6844d5SKenneth D. Merry.Sh SYNOPSIS
399a6844d5SKenneth D. Merry.Nm
409a6844d5SKenneth D. Merry.Aq Fl d Ar dev
419a6844d5SKenneth D. Merry.Aq Fl c Ar cmd
429a6844d5SKenneth D. Merry.Op Fl a
439a6844d5SKenneth D. Merry.Op Fl l Ar LBA
449a6844d5SKenneth D. Merry.Op Fl o Ar rep_opts
459a6844d5SKenneth D. Merry.Op Fl P Ar print_opts
469a6844d5SKenneth D. Merry.Sh DESCRIPTION
479a6844d5SKenneth D. MerryManage
489a6844d5SKenneth D. Merry.Tn SCSI
499a6844d5SKenneth D. Merryand
509a6844d5SKenneth D. Merry.Tn ATA
519a6844d5SKenneth D. MerryZoned Block devices.
529a6844d5SKenneth D. MerryThis allows managing devices that conform to the
539a6844d5SKenneth D. Merry.Tn SCSI
549a6844d5SKenneth D. MerryZoned Block Commands (ZBC) and
559a6844d5SKenneth D. Merry.Tn ATA
569a6844d5SKenneth D. MerryZoned ATA Command Set (ZAC)
579a6844d5SKenneth D. Merryspecifications.
589a6844d5SKenneth D. MerryDevices using these command sets are usually hard drives using Shingled
599a6844d5SKenneth D. MerryMagnetic Recording (SMR).
609a6844d5SKenneth D. MerryThere are three types of SMR drives:
619a6844d5SKenneth D. Merry.Bl -tag -width 13n
629a6844d5SKenneth D. Merry.It Drive Managed
639a6844d5SKenneth D. MerryDrive Managed drives look and act just like a standard random access block
649a6844d5SKenneth D. Merrydevice, but underneath, the drive reads and writes the bulk of its capacity
659a6844d5SKenneth D. Merryusing SMR zones.
669a6844d5SKenneth D. MerrySequential writes will yield better performance, but writing sequentially
679a6844d5SKenneth D. Merryis not required.
689a6844d5SKenneth D. Merry.It Host Aware
699a6844d5SKenneth D. MerryHost Aware drives expose the underlying zone layout via
709a6844d5SKenneth D. Merry.Tn SCSI
719a6844d5SKenneth D. Merryor
729a6844d5SKenneth D. Merry.Tn ATA
739a6844d5SKenneth D. Merrycommands and allow the host to manage the zone conditions.
749a6844d5SKenneth D. MerryThe host is not required to manage the zones on the drive, though.
759a6844d5SKenneth D. MerrySequential writes will yield better performance in Sequential Write
769a6844d5SKenneth D. MerryPreferred zones, but the host can write randomly in those zones.
779a6844d5SKenneth D. Merry.It Host Managed
789a6844d5SKenneth D. MerryHost Managed drives expose the underlying zone layout via
799a6844d5SKenneth D. Merry.Tn SCSI
809a6844d5SKenneth D. Merryor
819a6844d5SKenneth D. Merry.Tn ATA
829a6844d5SKenneth D. Merrycommands.
839a6844d5SKenneth D. MerryThe host is required to access the zones according to the rules described
849a6844d5SKenneth D. Merryby the zone layout.
859a6844d5SKenneth D. MerryAny commands that violate the rules will be returned with an error.
869a6844d5SKenneth D. Merry.El
879a6844d5SKenneth D. Merry.Pp
889a6844d5SKenneth D. MerrySMR drives are divided into zones (typically in the range of 256MB each)
899a6844d5SKenneth D. Merrythat fall into three general categories:
909a6844d5SKenneth D. Merry.Bl -tag -width 20n
919a6844d5SKenneth D. Merry.It Conventional
929a6844d5SKenneth D. MerryThese are also known as Non Write Pointer zones.
939a6844d5SKenneth D. MerryThese zones can be randomly written without an unexpected performance penalty.
949a6844d5SKenneth D. Merry.It Sequential Preferred
959a6844d5SKenneth D. MerryThese zones should be written sequentially starting at the write pointer
969a6844d5SKenneth D. Merryfor the zone.
979a6844d5SKenneth D. MerryThey may be written randomly.
989a6844d5SKenneth D. MerryWrites that do not conform to the zone layout may be significantly slower
999a6844d5SKenneth D. Merrythan expected.
1009a6844d5SKenneth D. Merry.It Sequential Required
1019a6844d5SKenneth D. MerryThese zones must be written sequentially.
1029a6844d5SKenneth D. MerryIf they are not written sequentially, starting at the write pointer, the
1039a6844d5SKenneth D. Merrycommand will fail.
1049a6844d5SKenneth D. Merry.El
1059a6844d5SKenneth D. Merry.Bl -tag -width 12n
1069a6844d5SKenneth D. Merry.It Fl c Ar cmd
1079a6844d5SKenneth D. MerrySpecify the zone subcommand:
1089a6844d5SKenneth D. Merry.Bl -tag -width 6n
1099a6844d5SKenneth D. Merry.It params
1109a6844d5SKenneth D. MerryDisplay device parameters, including the type of device (Drive Managed,
1119a6844d5SKenneth D. MerryHost Aware, Host Managed, Not Zoned), the zone commands supported, and
1129a6844d5SKenneth D. Merryhow many open zones it supports.
1139a6844d5SKenneth D. Merry.It rz
1149a6844d5SKenneth D. MerryIssue the Report Zones command.
1159a6844d5SKenneth D. MerryAll zones are returned by default.
1169a6844d5SKenneth D. MerrySpecify report options with
1179a6844d5SKenneth D. Merry.Fl o
1189a6844d5SKenneth D. Merryand printing options with
1199a6844d5SKenneth D. Merry.Fl P .
1209a6844d5SKenneth D. MerrySpecify the starting LBA with
1219a6844d5SKenneth D. Merry.Fl l .
1229a6844d5SKenneth D. MerryNote that
1239a6844d5SKenneth D. Merry.Dq reportzones
1249a6844d5SKenneth D. Merryis also accepted as a command argument.
1259a6844d5SKenneth D. Merry.It open
1269a6844d5SKenneth D. MerryExplicitly open the zone specified by the starting LBA.
1279a6844d5SKenneth D. Merry.It close
1289a6844d5SKenneth D. MerryClose the zone specified by starting LBA.
1299a6844d5SKenneth D. Merry.It finish
1309a6844d5SKenneth D. MerryFinish the zone specified by the starting LBA.
1319a6844d5SKenneth D. Merry.It rwp
1329a6844d5SKenneth D. MerryReset the write pointer for the zone specified by the starting LBA.
1339a6844d5SKenneth D. Merry.El
1349a6844d5SKenneth D. Merry.It Fl a
1359a6844d5SKenneth D. MerryFor the Open, Close, Finish, and Reset Write Pointer operations, apply the
1369a6844d5SKenneth D. Merryoperation to all zones on the drive.
1379a6844d5SKenneth D. Merry.It Fl l Ar lba
1389a6844d5SKenneth D. MerrySpecify the starting LBA.
1399a6844d5SKenneth D. MerryFor the Report Zones command, this tells the drive to report starting with
1409a6844d5SKenneth D. Merrythe zone that starts at the given LBA.
1419a6844d5SKenneth D. MerryFor the other commands, this allows the user to identify the zone requested
1429a6844d5SKenneth D. Merryby its starting LBA.
1439a6844d5SKenneth D. MerryThe LBA may be specified in decimal, hexadecimal or octal notation.
1449a6844d5SKenneth D. Merry.It Fl o Ar rep_opt
1459a6844d5SKenneth D. MerryFor the Report Zones command, specify a subset of zones to report.
1469a6844d5SKenneth D. Merry.Bl -tag -width 8n
1479a6844d5SKenneth D. Merry.It all
1489a6844d5SKenneth D. MerryReport all zones.
1499a6844d5SKenneth D. MerryThis is the default.
150*5ef49c78SElyes Haouas.It empty
1519a6844d5SKenneth D. MerryReport only empty zones.
1529a6844d5SKenneth D. Merry.It imp_open
1539a6844d5SKenneth D. MerryReport zones that are implicitly open.
1549a6844d5SKenneth D. MerryThis means that the host has sent a write to the zone without explicitly
1559a6844d5SKenneth D. Merryopening the zone.
1569a6844d5SKenneth D. Merry.It exp_open
1579a6844d5SKenneth D. MerryReport zones that are explicitly open.
1589a6844d5SKenneth D. Merry.It closed
1599a6844d5SKenneth D. MerryReport zones that have been closed by the host.
1609a6844d5SKenneth D. Merry.It full
1619a6844d5SKenneth D. MerryReport zones that are full.
1629a6844d5SKenneth D. Merry.It ro
1639a6844d5SKenneth D. MerryReport zones that are in the read only state.
1649a6844d5SKenneth D. MerryNote that
1659a6844d5SKenneth D. Merry.Dq readonly
1669a6844d5SKenneth D. Merryis also accepted as an argument.
1679a6844d5SKenneth D. Merry.It offline
1689a6844d5SKenneth D. MerryReport zones that are in the offline state.
1699a6844d5SKenneth D. Merry.It reset
1709a6844d5SKenneth D. MerryReport zones that the device recommends should have their write pointers reset.
1719a6844d5SKenneth D. Merry.It nonseq
1729a6844d5SKenneth D. MerryReport zones that have the Non Sequential Resources Active flag set.
1739a6844d5SKenneth D. MerryThese are zones that are Sequential Write Preferred, but have been written
1749a6844d5SKenneth D. Merrynon-sequentially.
1759a6844d5SKenneth D. Merry.It nonwp
1769a6844d5SKenneth D. MerryReport Non Write Pointer zones, also known as Conventional zones.
1779a6844d5SKenneth D. Merry.El
1789a6844d5SKenneth D. Merry.It Fl P Ar print_opt
1799a6844d5SKenneth D. MerrySpecify a printing option for Report Zones:
1809a6844d5SKenneth D. Merry.Bl -tag -width 7n
1819a6844d5SKenneth D. Merry.It normal
1829a6844d5SKenneth D. MerryNormal Report Zones output.
1839a6844d5SKenneth D. MerryThis is the default.
1849a6844d5SKenneth D. MerryThe summary and column headings are printed, fields are separated by spaces
1859a6844d5SKenneth D. Merryand the fields themselves may contain spaces.
1869a6844d5SKenneth D. Merry.It summary
1879a6844d5SKenneth D. MerryJust print the summary:  the number of zones, the maximum LBA (LBA of the
1889a6844d5SKenneth D. Merrylast logical block on the drive), and the value of the
1899a6844d5SKenneth D. Merry.Dq same
1909a6844d5SKenneth D. Merryfield.
1919a6844d5SKenneth D. MerryThe
1929a6844d5SKenneth D. Merry.Dq same
1939a6844d5SKenneth D. Merryfield describes whether the zones on the drive are all identical, all
1949a6844d5SKenneth D. Merrydifferent, or whether they are the same except for the last zone, etc.
1959a6844d5SKenneth D. Merry.It script
1969a6844d5SKenneth D. MerryPrint the zones in a script friendly format.
1979a6844d5SKenneth D. MerryThe summary and column headings are omitted, the fields are separated by
1989a6844d5SKenneth D. Merrycommas, and the fields do not contain spaces.
1999a6844d5SKenneth D. MerryThe fields contain underscores where spaces would normally be used.
2009a6844d5SKenneth D. Merry.El
2019a6844d5SKenneth D. Merry.El
2029a6844d5SKenneth D. Merry.Sh EXAMPLES
2039a6844d5SKenneth D. Merry.Bd -literal -offset indent
2049a6844d5SKenneth D. Merryzonectl -d /dev/da5 -c params
2059a6844d5SKenneth D. Merry.Ed
2069a6844d5SKenneth D. Merry.Pp
2079a6844d5SKenneth D. MerryDisplay basic zoning information for disk da5.
2089a6844d5SKenneth D. Merry.Bd -literal -offset indent
2099a6844d5SKenneth D. Merryzonectl -d /dev/da5 -c rz
2109a6844d5SKenneth D. Merry.Ed
2119a6844d5SKenneth D. Merry.Pp
2129a6844d5SKenneth D. MerryIssue the Report Zones command to disk da5, and print out all
2139a6844d5SKenneth D. Merryzones on the drive in the default format.
2149a6844d5SKenneth D. Merry.Bd -literal -offset indent
2159a6844d5SKenneth D. Merryzonectl -d /dev/da5 -c rz -o reset -P script
2169a6844d5SKenneth D. Merry.Ed
2179a6844d5SKenneth D. Merry.Pp
2189a6844d5SKenneth D. MerryIssue the Report Zones command to disk da5, and print out all
2199a6844d5SKenneth D. Merryof the zones that have the Reset Write Pointer Recommended bit set to true.
2209a6844d5SKenneth D. MerryPrint the zones in a script friendly form.
2219a6844d5SKenneth D. Merry.Bd -literal -offset indent
2229a6844d5SKenneth D. Merryzonectl -d /dev/da5 -c rwp -l 0x2c80000
2239a6844d5SKenneth D. Merry.Ed
2249a6844d5SKenneth D. Merry.Pp
2259a6844d5SKenneth D. MerryIssue the Reset Write Pointer command to disk da5 for the zone
2269a6844d5SKenneth D. Merrythat starts at LBA 0x2c80000.
22728b475b0SEdward Tomasz Napierala.Sh SEE ALSO
22828b475b0SEdward Tomasz Napierala.Xr camcontrol 8
2299a6844d5SKenneth D. Merry.Sh AUTHORS
2309a6844d5SKenneth D. Merry.An Kenneth Merry Aq ken@FreeBSD.org
231