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 (c) 2009 Oracle and/or its affiliates. All rights reserved.
22 .\" Copyright (c) 2009 Michael Gebetsroither <michael.geb@gmx.at>. All rights
24 .\" Copyright (c) 2017, Intel Corporation.
32 .Nd was written by the ZFS Developers as a ZFS unit test
37 .Op Fl s Ar size_of_each_vdev
38 .Op Fl a Ar alignment_shift
39 .Op Fl m Ar mirror_copies
40 .Op Fl r Ar raidz_disks/draid_disks
41 .Op Fl R Ar raid_parity
43 .Op Fl D Ar draid_data
44 .Op Fl S Ar draid_spares
45 .Op Fl C Ar vdev_class_state
48 .Op Fl g Ar gang_block_threshold
49 .Op Fl i Ar initialize_pool_i_times
50 .Op Fl k Ar kill_percentage
53 .Op Fl z Ar zil_failure_rate
57 was written by the ZFS Developers as a ZFS unit test.
58 The tool was developed in tandem with the ZFS functionality and was
59 executed nightly as one of the many regression test against the daily build.
60 As features were added to ZFS, unit tests were also added to
62 In addition, a separate test development team wrote and
63 executed more functional and stress tests.
68 runs for ten minutes and uses block files
71 to create pools rather than using physical disks.
74 its flexibility to play around with
75 zpool components without requiring large hardware configurations.
76 However, storing the block files in
78 may not work for you if you
79 have a small tmp directory.
82 By default is non-verbose.
83 This is why entering the command above will result in
85 quietly executing for 5 minutes.
88 option can be used to increase the verbosity of the tool.
91 options is allowed and the more you add the more chatty
98 run completes, you should notice many
101 Once the run completes you can safely remove these files.
102 Note that you shouldn't remove these files during a run.
103 You can re-use these files in your next
110 .Bl -tag -width "-v v"
111 .It Fl h , \&? , -help
112 Print a help summary.
113 .It Fl v , -vdevs Ns = (default: Sy 5 )
115 .It Fl s , -vdev-size Ns = (default: Sy 64M )
117 .It Fl a , -alignment-shift Ns = (default: Sy 9 ) No (use Sy 0 No for random )
118 Alignment shift used in test.
119 .It Fl m , -mirror-copies Ns = (default: Sy 2 )
120 Number of mirror copies.
121 .It Fl r , -raid-disks Ns = (default: Sy 4 No for raidz/ Ns Sy 16 No for draid )
122 Number of raidz/draid disks.
123 .It Fl R , -raid-parity Ns = (default: Sy 1 )
124 Raid parity (raidz & draid).
125 .It Fl K , -raid-kind Ns = Ns Sy raidz Ns | Ns Sy draid Ns | Ns Sy random No (default : Sy random )
126 The kind of RAID config to use.
129 the kind alternates between raidz and draid.
130 .It Fl D , -draid-data Ns = (default: Sy 4 )
131 Number of data disks in a dRAID redundancy group.
132 .It Fl S , -draid-spares Ns = (default: Sy 1 )
133 Number of dRAID distributed spare disks.
134 .It Fl d , -datasets Ns = (default: Sy 7 )
136 .It Fl t , -threads Ns = (default: Sy 23 )
138 .It Fl g , -gang-block-threshold Ns = (default: Sy 32K )
139 Gang block threshold.
140 .It Fl i , -init-count Ns = (default: Sy 1 )
141 Number of pool initializations.
142 .It Fl k , -kill-percentage Ns = (default: Sy 70% )
144 .It Fl p , -pool-name Ns = (default: Sy ztest )
146 .It Fl f , -vdev-file-directory Ns = (default: Pa /tmp )
147 File directory for vdev files.
148 .It Fl M , -multi-host
149 Multi-host; simulate pool imported on remote host.
150 .It Fl E , -use-existing-pool
151 Use existing pool (use existing pool instead of creating new one).
152 .It Fl T , -run-time Ns = (default: Sy 300 Ns s)
154 .It Fl P , -pass-time Ns = (default: Sy 60 Ns s)
156 .It Fl F , -freeze-loops Ns = (default: Sy 50 )
159 .It Fl B , -alt-ztest Ns =
160 Path to alternate ("older")
162 to drive, which will be used to initialise the pool, and, a stochastic half the
163 time, to run the tests.
166 directory is prepended to
167 .Ev LD_LIBRARY_PATH ;
169 .Fl B Pa ./chroots/lenny/usr/bin/ Ns Nm ,
170 .Pa ./chroots/lenny/usr/lib
172 .It Fl C , -vdev-class-state Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy random No (default : Sy random )
173 The vdev allocation class state.
174 .It Fl o , -option Ns = Ns Ar variable Ns = Ns Ar value
177 to an unsigned 32-bit integer
179 (little-endian only).
180 .It Fl G , -dump-debug
181 Dump zfs_dbgmsg buffer before exiting due to an error.
183 Verbose (use multiple times for ever more verbosity).
189 as your location for block files, you can use the
194 To get an idea of what
196 is actually testing try this:
197 .Dl # ztest -f / -VVV
199 Maybe you'd like to run
201 for longer? To do so simply use the
203 option and specify the runlength in seconds like so:
204 .Dl # ztest -f / -V -T 120
206 .Sh ENVIRONMENT VARIABLES
208 .It Ev ZFS_HOSTID Ns = Ns Em id
211 instead of the SPL hostid to identify this host.
212 Intended for use with
213 .Nm , but this environment variable will affect any utility which uses
216 Since the kernel is unaware of this setting,
217 results with utilities other than ztest are undefined.
218 .It Ev ZFS_STACK_SIZE Ns = Ns Em stacksize
219 Limit the default stack size to
221 bytes for the purpose of
222 detecting and debugging kernel stack overflows.
223 This value defaults to
225 which is double the default
227 Linux kernel stack size.
229 In practice, setting the stack size slightly higher is needed because
230 differences in stack usage between kernel and user space can lead to spurious
231 stack overflows (especially when debugging is enabled).
233 will be rounded up to a floor of PTHREAD_STACK_MIN which is the minimum stack
234 required for a NULL procedure in user space.
236 By default the stack size is limited to