]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/geom/class/nop/gnop.8
Revert r289133; retry the merge
[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 September 15, 2015
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 .Ar dev ...
46 .Nm
47 .Cm configure
48 .Op Fl v
49 .Op Fl e Ar error
50 .Op Fl r Ar rfailprob
51 .Op Fl w Ar wfailprob
52 .Ar prov ...
53 .Nm
54 .Cm destroy
55 .Op Fl fv
56 .Ar prov ...
57 .Nm
58 .Cm reset
59 .Op Fl v
60 .Ar prov ...
61 .Nm
62 .Cm list
63 .Nm
64 .Cm status
65 .Nm
66 .Cm load
67 .Nm
68 .Cm unload
69 .Sh DESCRIPTION
70 The
71 .Nm
72 utility is used for setting up transparent providers on existing ones.
73 Its main purpose is testing other GEOM classes, as it allows forced provider
74 removal and I/O error simulation with a given probability.
75 It also gathers the following statistics: number of read requests, number of
76 write requests, number of bytes read and number of bytes written.
77 In addition, it can be used as a good starting point for implementing new GEOM
78 classes.
79 .Pp
80 The first argument to
81 .Nm
82 indicates an action to be performed:
83 .Bl -tag -width ".Cm configure"
84 .It Cm create
85 Set up a transparent provider on the given devices.
86 If the operation succeeds, the new provider should appear with name
87 .Pa /dev/ Ns Ao Ar dev Ac Ns Pa .nop .
88 The kernel module
89 .Pa geom_nop.ko
90 will be loaded if it is not loaded already.
91 .It Cm configure
92 Configure existing transparent provider.
93 At the moment it is only used for changing failure probability.
94 .It Cm destroy
95 Turn off the given transparent providers.
96 .It Cm reset
97 Reset statistics for the given transparent providers.
98 .It Cm list
99 See
100 .Xr geom 8 .
101 .It Cm status
102 See
103 .Xr geom 8 .
104 .It Cm load
105 See
106 .Xr geom 8 .
107 .It Cm unload
108 See
109 .Xr geom 8 .
110 .El
111 .Pp
112 Additional options:
113 .Bl -tag -width ".Fl r Ar rfailprob"
114 .It Fl e Ar error
115 Specifies the error number to return on failure.
116 .It Fl f
117 Force the removal of the specified provider.
118 .It Fl o Ar offset
119 Where to begin on the original provider.
120 .It Fl p Ar stripesize
121 Value of the stripesize property of the transparent provider.
122 .It Fl P Ar stripeoffset
123 Value of the stripeoffset property of the transparent provider.
124 .It Fl r Ar rfailprob
125 Specifies read failure probability in percent.
126 .It Fl s Ar size
127 Size of the transparent provider.
128 .It Fl S Ar secsize
129 Sector size of the transparent provider.
130 .It Fl w Ar wfailprob
131 Specifies write failure probability in percent.
132 .It Fl v
133 Be more verbose.
134 .El
135 .Sh SYSCTL VARIABLES
136 The following
137 .Xr sysctl 8
138 variables can be used to control the behavior of the
139 .Nm NOP
140 GEOM class.
141 The default value is shown next to each variable.
142 .Bl -tag -width indent
143 .It Va kern.geom.nop.debug : No 0
144 Debug level of the
145 .Nm NOP
146 GEOM class.
147 This can be set to a number between 0 and 2 inclusive.
148 If set to 0, minimal debug information is printed.
149 If set to 1, basic debug information is logged along with the I/O requests
150 that were returned as errors.
151 If set to 2, the maximum amount of debug information is printed including
152 all I/O requests.
153 .El
154 .Sh EXIT STATUS
155 Exit status is 0 on success, and 1 if the command fails.
156 .Sh EXAMPLES
157 The following example shows how to create a transparent provider for disk
158 .Pa /dev/da0
159 with 50% write failure probability, and how to destroy it.
160 .Bd -literal -offset indent
161 gnop create -v -w 50 da0
162 gnop destroy -v da0.nop
163 .Ed
164 .Pp
165 The traffic statistics for the given transparent providers can be obtained
166 with the
167 .Cm list
168 command.
169 The example below shows the number of bytes written with
170 .Xr newfs 8 :
171 .Bd -literal -offset indent
172 gnop create da0
173 newfs /dev/da0.nop
174 gnop list
175 .Ed
176 .Sh SEE ALSO
177 .Xr geom 4 ,
178 .Xr geom 8
179 .Sh HISTORY
180 The
181 .Nm
182 utility appeared in
183 .Fx 5.3 .
184 .Sh AUTHORS
185 .An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org