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