xref: /freebsd/lib/geom/nop/gnop.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1e4b0a90eSBrooks Davis.\" Copyright (c) 2004-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
2e4b0a90eSBrooks Davis.\" All rights reserved.
3e4b0a90eSBrooks Davis.\"
4e4b0a90eSBrooks Davis.\" Redistribution and use in source and binary forms, with or without
5e4b0a90eSBrooks Davis.\" modification, are permitted provided that the following conditions
6e4b0a90eSBrooks Davis.\" are met:
7e4b0a90eSBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
8e4b0a90eSBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
9e4b0a90eSBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
10e4b0a90eSBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
11e4b0a90eSBrooks Davis.\"    documentation and/or other materials provided with the distribution.
12e4b0a90eSBrooks Davis.\"
13e4b0a90eSBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14e4b0a90eSBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15e4b0a90eSBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16e4b0a90eSBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17e4b0a90eSBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18e4b0a90eSBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19e4b0a90eSBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20e4b0a90eSBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21e4b0a90eSBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22e4b0a90eSBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23e4b0a90eSBrooks Davis.\" SUCH DAMAGE.
24e4b0a90eSBrooks Davis.\"
2580e63e0aSMariusz Zaborski.Dd December 29, 2019
26e4b0a90eSBrooks Davis.Dt GNOP 8
27e4b0a90eSBrooks Davis.Os
28e4b0a90eSBrooks Davis.Sh NAME
29e4b0a90eSBrooks Davis.Nm gnop
30e4b0a90eSBrooks Davis.Nd "control utility for NOP GEOM class"
31e4b0a90eSBrooks Davis.Sh SYNOPSIS
32e4b0a90eSBrooks Davis.Nm
33e4b0a90eSBrooks Davis.Cm create
34e4b0a90eSBrooks Davis.Op Fl v
35090a3ea3SChuck Silvers.Op Fl c Ar count_until_fail
364f80c855SMariusz Zaborski.Op Fl d Ar delaymsec
37e4b0a90eSBrooks Davis.Op Fl e Ar error
38e4b0a90eSBrooks Davis.Op Fl o Ar offset
39e4b0a90eSBrooks Davis.Op Fl p Ar stripesize
40e4b0a90eSBrooks Davis.Op Fl P Ar stripeoffset
414f80c855SMariusz Zaborski.Op Fl q Ar rdelayprob
42e4b0a90eSBrooks Davis.Op Fl r Ar rfailprob
43e4b0a90eSBrooks Davis.Op Fl s Ar size
44e4b0a90eSBrooks Davis.Op Fl S Ar secsize
45e4b0a90eSBrooks Davis.Op Fl w Ar wfailprob
464f80c855SMariusz Zaborski.Op Fl x Ar wdelayprob
47e4b0a90eSBrooks Davis.Op Fl z Ar physpath
4880e63e0aSMariusz Zaborski.Op Fl Z Ar gnopname
49e4b0a90eSBrooks Davis.Ar dev ...
50e4b0a90eSBrooks Davis.Nm
51e4b0a90eSBrooks Davis.Cm configure
52e4b0a90eSBrooks Davis.Op Fl v
53090a3ea3SChuck Silvers.Op Fl c Ar count_until_fail
544f80c855SMariusz Zaborski.Op Fl d Ar delaymsec
55e4b0a90eSBrooks Davis.Op Fl e Ar error
564f80c855SMariusz Zaborski.Op Fl q Ar rdelayprob
57e4b0a90eSBrooks Davis.Op Fl r Ar rfailprob
58e4b0a90eSBrooks Davis.Op Fl w Ar wfailprob
594f80c855SMariusz Zaborski.Op Fl x Ar wdelayprob
60e4b0a90eSBrooks Davis.Ar prov ...
61e4b0a90eSBrooks Davis.Nm
62e4b0a90eSBrooks Davis.Cm destroy
63e4b0a90eSBrooks Davis.Op Fl fv
64e4b0a90eSBrooks Davis.Ar prov ...
65e4b0a90eSBrooks Davis.Nm
66e4b0a90eSBrooks Davis.Cm reset
67e4b0a90eSBrooks Davis.Op Fl v
68e4b0a90eSBrooks Davis.Ar prov ...
69e4b0a90eSBrooks Davis.Nm
70e4b0a90eSBrooks Davis.Cm list
71e4b0a90eSBrooks Davis.Nm
72e4b0a90eSBrooks Davis.Cm status
73e4b0a90eSBrooks Davis.Nm
74e4b0a90eSBrooks Davis.Cm load
75e4b0a90eSBrooks Davis.Nm
76e4b0a90eSBrooks Davis.Cm unload
77e4b0a90eSBrooks Davis.Sh DESCRIPTION
78e4b0a90eSBrooks DavisThe
79e4b0a90eSBrooks Davis.Nm
80e4b0a90eSBrooks Davisutility is used for setting up transparent providers on existing ones.
81e4b0a90eSBrooks DavisIts main purpose is testing other GEOM classes, as it allows forced provider
82e4b0a90eSBrooks Davisremoval and I/O error simulation with a given probability.
83e4b0a90eSBrooks DavisIt also gathers statistics on the number of read, write, delete,
84e4b0a90eSBrooks Davisgetattr, flush, and other requests, and the number of bytes read and written.
85e4b0a90eSBrooks Davis.Nm
86e4b0a90eSBrooks Daviscan also be used as a good starting point for implementing new GEOM
87e4b0a90eSBrooks Davisclasses.
88e4b0a90eSBrooks Davis.Pp
89e4b0a90eSBrooks DavisThe first argument to
90e4b0a90eSBrooks Davis.Nm
91e4b0a90eSBrooks Davisindicates an action to be performed:
92e4b0a90eSBrooks Davis.Bl -tag -width ".Cm configure"
93e4b0a90eSBrooks Davis.It Cm create
94e4b0a90eSBrooks DavisSet up a transparent provider on the given devices.
95e4b0a90eSBrooks DavisIf the operation succeeds, the new provider should appear with name
96e4b0a90eSBrooks Davis.Pa /dev/ Ns Ao Ar dev Ac Ns Pa .nop .
97e4b0a90eSBrooks DavisThe kernel module
98e4b0a90eSBrooks Davis.Pa geom_nop.ko
99e4b0a90eSBrooks Daviswill be loaded if it is not loaded already.
100e4b0a90eSBrooks Davis.It Cm configure
101e4b0a90eSBrooks DavisConfigure existing transparent provider.
102e4b0a90eSBrooks DavisAt the moment it is only used for changing failure probability.
103e4b0a90eSBrooks Davis.It Cm destroy
104e4b0a90eSBrooks DavisTurn off the given transparent providers.
105e4b0a90eSBrooks Davis.It Cm reset
106e4b0a90eSBrooks DavisReset statistics for the given transparent providers.
107e4b0a90eSBrooks Davis.It Cm list
108e4b0a90eSBrooks DavisSee
109e4b0a90eSBrooks Davis.Xr geom 8 .
110e4b0a90eSBrooks Davis.It Cm status
111e4b0a90eSBrooks DavisSee
112e4b0a90eSBrooks Davis.Xr geom 8 .
113e4b0a90eSBrooks Davis.It Cm load
114e4b0a90eSBrooks DavisSee
115e4b0a90eSBrooks Davis.Xr geom 8 .
116e4b0a90eSBrooks Davis.It Cm unload
117e4b0a90eSBrooks DavisSee
118e4b0a90eSBrooks Davis.Xr geom 8 .
119e4b0a90eSBrooks Davis.El
120e4b0a90eSBrooks Davis.Pp
121e4b0a90eSBrooks DavisAdditional options:
122090a3ea3SChuck Silvers.Bl -tag -width "-c count_until_fail"
123090a3ea3SChuck Silvers.It Fl c Ar count_until_fail
124*645532a4SMariusz ZaborskiSpecifies the number of I/O requests to allow before setting the read, write and
125*645532a4SMariusz Zaborskidelay failure probabilities.
1264f80c855SMariusz Zaborski.It Fl d Ar delaymsec
1274f80c855SMariusz ZaborskiSpecifies the delay of the requests in milliseconds.
1284f80c855SMariusz ZaborskiNote that requests will be delayed before they are sent to the backing device.
129e4b0a90eSBrooks Davis.It Fl e Ar error
130e4b0a90eSBrooks DavisSpecifies the error number to return on failure.
131e4b0a90eSBrooks Davis.It Fl f
132e4b0a90eSBrooks DavisForce the removal of the specified provider.
133e4b0a90eSBrooks Davis.It Fl o Ar offset
134e4b0a90eSBrooks DavisWhere to begin on the original provider.
135e4b0a90eSBrooks Davis.It Fl p Ar stripesize
136e4b0a90eSBrooks DavisValue of the stripesize property of the transparent provider.
137e4b0a90eSBrooks Davis.It Fl P Ar stripeoffset
138e4b0a90eSBrooks DavisValue of the stripeoffset property of the transparent provider.
1394f80c855SMariusz Zaborski.It Fl q Ar rdelayprob
1404f80c855SMariusz ZaborskiSpecifies read delay probability in percent.
141e4b0a90eSBrooks Davis.It Fl r Ar rfailprob
142e4b0a90eSBrooks DavisSpecifies read failure probability in percent.
143e4b0a90eSBrooks Davis.It Fl s Ar size
144e4b0a90eSBrooks DavisSize of the transparent provider.
145e4b0a90eSBrooks Davis.It Fl S Ar secsize
146e4b0a90eSBrooks DavisSector size of the transparent provider.
147e4b0a90eSBrooks Davis.It Fl w Ar wfailprob
148e4b0a90eSBrooks DavisSpecifies write failure probability in percent.
149e4b0a90eSBrooks Davis.It Fl v
150e4b0a90eSBrooks DavisBe more verbose.
1514f80c855SMariusz Zaborski.It Fl x Ar wdelayprob
1524f80c855SMariusz ZaborskiSpecifies write delay probability in percent.
153e4b0a90eSBrooks Davis.It Fl z Ar physpath
154e4b0a90eSBrooks DavisPhysical path of the transparent provider.
15580e63e0aSMariusz Zaborski.It Fl Z Ar gnopname
15680e63e0aSMariusz ZaborskiThe name of the new provider.
15780e63e0aSMariusz ZaborskiThe suffix
15880e63e0aSMariusz Zaborski.Dq .nop
15980e63e0aSMariusz Zaborskiwill be appended to the provider name.
160e4b0a90eSBrooks Davis.El
161e4b0a90eSBrooks Davis.Sh SYSCTL VARIABLES
162e4b0a90eSBrooks DavisThe following
163e4b0a90eSBrooks Davis.Xr sysctl 8
164e4b0a90eSBrooks Davisvariables can be used to control the behavior of the
165e4b0a90eSBrooks Davis.Nm NOP
166e4b0a90eSBrooks DavisGEOM class.
167e4b0a90eSBrooks DavisThe default value is shown next to each variable.
168e4b0a90eSBrooks Davis.Bl -tag -width indent
169e4b0a90eSBrooks Davis.It Va kern.geom.nop.debug : No 0
170e4b0a90eSBrooks DavisDebug level of the
171e4b0a90eSBrooks Davis.Nm NOP
172e4b0a90eSBrooks DavisGEOM class.
173e4b0a90eSBrooks DavisThis can be set to a number between 0 and 2 inclusive.
174e4b0a90eSBrooks DavisIf set to 0, minimal debug information is printed.
175e4b0a90eSBrooks DavisIf set to 1, basic debug information is logged along with the I/O requests
176e4b0a90eSBrooks Davisthat were returned as errors.
177e4b0a90eSBrooks DavisIf set to 2, the maximum amount of debug information is printed including
178e4b0a90eSBrooks Davisall I/O requests.
179e4b0a90eSBrooks Davis.El
180e4b0a90eSBrooks Davis.Sh EXIT STATUS
181e4b0a90eSBrooks DavisExit status is 0 on success, and 1 if the command fails.
182e4b0a90eSBrooks Davis.Sh EXAMPLES
183e4b0a90eSBrooks DavisThe following example shows how to create a transparent provider for disk
184e4b0a90eSBrooks Davis.Pa /dev/da0
185e4b0a90eSBrooks Daviswith 50% write failure probability, and how to destroy it.
186e4b0a90eSBrooks Davis.Bd -literal -offset indent
187e4b0a90eSBrooks Davisgnop create -v -w 50 da0
188e4b0a90eSBrooks Davisgnop destroy -v da0.nop
189e4b0a90eSBrooks Davis.Ed
190e4b0a90eSBrooks Davis.Pp
191e4b0a90eSBrooks DavisThe traffic statistics for the given transparent providers can be obtained
192e4b0a90eSBrooks Daviswith the
193e4b0a90eSBrooks Davis.Cm list
194e4b0a90eSBrooks Daviscommand.
195e4b0a90eSBrooks DavisThe example below shows the number of bytes written with
196e4b0a90eSBrooks Davis.Xr newfs 8 :
197e4b0a90eSBrooks Davis.Bd -literal -offset indent
198e4b0a90eSBrooks Davisgnop create da0
199e4b0a90eSBrooks Davisnewfs /dev/da0.nop
200e4b0a90eSBrooks Davisgnop list
201e4b0a90eSBrooks Davis.Ed
202e4b0a90eSBrooks Davis.Sh SEE ALSO
203e4b0a90eSBrooks Davis.Xr geom 4 ,
204e4b0a90eSBrooks Davis.Xr geom 8
205e4b0a90eSBrooks Davis.Sh HISTORY
206e4b0a90eSBrooks DavisThe
207e4b0a90eSBrooks Davis.Nm
208e4b0a90eSBrooks Davisutility appeared in
209e4b0a90eSBrooks Davis.Fx 5.3 .
210e4b0a90eSBrooks Davis.Sh AUTHORS
211e4b0a90eSBrooks Davis.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
212