]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/zonectl/zonectl.8
zonectl(8): Fix a few issues reported by mandoc
[FreeBSD/FreeBSD.git] / usr.sbin / zonectl / zonectl.8
1 .\"
2 .\" Copyright (c) 2015 Spectra Logic Corporation
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions, and the following disclaimer,
10 .\"    without modification.
11 .\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
12 .\"    substantially similar to the "NO WARRANTY" disclaimer below
13 .\"    ("Disclaimer") and any redistribution must be conditioned upon
14 .\"    including a substantially similar Disclaimer requirement for further
15 .\"    binary redistribution.
16 .\"
17 .\" NO WARRANTY
18 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
21 .\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 .\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGES.
29 .\"
30 .\" Authors: Ken Merry           (Spectra Logic Corporation)
31 .\"
32 .\" $FreeBSD$
33 .\"
34 .Dd May 18, 2016
35 .Dt ZONECTL 8
36 .Os
37 .Sh NAME
38 .Nm zonectl
39 .Nd Shingled Magnetic Recording Zone Control utility
40 .Sh SYNOPSIS
41 .Nm
42 .Aq Fl d Ar dev
43 .Aq Fl c Ar cmd
44 .Op Fl a
45 .Op Fl l Ar LBA
46 .Op Fl o Ar rep_opts
47 .Op Fl P Ar print_opts
48 .Sh DESCRIPTION
49 Manage
50 .Tn SCSI
51 and
52 .Tn ATA
53 Zoned Block devices.
54 This allows managing devices that conform to the
55 .Tn SCSI
56 Zoned Block Commands (ZBC) and
57 .Tn ATA
58 Zoned ATA Command Set (ZAC)
59 specifications.
60 Devices using these command sets are usually hard drives using Shingled
61 Magnetic Recording (SMR).
62 There are three types of SMR drives:
63 .Bl -tag -width 13n
64 .It Drive Managed
65 Drive Managed drives look and act just like a standard random access block
66 device, but underneath, the drive reads and writes the bulk of its capacity
67 using SMR zones.
68 Sequential writes will yield better performance, but writing sequentially
69 is not required.
70 .It Host Aware
71 Host Aware drives expose the underlying zone layout via
72 .Tn SCSI
73 or
74 .Tn ATA
75 commands and allow the host to manage the zone conditions.
76 The host is not required to manage the zones on the drive, though.
77 Sequential writes will yield better performance in Sequential Write
78 Preferred zones, but the host can write randomly in those zones.
79 .It Host Managed
80 Host Managed drives expose the underlying zone layout via
81 .Tn SCSI
82 or
83 .Tn ATA
84 commands.
85 The host is required to access the zones according to the rules described
86 by the zone layout.
87 Any commands that violate the rules will be returned with an error.
88 .El
89 .Pp
90 SMR drives are divided into zones (typically in the range of 256MB each)
91 that fall into three general categories:
92 .Bl -tag -width 20n
93 .It Conventional
94 These are also known as Non Write Pointer zones.
95 These zones can be randomly written without an unexpected performance penalty.
96 .It Sequential Preferred
97 These zones should be written sequentially starting at the write pointer
98 for the zone.
99 They may be written randomly.
100 Writes that do not conform to the zone layout may be significantly slower
101 than expected.
102 .It Sequential Required
103 These zones must be written sequentially.
104 If they are not written sequentially, starting at the write pointer, the
105 command will fail.
106 .El
107 .Bl -tag -width 12n
108 .It Fl c Ar cmd
109 Specify the zone subcommand:
110 .Bl -tag -width 6n
111 .It params
112 Display device parameters, including the type of device (Drive Managed,
113 Host Aware, Host Managed, Not Zoned), the zone commands supported, and
114 how many open zones it supports.
115 .It rz
116 Issue the Report Zones command.
117 All zones are returned by default.
118 Specify report options with
119 .Fl o
120 and printing options with
121 .Fl P .
122 Specify the starting LBA with
123 .Fl l .
124 Note that
125 .Dq reportzones
126 is also accepted as a command argument.
127 .It open
128 Explicitly open the zone specified by the starting LBA.
129 .It close
130 Close the zone specified by starting LBA.
131 .It finish
132 Finish the zone specified by the starting LBA.
133 .It rwp
134 Reset the write pointer for the zone specified by the starting LBA.
135 .El
136 .It Fl a
137 For the Open, Close, Finish, and Reset Write Pointer operations, apply the
138 operation to all zones on the drive.
139 .It Fl l Ar lba
140 Specify the starting LBA.
141 For the Report Zones command, this tells the drive to report starting with
142 the zone that starts at the given LBA.
143 For the other commands, this allows the user to identify the zone requested
144 by its starting LBA.
145 The LBA may be specified in decimal, hexadecimal or octal notation.
146 .It Fl o Ar rep_opt
147 For the Report Zones command, specify a subset of zones to report.
148 .Bl -tag -width 8n
149 .It all
150 Report all zones.
151 This is the default.
152 .It emtpy
153 Report only empty zones.
154 .It imp_open
155 Report zones that are implicitly open.
156 This means that the host has sent a write to the zone without explicitly
157 opening the zone.
158 .It exp_open
159 Report zones that are explicitly open.
160 .It closed
161 Report zones that have been closed by the host.
162 .It full
163 Report zones that are full.
164 .It ro
165 Report zones that are in the read only state.
166 Note that
167 .Dq readonly
168 is also accepted as an argument.
169 .It offline
170 Report zones that are in the offline state.
171 .It reset
172 Report zones that the device recommends should have their write pointers reset.
173 .It nonseq
174 Report zones that have the Non Sequential Resources Active flag set.
175 These are zones that are Sequential Write Preferred, but have been written
176 non-sequentially.
177 .It nonwp
178 Report Non Write Pointer zones, also known as Conventional zones.
179 .El
180 .It Fl P Ar print_opt
181 Specify a printing option for Report Zones:
182 .Bl -tag -width 7n
183 .It normal
184 Normal Report Zones output.
185 This is the default.
186 The summary and column headings are printed, fields are separated by spaces
187 and the fields themselves may contain spaces.
188 .It summary
189 Just print the summary:  the number of zones, the maximum LBA (LBA of the
190 last logical block on the drive), and the value of the
191 .Dq same
192 field.
193 The
194 .Dq same
195 field describes whether the zones on the drive are all identical, all
196 different, or whether they are the same except for the last zone, etc.
197 .It script
198 Print the zones in a script friendly format.
199 The summary and column headings are omitted, the fields are separated by
200 commas, and the fields do not contain spaces.
201 The fields contain underscores where spaces would normally be used.
202 .El
203 .El
204 .Sh EXAMPLES
205 .Bd -literal -offset indent
206 zonectl -d /dev/da5 -c params
207 .Ed
208 .Pp
209 Display basic zoning information for disk da5.
210 .Bd -literal -offset indent
211 zonectl -d /dev/da5 -c rz
212 .Ed
213 .Pp
214 Issue the Report Zones command to disk da5, and print out all
215 zones on the drive in the default format.
216 .Bd -literal -offset indent
217 zonectl -d /dev/da5 -c rz -o reset -P script
218 .Ed
219 .Pp
220 Issue the Report Zones command to disk da5, and print out all
221 of the zones that have the Reset Write Pointer Recommended bit set to true.
222 Print the zones in a script friendly form.
223 .Bd -literal -offset indent
224 zonectl -d /dev/da5 -c rwp -l 0x2c80000
225 .Ed
226 .Pp
227 Issue the Reset Write Pointer command to disk da5 for the zone
228 that starts at LBA 0x2c80000.
229 .Sh AUTHORS
230 .An Kenneth Merry Aq ken@FreeBSD.org