4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or https://opensource.org/licenses/CDDL-1.0.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
21 .\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
23 .\" lint-ok: WARNING: sections out of conventional order: Sh SYNOPSIS
31 .Nd ZFS Fault Injector
34 creates artificial problems in a ZFS pool by simulating data corruption
36 This program is dangerous.
43 List injection records.
47 .Fl b Ar objset : Ns Ar object : Ns Ar level : Ns Ar start : Ns Ar end
52 Force an error into the pool at a bookmark.
56 .Fl c Ar id Ns | Ns Sy all
58 Cancel injection records.
63 .Fl A Sy degrade Ns | Ns Sy fault
66 Force a vdev into the DEGRADED or FAULTED state.
71 .Fl D Ar latency : Ns Ar lanes
74 Add an artificial delay to I/O requests on a particular
75 device, such that the requests take a minimum of
77 milliseconds to complete.
78 Each delay has an associated number of
80 which defines the number of concurrent
81 I/O requests that can be processed.
83 For example, with a single lane delay of 10 ms
84 .No (\& Ns Fl D Ar 10 : Ns Ar 1 ) ,
85 the device will only be able to service a single I/O request
86 at a time with each request taking 10 ms to complete.
87 So, if only a single request is submitted every 10 ms, the
88 average latency will be 10 ms; but if more than one request
89 is submitted every 10 ms, the average latency will be more
92 Similarly, if a delay of 10 ms is specified to have two
94 .No (\& Ns Fl D Ar 10 : Ns Ar 2 ) ,
95 then the device will be able to service
96 two requests at a time, each with a minimum latency of 10 ms.
97 So, if two requests are submitted every 10 ms, then
98 the average latency will be 10 ms; but if more than two
99 requests are submitted every 10 ms, the average latency
100 will be more than 10 ms.
102 Also note, these delays are additive.
103 So two invocations of
104 .Fl D Ar 10 : Ns Ar 1
105 are roughly equivalent to a single invocation of
106 .Fl D Ar 10 : Ns Ar 2 .
107 This also means, that one can specify multiple
108 lanes with differing target latencies.
109 For example, an invocation of
110 .Fl D Ar 10 : Ns Ar 1
112 .Fl D Ar 25 : Ns Ar 2
113 will create 3 lanes on the device: one lane with a latency
114 of 10 ms and two lanes with a 25 ms latency.
119 .Op Fl e Ar device_error
120 .Op Fl L Ar label_error
122 .Op Fl f Ar frequency
131 .Op Fl s Ar seconds Ns | Ns Fl g Ar txgs
134 Simulate a hardware failure that fails to honor a cache flush.
141 Panic inside the specified function.
147 .Op Fl e Ar device_error
148 .Op Fl f Ar frequency
154 Force an error into the contents of a file.
160 .Op Fl e Ar device_error
161 .Op Fl f Ar frequency
166 Force an error into the metadnode for a file or directory.
172 .Op Fl e Ar device_error
173 .Op Fl f Ar frequency
179 Force an error into the MOS of a pool.
182 .Bl -tag -width "-C dvas"
184 Flush the ARC before injection.
185 .It Fl b Ar objset : Ns Ar object : Ns Ar level : Ns Ar start : Ns Ar end
186 Force an error into the pool at this bookmark tuple.
187 Each number is in hexadecimal, and only one block can be specified.
189 Inject the given error only into specific DVAs.
190 The mask should be specified as a list of 0-indexed DVAs separated by commas
191 .No (e.g . Ar 0,2 Ns No ).
192 This option is not applicable to logical data errors such as
197 A vdev specified by path or GUID.
198 .It Fl e Ar device_error
200 .Bl -tag -compact -width "decompress"
204 for a data decompression error,
206 for a data decryption error,
208 to flip a bit in the data after a read,
212 for an EIO error where reopening the device will succeed, or
214 for an ENXIO error where reopening the device will fail.
217 For EIO and ENXIO, the "failed" reads or writes still occur.
218 The probe simply sets the error value reported by the I/O pipeline
219 so it appears the read or write failed.
220 Decryption errors only currently work with file data.
221 .It Fl f Ar frequency
222 Only inject errors a fraction of the time.
223 Expressed as a real number percentage between
231 Run for this many transaction groups before reporting failure.
233 Print the usage message.
235 Inject an error at a particular block level.
238 .It Fl L Ar label_error
239 Set the label error region to one of
246 Automatically remount the underlying filesystem.
249 Only print the handler number added.
251 Inject an error over a particular logical range of an object, which
252 will be translated to the appropriate blkid range according to the
255 Run for this many seconds before reporting failure.
257 Set the failure type to one of
266 .Bl -tag -compact -width "spacemap"
268 for any data in the MOS,
270 for an object directory,
272 for the pool configuration,
274 for the block pointer list,
280 for the persistent error log.
283 Unload the pool after injection.
286 .Sh ENVIRONMENT VARIABLES