]> granicus.if.org Git - zfs/blob - man/man8/zinject.8
Add mdoc style checker
[zfs] / man / man8 / zinject.8
1 '\" t
2 .\"
3 .\" CDDL HEADER START
4 .\"
5 .\" The contents of this file are subject to the terms of the
6 .\" Common Development and Distribution License (the "License").
7 .\" You may not use this file except in compliance with the License.
8 .\"
9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 .\" or http://www.opensolaris.org/os/licensing.
11 .\" See the License for the specific language governing permissions
12 .\" and limitations under the License.
13 .\"
14 .\" When distributing Covered Code, include this CDDL HEADER in each
15 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 .\" If applicable, add the following below this CDDL HEADER, with the
17 .\" fields enclosed by brackets "[]" replaced with your own identifying
18 .\" information: Portions Copyright [yyyy] [name of copyright owner]
19 .\"
20 .\" CDDL HEADER END
21 .\"
22 .\"
23 .\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
24 .\"
25 .TH zinject 8 "2013 FEB 28" "ZFS on Linux" "System Administration Commands"
26
27 .SH NAME
28 zinject \- ZFS Fault Injector
29 .SH DESCRIPTION
30 .BR zinject
31 creates artificial problems in a ZFS pool by simulating data corruption or device failures. This program is dangerous.
32 .SH SYNOPSIS
33 .TP
34 .B "zinject"
35 List injection records.
36 .TP
37 .B "zinject \-b \fIobjset:object:level:blkd\fB [\-f \fIfrequency\fB] [\-amu] \fIpool\fB"
38 Force an error into the pool at a bookmark.
39 .TP
40 .B "zinject \-c <\fIid\fB | all>
41 Cancel injection records.
42 .TP
43 .B "zinject \-d \fIvdev\fB \-A <degrade|fault> \fIpool\fB
44 Force a vdev into the DEGRADED or FAULTED state.
45 .TP
46 .B "zinject -d \fIvdev\fB -D latency:lanes \fIpool\fB
47
48 Add an artificial delay to IO requests on a particular
49 device, such that the requests take a minimum of 'latency'
50 milliseconds to complete. Each delay has an associated
51 number of 'lanes' which defines the number of concurrent
52 IO requests that can be processed.
53
54 For example, with a single lane delay of 10 ms (-D 10:1),
55 the device will only be able to service a single IO request
56 at a time with each request taking 10 ms to complete. So,
57 if only a single request is submitted every 10 ms, the
58 average latency will be 10 ms; but if more than one request
59 is submitted every 10 ms, the average latency will be more
60 than 10 ms.
61
62 Similarly, if a delay of 10 ms is specified to have two
63 lanes (-D 10:2), then the device will be able to service
64 two requests at a time, each with a minimum latency of
65 10 ms. So, if two requests are submitted every 10 ms, then
66 the average latency will be 10 ms; but if more than two
67 requests are submitted every 10 ms, the average latency
68 will be more than 10 ms.
69
70 Also note, these delays are additive. So two invocations
71 of '-D 10:1', is roughly equivalent to a single invocation
72 of '-D 10:2'. This also means, one can specify multiple
73 lanes with differing target latencies. For example, an
74 invocation of '-D 10:1' followed by '-D 25:2' will
75 create 3 lanes on the device; one lane with a latency
76 of 10 ms and two lanes with a 25 ms latency.
77
78 .TP
79 .B "zinject \-d \fIvdev\fB [\-e \fIdevice_error\fB] [\-L \fIlabel_error\fB] [\-T \fIfailure\fB] [\-f \fIfrequency\fB] [\-F] \fIpool\fB"
80 Force a vdev error.
81 .TP
82 .B "zinject \-I [\-s \fIseconds\fB | \-g \fItxgs\fB] \fIpool\fB"
83 Simulate a hardware failure that fails to honor a cache flush.
84 .TP
85 .B "zinject \-p \fIfunction\fB \fIpool\fB
86 Panic inside the specified function.
87 .TP
88 .B "zinject \-t data [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-r \fIrange\fB] [\-amq] \fIpath\fB"
89 Force an error into the contents of a file.
90 .TP
91 .B "zinject \-t dnode [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-amq] \fIpath\fB"
92 Force an error into the metadnode for a file or directory.
93 .TP
94 .B "zinject \-t \fImos_type\fB [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-r \fIrange\fB] [\-amqu] \fIpool\fB"
95 Force an error into the MOS of a pool.
96 .SH OPTIONS
97 .TP
98 .BI "\-a"
99 Flush the ARC before injection.
100 .TP
101 .BI "\-b" " objset:object:level:start:end"
102 Force an error into the pool at this bookmark tuple. Each number is
103 in hexadecimal, and only one block can be specified.
104 .TP
105 .BI "\-d" " vdev"
106 A vdev specified by path or GUID.
107 .TP
108 .BI "\-e" " device_error"
109 Specify
110 .BR "checksum" " for an ECKSUM error,"
111 .BR "corrupt" " to flip a bit in the data after a read,"
112 .BR "dtl" " for an ECHILD error,"
113 .BR "io" " for an EIO error where reopening the device will succeed, or"
114 .BR "nxio" " for an ENXIO error where reopening the device will fail."
115 .TP
116 .BI "\-f" " frequency"
117 Only inject errors a fraction of the time. Expressed as a real number
118 percentage between 0.0001 and 100.
119 .TP
120 .BI "\-F"
121 Fail faster. Do fewer checks.
122 .TP
123 .BI "\-g" " txgs"
124 Run for this many transaction groups before reporting failure.
125 .TP
126 .BI "\-h"
127 Print the usage message.
128 .TP
129 .BI "\-l" " level"
130 Inject an error at a particular block level. The default is 0.
131 .TP
132 .BI "\-L" " label_error"
133 Set the label error region to one of
134 .BR " nvlist" ","
135 .BR " pad1" ","
136 .BR " pad2" ", or"
137 .BR " uber" "."
138 .TP
139 .BI "\-m"
140 Automatically remount the underlying filesystem.
141 .TP
142 .BI "\-q"
143 Quiet mode. Only print the handler number added.
144 .TP
145 .BI "\-r" " range"
146 Inject an error over a particular logical range of an object, which
147 will be translated to the appropriate blkid range according to the
148 object's properties.
149 .TP
150 .BI "\-s" " seconds"
151 Run for this many seconds before reporting failure.
152 .TP
153 .BI "\-T" " failure"
154 Set the failure type to one of
155 .BR " all" ","
156 .BR " claim" ","
157 .BR " free" ","
158 .BR " read" ", or"
159 .BR " write" "."
160 .TP
161 .BI "\-t" " mos_type"
162 Set this to
163 .BR "mos " "for any data in the MOS,"
164 .BR "mosdir " "for an object directory,"
165 .BR "config " "for the pool configuration,"
166 .BR "bpobj " "for the block pointer list,"
167 .BR "spacemap " "for the space map,"
168 .BR "metaslab " "for the metaslab, or"
169 .BR "errlog " "for the persistent error log."
170 .TP
171 .BI "\-u"
172 Unload the pool after injection.
173
174 .SH "ENVIRONMENT VARIABLES"
175 .TP
176 .B "ZINJECT_DEBUG"
177 Run \fBzinject\fR in debug mode.
178
179 .SH "AUTHORS"
180 This man page was written by Darik Horn <dajhorn@vanadac.com>
181 excerpting the \fBzinject\fR usage message and source code.
182
183 .SH "SEE ALSO"
184 .BR zpool (8),
185 .BR zfs (8)