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