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.
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.
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]
23 .\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
25 .TH zinject 8 "2013 FEB 28" "ZFS on Linux" "System Administration Commands"
28 zinject \- ZFS Fault Injector
31 creates artificial problems in a ZFS pool by simulating data corruption or device failures. This program is dangerous.
35 List injection records.
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.
40 .B "zinject \-c <\fIid\fB | all>
41 Cancel injection records.
43 .B "zinject \-d \fIvdev\fB \-A <degrade|fault> \fIpool\fB
44 Force a vdev into the DEGRADED or FAULTED state.
46 .B "zinject \-d \fIvdev\fB [\-e \fIdevice_error\fB] [\-L \fIlabel_error\fB] [\-T \fIfailure\fB] [\-F] \fIpool\fB"
49 .B "zinject \-I [\-s \fIseconds\fB | \-g \fItxgs\fB] \fIpool\fB"
50 Simulate a hardware failure that fails to honor a cache flush.
52 .B "zinject \-p \fIfunction\fB \fIpool\fB
53 Panic inside the specified function.
55 .B "zinject \-t data [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-r \fIrange\fB] [\-amq] \fIpath\fB"
56 Force an error into the contents of a file.
58 .B "zinject \-t dnode [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-amq] \fIpath\fB"
59 Force an error into the metadnode for a file or directory.
61 .B "zinject \-t \fImos_type\fB [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-r \fIrange\fB] [\-amqu] \fIpool\fB"
62 Force an error into the MOS of a pool.
66 Flush the ARC before injection.
68 .BI "\-b" " objset:object:level:start:end"
69 Force an error into the pool at this bookmark tuple. Each number is
70 in hexidecimal, and only one block can be specified.
73 A vdev specified by path or GUID.
75 .BI "\-e" " device_error"
77 .BR "checksum" " for an ECKSUM error,"
78 .BR "dtl" " for an ECHILD error,"
79 .BR "io" " for an EIO error where reopening the device will succeed, or"
80 .BR "nxio" " for an ENXIO error where reopening the device will fail."
82 .BI "\-f" " frequency"
83 Only inject errors a fraction of the time. Expressed as an integer
84 percentage between 1 and 100.
87 Fail faster. Do fewer checks.
90 Run for this many transaction groups before reporting failure.
93 Print the usage message.
96 Inject an error at a particular block level. The default is 0.
98 .BI "\-L" " label_error"
99 Set the label error region to one of
106 Automatically remount the underlying filesystem.
109 Quiet mode. Only print the handler number added.
112 Inject an error over a particular logical range of an object, which
113 will be translated to the appropriate blkid range according to the
117 Run for this many seconds before reporting failure.
120 Set the failure type to one of
127 .BI "\-t" " mos_type"
129 .BR "mos " "for any data in the MOS,"
130 .BR "mosdir " "for an object directory,"
131 .BR "config " "for the pool configuration,"
132 .BR "bpobj " "for the block pointer list,"
133 .BR "spacemap " "for the space map,"
134 .BR "metaslab " "for the metaslab, or"
135 .BR "errlog " "for the persistent error log."
138 Unload the pool after injection.
141 This man page was written by Darik Horn <dajhorn@vanadac.com>
142 excerpting the \fBzinject\fR usage message and source code.