]> git.proxmox.com Git - mirror_zfs-debian.git/blame - man/man8/zinject.8
New upstream version 0.7.9
[mirror_zfs-debian.git] / man / man8 / zinject.8
CommitLineData
cf2129e6
DH
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
28zinject \- ZFS Fault Injector
29.SH DESCRIPTION
30.BR zinject
31creates 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"
35List injection records.
36.TP
37.B "zinject \-b \fIobjset:object:level:blkd\fB [\-f \fIfrequency\fB] [\-amu] \fIpool\fB"
38Force an error into the pool at a bookmark.
39.TP
40.B "zinject \-c <\fIid\fB | all>
41Cancel injection records.
42.TP
43.B "zinject \-d \fIvdev\fB \-A <degrade|fault> \fIpool\fB
44Force a vdev into the DEGRADED or FAULTED state.
45.TP
cae5b340
AX
46.B "zinject -d \fIvdev\fB -D latency:lanes \fIpool\fB
47
48Add an artificial delay to IO requests on a particular
49device, such that the requests take a minimum of 'latency'
50milliseconds to complete. Each delay has an associated
51number of 'lanes' which defines the number of concurrent
52IO requests that can be processed.
53
54For example, with a single lane delay of 10 ms (-D 10:1),
55the device will only be able to service a single IO request
56at a time with each request taking 10 ms to complete. So,
57if only a single request is submitted every 10 ms, the
58average latency will be 10 ms; but if more than one request
59is submitted every 10 ms, the average latency will be more
60than 10 ms.
61
62Similarly, if a delay of 10 ms is specified to have two
63lanes (-D 10:2), then the device will be able to service
64two requests at a time, each with a minimum latency of
6510 ms. So, if two requests are submitted every 10 ms, then
66the average latency will be 10 ms; but if more than two
67requests are submitted every 10 ms, the average latency
68will be more than 10 ms.
69
70Also note, these delays are additive. So two invocations
71of '-D 10:1', is roughly equivalent to a single invocation
72of '-D 10:2'. This also means, one can specify multiple
73lanes with differing target latencies. For example, an
74invocation of '-D 10:1' followed by '-D 25:2' will
75create 3 lanes on the device; one lane with a latency
76of 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"
cf2129e6
DH
80Force a vdev error.
81.TP
82.B "zinject \-I [\-s \fIseconds\fB | \-g \fItxgs\fB] \fIpool\fB"
83Simulate a hardware failure that fails to honor a cache flush.
84.TP
85.B "zinject \-p \fIfunction\fB \fIpool\fB
86Panic 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"
89Force 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"
92Force 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"
95Force an error into the MOS of a pool.
96.SH OPTIONS
97.TP
98.BI "\-a"
99Flush the ARC before injection.
100.TP
101.BI "\-b" " objset:object:level:start:end"
102Force an error into the pool at this bookmark tuple. Each number is
cae5b340 103in hexadecimal, and only one block can be specified.
cf2129e6
DH
104.TP
105.BI "\-d" " vdev"
106A vdev specified by path or GUID.
107.TP
108.BI "\-e" " device_error"
109Specify
110.BR "checksum" " for an ECKSUM error,"
111.BR "dtl" " for an ECHILD error,"
112.BR "io" " for an EIO error where reopening the device will succeed, or"
113.BR "nxio" " for an ENXIO error where reopening the device will fail."
42f7b73b
AX
114For EIO and ENXIO, the "failed" reads or writes still occur. The probe simply
115sets the error value reported by the I/O pipeline so it appears the read or
116write failed.
cf2129e6
DH
117.TP
118.BI "\-f" " frequency"
cae5b340
AX
119Only inject errors a fraction of the time. Expressed as a real number
120percentage between 0.0001 and 100.
cf2129e6
DH
121.TP
122.BI "\-F"
123Fail faster. Do fewer checks.
124.TP
125.BI "\-g" " txgs"
126Run for this many transaction groups before reporting failure.
127.TP
128.BI "\-h"
129Print the usage message.
130.TP
131.BI "\-l" " level"
132Inject an error at a particular block level. The default is 0.
133.TP
134.BI "\-L" " label_error"
135Set the label error region to one of
136.BR " nvlist" ","
137.BR " pad1" ","
138.BR " pad2" ", or"
139.BR " uber" "."
140.TP
141.BI "\-m"
142Automatically remount the underlying filesystem.
143.TP
144.BI "\-q"
145Quiet mode. Only print the handler number added.
146.TP
147.BI "\-r" " range"
148Inject an error over a particular logical range of an object, which
149will be translated to the appropriate blkid range according to the
150object's properties.
151.TP
152.BI "\-s" " seconds"
153Run for this many seconds before reporting failure.
154.TP
155.BI "\-T" " failure"
156Set the failure type to one of
157.BR " all" ","
158.BR " claim" ","
159.BR " free" ","
160.BR " read" ", or"
161.BR " write" "."
162.TP
163.BI "\-t" " mos_type"
164Set this to
165.BR "mos " "for any data in the MOS,"
166.BR "mosdir " "for an object directory,"
167.BR "config " "for the pool configuration,"
168.BR "bpobj " "for the block pointer list,"
169.BR "spacemap " "for the space map,"
170.BR "metaslab " "for the metaslab, or"
171.BR "errlog " "for the persistent error log."
172.TP
173.BI "\-u"
174Unload the pool after injection.
175
ea04106b
AX
176.SH "ENVIRONMENT VARIABLES"
177.TP
178.B "ZINJECT_DEBUG"
179Run \fBzinject\fR in debug mode.
180
cf2129e6
DH
181.SH "AUTHORS"
182This man page was written by Darik Horn <dajhorn@vanadac.com>
183excerpting the \fBzinject\fR usage message and source code.
184
185.SH "SEE ALSO"
186.BR zpool (8),
187.BR zfs (8)