]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/geom/class/nop/gnop.8
Quiet unused fn warning for linuxulator w/o legacy syscalls
[FreeBSD/FreeBSD.git] / sbin / geom / class / nop / gnop.8
1 .\" Copyright (c) 2004-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd January 17, 2018
28 .Dt GNOP 8
29 .Os
30 .Sh NAME
31 .Nm gnop
32 .Nd "control utility for NOP GEOM class"
33 .Sh SYNOPSIS
34 .Nm
35 .Cm create
36 .Op Fl v
37 .Op Fl e Ar error
38 .Op Fl o Ar offset
39 .Op Fl p Ar stripesize
40 .Op Fl P Ar stripeoffset
41 .Op Fl r Ar rfailprob
42 .Op Fl s Ar size
43 .Op Fl S Ar secsize
44 .Op Fl w Ar wfailprob
45 .Op Fl z Ar physpath
46 .Ar dev ...
47 .Nm
48 .Cm configure
49 .Op Fl v
50 .Op Fl e Ar error
51 .Op Fl r Ar rfailprob
52 .Op Fl w Ar wfailprob
53 .Ar prov ...
54 .Nm
55 .Cm destroy
56 .Op Fl fv
57 .Ar prov ...
58 .Nm
59 .Cm reset
60 .Op Fl v
61 .Ar prov ...
62 .Nm
63 .Cm list
64 .Nm
65 .Cm status
66 .Nm
67 .Cm load
68 .Nm
69 .Cm unload
70 .Sh DESCRIPTION
71 The
72 .Nm
73 utility is used for setting up transparent providers on existing ones.
74 Its main purpose is testing other GEOM classes, as it allows forced provider
75 removal and I/O error simulation with a given probability.
76 It also gathers statistics on the number of read, write, delete,
77 getattr, flush, and other requests, and the number of bytes read and written.
78 .Nm
79 can also be used as a good starting point for implementing new GEOM
80 classes.
81 .Pp
82 The first argument to
83 .Nm
84 indicates an action to be performed:
85 .Bl -tag -width ".Cm configure"
86 .It Cm create
87 Set up a transparent provider on the given devices.
88 If the operation succeeds, the new provider should appear with name
89 .Pa /dev/ Ns Ao Ar dev Ac Ns Pa .nop .
90 The kernel module
91 .Pa geom_nop.ko
92 will be loaded if it is not loaded already.
93 .It Cm configure
94 Configure existing transparent provider.
95 At the moment it is only used for changing failure probability.
96 .It Cm destroy
97 Turn off the given transparent providers.
98 .It Cm reset
99 Reset statistics for the given transparent providers.
100 .It Cm list
101 See
102 .Xr geom 8 .
103 .It Cm status
104 See
105 .Xr geom 8 .
106 .It Cm load
107 See
108 .Xr geom 8 .
109 .It Cm unload
110 See
111 .Xr geom 8 .
112 .El
113 .Pp
114 Additional options:
115 .Bl -tag -width ".Fl r Ar rfailprob"
116 .It Fl e Ar error
117 Specifies the error number to return on failure.
118 .It Fl f
119 Force the removal of the specified provider.
120 .It Fl o Ar offset
121 Where to begin on the original provider.
122 .It Fl p Ar stripesize
123 Value of the stripesize property of the transparent provider.
124 .It Fl P Ar stripeoffset
125 Value of the stripeoffset property of the transparent provider.
126 .It Fl r Ar rfailprob
127 Specifies read failure probability in percent.
128 .It Fl s Ar size
129 Size of the transparent provider.
130 .It Fl S Ar secsize
131 Sector size of the transparent provider.
132 .It Fl w Ar wfailprob
133 Specifies write failure probability in percent.
134 .It Fl v
135 Be more verbose.
136 .It Fl z Ar physpath
137 Physical path of the transparent provider.
138 .El
139 .Sh SYSCTL VARIABLES
140 The following
141 .Xr sysctl 8
142 variables can be used to control the behavior of the
143 .Nm NOP
144 GEOM class.
145 The default value is shown next to each variable.
146 .Bl -tag -width indent
147 .It Va kern.geom.nop.debug : No 0
148 Debug level of the
149 .Nm NOP
150 GEOM class.
151 This can be set to a number between 0 and 2 inclusive.
152 If set to 0, minimal debug information is printed.
153 If set to 1, basic debug information is logged along with the I/O requests
154 that were returned as errors.
155 If set to 2, the maximum amount of debug information is printed including
156 all I/O requests.
157 .El
158 .Sh EXIT STATUS
159 Exit status is 0 on success, and 1 if the command fails.
160 .Sh EXAMPLES
161 The following example shows how to create a transparent provider for disk
162 .Pa /dev/da0
163 with 50% write failure probability, and how to destroy it.
164 .Bd -literal -offset indent
165 gnop create -v -w 50 da0
166 gnop destroy -v da0.nop
167 .Ed
168 .Pp
169 The traffic statistics for the given transparent providers can be obtained
170 with the
171 .Cm list
172 command.
173 The example below shows the number of bytes written with
174 .Xr newfs 8 :
175 .Bd -literal -offset indent
176 gnop create da0
177 newfs /dev/da0.nop
178 gnop list
179 .Ed
180 .Sh SEE ALSO
181 .Xr geom 4 ,
182 .Xr geom 8
183 .Sh HISTORY
184 The
185 .Nm
186 utility appeared in
187 .Fx 5.3 .
188 .Sh AUTHORS
189 .An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org