]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - cddl/contrib/opensolaris/cmd/zpool/zpool.8
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.git] / cddl / contrib / opensolaris / cmd / zpool / zpool.8
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
4 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
5 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH zpool 1M "21 Sep 2009" "SunOS 5.11" "System Administration Commands"
7 .SH NAME
8 zpool \- configures ZFS storage pools
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBzpool\fR [\fB-?\fR]
13 .fi
14
15 .LP
16 .nf
17 \fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...
18 .fi
19
20 .LP
21 .nf
22 \fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
23 .fi
24
25 .LP
26 .nf
27 \fBzpool clear\fR \fIpool\fR [\fIdevice\fR]
28 .fi
29
30 .LP
31 .nf
32 \fBzpool create\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR] 
33      ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...
34 .fi
35
36 .LP
37 .nf
38 \fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
39 .fi
40
41 .LP
42 .nf
43 \fBzpool detach\fR \fIpool\fR \fIdevice\fR
44 .fi
45
46 .LP
47 .nf
48 \fBzpool export\fR [\fB-f\fR] \fIpool\fR ...
49 .fi
50
51 .LP
52 .nf
53 \fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
54 .fi
55
56 .LP
57 .nf
58 \fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...
59 .fi
60
61 .LP
62 .nf
63 \fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
64 .fi
65
66 .LP
67 .nf
68 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] 
69      [\fB-D\fR] [\fB-f\fR] [\fB-R\fR \fIroot\fR] \fB-a\fR
70 .fi
71
72 .LP
73 .nf
74 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
75      [\fB-D\fR] [\fB-f\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR |\fIid\fR [\fInewpool\fR]
76 .fi
77
78 .LP
79 .nf
80 \fBzpool iostat\fR [\fB-T\fR u | d ] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
81 .fi
82
83 .LP
84 .nf
85 \fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
86 .fi
87
88 .LP
89 .nf
90 \fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
91 .fi
92
93 .LP
94 .nf
95 \fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
96 .fi
97
98 .LP
99 .nf
100 \fBzpool online\fR \fIpool\fR \fIdevice\fR ...
101 .fi
102
103 .LP
104 .nf
105 \fBzpool remove\fR \fIpool\fR \fIdevice\fR ...
106 .fi
107
108 .LP
109 .nf
110 \fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR [\fInew_device\fR]
111 .fi
112
113 .LP
114 .nf
115 \fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
116 .fi
117
118 .LP
119 .nf
120 \fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR
121 .fi
122
123 .LP
124 .nf
125 \fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...
126 .fi
127
128 .LP
129 .nf
130 \fBzpool upgrade\fR 
131 .fi
132
133 .LP
134 .nf
135 \fBzpool upgrade\fR \fB-v\fR
136 .fi
137
138 .LP
139 .nf
140 \fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...
141 .fi
142
143 .SH DESCRIPTION
144 .sp
145 .LP
146 The \fBzpool\fR command configures \fBZFS\fR storage pools. A storage pool is a collection of devices that provides physical storage and data replication for \fBZFS\fR datasets.
147 .sp
148 .LP
149 All datasets within a storage pool share the same space. See \fBzfs\fR(1M) for information on managing datasets.
150 .SS "Virtual Devices (\fBvdev\fRs)"
151 .sp
152 .LP
153 A "virtual device" describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported:
154 .sp
155 .ne 2
156 .mk
157 .na
158 \fB\fBdisk\fR\fR
159 .ad
160 .RS 10n
161 .rt  
162 A block device, typically located under \fB/dev/dsk\fR. \fBZFS\fR can use individual slices or partitions, though the recommended mode of operation is to use whole disks. A disk can be specified by a full path, or it can be a shorthand name (the relative portion of the path under "/dev/dsk"). A whole disk can be specified by omitting the slice or partition designation. For example, "c0t0d0" is equivalent to "/dev/dsk/c0t0d0s2". When given a whole disk, \fBZFS\fR automatically labels the disk, if necessary.
163 .RE
164
165 .sp
166 .ne 2
167 .mk
168 .na
169 \fB\fBfile\fR\fR
170 .ad
171 .RS 10n
172 .rt  
173 A regular file. The use of files as a backing store is strongly discouraged. It is designed primarily for experimental purposes, as the fault tolerance of a file is only as good as the file system of which it is a part. A file must be specified by a full path.
174 .RE
175
176 .sp
177 .ne 2
178 .mk
179 .na
180 \fB\fBmirror\fR\fR
181 .ad
182 .RS 10n
183 .rt  
184 A mirror of two or more devices. Data is replicated in an identical fashion across all components of a mirror. A mirror with \fIN\fR disks of size \fIX\fR can hold \fIX\fR bytes and can withstand (\fIN-1\fR) devices failing before data integrity is compromised.
185 .RE
186
187 .sp
188 .ne 2
189 .mk
190 .na
191 \fB\fBraidz\fR\fR
192 .ad
193 .br
194 .na
195 \fB\fBraidz1\fR\fR
196 .ad
197 .br
198 .na
199 \fB\fBraidz2\fR\fR
200 .ad
201 .br
202 .na
203 \fB\fBraidz3\fR\fR
204 .ad
205 .RS 10n
206 .rt  
207 A variation on \fBRAID-5\fR that allows for better distribution of parity and eliminates the "\fBRAID-5\fR write hole" (in which data and parity become inconsistent after a power loss). Data and parity is striped across all disks within a \fBraidz\fR group.
208 .sp
209 A \fBraidz\fR group can have single-, double- , or triple parity, meaning that the \fBraidz\fR group can sustain one, two, or three failures, respectively, without losing any data. The \fBraidz1\fR \fBvdev\fR type specifies a single-parity \fBraidz\fR group; the \fBraidz2\fR \fBvdev\fR type specifies a double-parity \fBraidz\fR group; and the \fBraidz3\fR \fBvdev\fR type specifies a triple-parity \fBraidz\fR group. The \fBraidz\fR \fBvdev\fR type is an alias for \fBraidz1\fR.
210 .sp
211 A \fBraidz\fR group with \fIN\fR disks of size \fIX\fR with \fIP\fR parity disks can hold approximately (\fIN-P\fR)*\fIX\fR bytes and can withstand \fIP\fR device(s) failing before data integrity is compromised. The minimum number of devices in a \fBraidz\fR group is one more than the number of parity disks. The recommended number is between 3 and 9 to help increase performance.
212 .RE
213
214 .sp
215 .ne 2
216 .mk
217 .na
218 \fB\fBspare\fR\fR
219 .ad
220 .RS 10n
221 .rt  
222 A special pseudo-\fBvdev\fR which keeps track of available hot spares for a pool. For more information, see the "Hot Spares" section.
223 .RE
224
225 .sp
226 .ne 2
227 .mk
228 .na
229 \fB\fBlog\fR\fR
230 .ad
231 .RS 10n
232 .rt  
233 A separate-intent log device. If more than one log device is specified, then writes are load-balanced between devices. Log devices can be mirrored. However, \fBraidz\fR \fBvdev\fR types are not supported for the intent log. For more information, see the "Intent Log" section.
234 .RE
235
236 .sp
237 .ne 2
238 .mk
239 .na
240 \fB\fBcache\fR\fR
241 .ad
242 .RS 10n
243 .rt  
244 A device used to cache storage pool data. A cache device cannot be cannot be configured as a mirror or \fBraidz\fR group. For more information, see the "Cache Devices" section.
245 .RE
246
247 .sp
248 .LP
249 Virtual devices cannot be nested, so a mirror or \fBraidz\fR virtual device can only contain files or disks. Mirrors of mirrors (or other combinations) are not allowed.
250 .sp
251 .LP
252 A pool can have any number of virtual devices at the top of the configuration (known as "root vdevs"). Data is dynamically distributed across all top-level devices to balance data among devices. As new virtual devices are added, \fBZFS\fR automatically places data on the newly available devices.
253 .sp
254 .LP
255 Virtual devices are specified one at a time on the command line, separated by whitespace. The keywords "mirror" and "raidz" are used to distinguish where a group ends and another begins. For example, the following creates two root vdevs, each a mirror of two disks:
256 .sp
257 .in +2
258 .nf
259 # \fBzpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0\fR
260 .fi
261 .in -2
262 .sp
263
264 .SS "Device Failure and Recovery"
265 .sp
266 .LP
267 \fBZFS\fR supports a rich set of mechanisms for handling device failure and data corruption. All metadata and data is checksummed, and \fBZFS\fR automatically repairs bad data from a good copy when corruption is detected.
268 .sp
269 .LP
270 In order to take advantage of these features, a pool must make use of some form of redundancy, using either mirrored or \fBraidz\fR groups. While \fBZFS\fR supports running in a non-redundant configuration, where each root vdev is simply a disk or file, this is strongly discouraged. A single case of bit corruption can render some or all of your data unavailable.
271 .sp
272 .LP
273 A pool's health status is described by one of three states: online, degraded, or faulted. An online pool has all devices operating normally. A degraded pool is one in which one or more devices have failed, but the data is still available due to a redundant configuration. A faulted pool has corrupted metadata, or one or more faulted devices, and insufficient replicas to continue functioning. 
274 .sp
275 .LP
276 The health of the top-level vdev, such as mirror or \fBraidz\fR device, is potentially impacted by the state of its associated vdevs, or component devices. A top-level vdev or component device is in one of the following states:
277 .sp
278 .ne 2
279 .mk
280 .na
281 \fB\fBDEGRADED\fR\fR
282 .ad
283 .RS 12n
284 .rt  
285 One or more top-level vdevs is in the degraded state because one or more component devices are offline. Sufficient replicas exist to continue functioning.
286 .sp
287 One or more component devices is in the degraded or faulted state, but sufficient replicas exist to continue functioning. The underlying conditions are as follows:
288 .RS +4
289 .TP
290 .ie t \(bu
291 .el o
292 The number of checksum errors exceeds acceptable levels and the device is degraded as an indication that something may be wrong. \fBZFS\fR continues to use the device as necessary.
293 .RE
294 .RS +4
295 .TP
296 .ie t \(bu
297 .el o
298 The number of I/O errors exceeds acceptable levels. The device could not be marked as faulted because there are insufficient replicas to continue functioning.
299 .RE
300 .RE
301
302 .sp
303 .ne 2
304 .mk
305 .na
306 \fB\fBFAULTED\fR\fR
307 .ad
308 .RS 12n
309 .rt  
310 One or more top-level vdevs is in the faulted state because one or more component devices are offline. Insufficient replicas exist to continue functioning. 
311 .sp
312 One or more component devices is in the faulted state, and insufficient replicas exist to continue functioning. The underlying conditions are as follows:
313 .RS +4
314 .TP
315 .ie t \(bu
316 .el o
317 The device could be opened, but the contents did not match expected values. 
318 .RE
319 .RS +4
320 .TP
321 .ie t \(bu
322 .el o
323 The number of I/O errors exceeds acceptable levels and the device is faulted to prevent further use of the device.
324 .RE
325 .RE
326
327 .sp
328 .ne 2
329 .mk
330 .na
331 \fB\fBOFFLINE\fR\fR
332 .ad
333 .RS 12n
334 .rt  
335 The device was explicitly taken offline by the "\fBzpool offline\fR" command.
336 .RE
337
338 .sp
339 .ne 2
340 .mk
341 .na
342 \fB\fBONLINE\fR\fR
343 .ad
344 .RS 12n
345 .rt  
346 The device is online and functioning.
347 .RE
348
349 .sp
350 .ne 2
351 .mk
352 .na
353 \fB\fBREMOVED\fR\fR
354 .ad
355 .RS 12n
356 .rt  
357 The device was physically removed while the system was running. Device removal detection is hardware-dependent and may not be supported on all platforms.
358 .RE
359
360 .sp
361 .ne 2
362 .mk
363 .na
364 \fB\fBUNAVAIL\fR\fR
365 .ad
366 .RS 12n
367 .rt  
368 The device could not be opened. If a pool is imported when a device was unavailable, then the device will be identified by a unique identifier instead of its path since the path was never correct in the first place.
369 .RE
370
371 .sp
372 .LP
373 If a device is removed and later re-attached to the system, \fBZFS\fR attempts to put the device online automatically. Device attach detection is hardware-dependent and might not be supported on all platforms.
374 .SS "Hot Spares"
375 .sp
376 .LP
377 \fBZFS\fR allows devices to be associated with pools as "hot spares". These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare. To create a pool with hot spares, specify a "spare" \fBvdev\fR with any number of devices. For example, 
378 .sp
379 .in +2
380 .nf
381 # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
382 .fi
383 .in -2
384 .sp
385
386 .sp
387 .LP
388 Spares can be shared across multiple pools, and can be added with the "\fBzpool add\fR" command and removed with the "\fBzpool remove\fR" command. Once a spare replacement is initiated, a new "spare" \fBvdev\fR is created within the configuration that will remain there until the original device is replaced. At this point, the hot spare becomes available again if another device fails.
389 .sp
390 .LP
391 If a pool has a shared spare that is currently being used, the pool can not be exported since other pools may use this shared spare, which may lead to potential data corruption.
392 .sp
393 .LP
394 An in-progress spare replacement can be cancelled by detaching the hot spare. If the original faulted device is detached, then the hot spare assumes its place in the configuration, and is removed from the spare list of all active pools.
395 .sp
396 .LP
397 Spares cannot replace log devices.
398 .SS "Intent Log"
399 .sp
400 .LP
401 The \fBZFS\fR Intent Log (\fBZIL\fR) satisfies \fBPOSIX\fR requirements for synchronous transactions. For instance, databases often require their transactions to be on stable storage devices when returning from a system call. \fBNFS\fR and other applications can also use \fBfsync\fR() to ensure data stability. By default, the intent log is allocated from blocks within the main pool. However, it might be possible to get better performance using separate intent log devices such as \fBNVRAM\fR or a dedicated disk. For example:
402 .sp
403 .in +2
404 .nf
405 \fB# zpool create pool c0d0 c1d0 log c2d0\fR
406 .fi
407 .in -2
408 .sp
409
410 .sp
411 .LP
412 Multiple log devices can also be specified, and they can be mirrored. See the EXAMPLES section for an example of mirroring multiple log devices.
413 .sp
414 .LP
415 Log devices can be added, replaced, attached, detached, and imported and exported as part of the larger pool. Mirrored log devices can be removed by specifying the top-level mirror for the log.
416 .SS "Cache Devices"
417 .sp
418 .LP
419 Devices can be added to a storage pool as "cache devices." These devices provide an additional layer of caching between main memory and disk. For read-heavy workloads, where the working set size is much larger than what can be cached in main memory, using cache devices allow much more of this working set to be served from low latency media. Using cache devices provides the greatest performance improvement for random read-workloads of mostly static content.
420 .sp
421 .LP
422 To create a pool with cache devices, specify a "cache" \fBvdev\fR with any number of devices. For example:
423 .sp
424 .in +2
425 .nf
426 \fB# zpool create pool c0d0 c1d0 cache c2d0 c3d0\fR
427 .fi
428 .in -2
429 .sp
430
431 .sp
432 .LP
433 Cache devices cannot be mirrored or part of a \fBraidz\fR configuration. If a read error is encountered on a cache device, that read \fBI/O\fR is reissued to the original storage pool device, which might be part of a mirrored or \fBraidz\fR configuration.
434 .sp
435 .LP
436 The content of the cache devices is considered volatile, as is the case with other system caches.
437 .SS "Properties"
438 .sp
439 .LP
440 Each pool has several properties associated with it. Some properties are read-only statistics while others are configurable and change the behavior of the pool. The following are read-only properties:
441 .sp
442 .ne 2
443 .mk
444 .na
445 \fB\fBavailable\fR\fR
446 .ad
447 .RS 20n
448 .rt  
449 Amount of storage available within the pool. This property can also be referred to by its shortened column name, "avail".
450 .RE
451
452 .sp
453 .ne 2
454 .mk
455 .na
456 \fB\fBcapacity\fR\fR
457 .ad
458 .RS 20n
459 .rt  
460 Percentage of pool space used. This property can also be referred to by its shortened column name, "cap".
461 .RE
462
463 .sp
464 .ne 2
465 .mk
466 .na
467 \fB\fBhealth\fR\fR
468 .ad
469 .RS 20n
470 .rt  
471 The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR", "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
472 .RE
473
474 .sp
475 .ne 2
476 .mk
477 .na
478 \fB\fBguid\fR\fR
479 .ad
480 .RS 20n
481 .rt  
482 A unique identifier for the pool.
483 .RE
484
485 .sp
486 .ne 2
487 .mk
488 .na
489 \fB\fBsize\fR\fR
490 .ad
491 .RS 20n
492 .rt  
493 Total size of the storage pool.
494 .RE
495
496 .sp
497 .ne 2
498 .mk
499 .na
500 \fB\fBused\fR\fR
501 .ad
502 .RS 20n
503 .rt  
504 Amount of storage space used within the pool.
505 .RE
506
507 .sp
508 .LP
509 These space usage properties report actual physical space available to the storage pool. The physical space can be different from the total amount of space that any contained datasets can actually use. The amount of space used in a \fBraidz\fR configuration depends on the characteristics of the data being written. In addition, \fBZFS\fR reserves some space for internal accounting that the \fBzfs\fR(1M) command takes into account, but the \fBzpool\fR command does not. For non-full pools of a reasonable size, these effects should be invisible. For small pools, or pools that are close to being completely full, these discrepancies may become more noticeable.
510 .sp
511 .LP
512 The following property can be set at creation time and import time:
513 .sp
514 .ne 2
515 .mk
516 .na
517 \fB\fBaltroot\fR\fR
518 .ad
519 .sp .6
520 .RS 4n
521 Alternate root directory. If set, this directory is prepended to any mount points within the pool. This can be used when examining an unknown pool where the mount points cannot be trusted, or in an alternate boot environment, where the typical paths are not valid. \fBaltroot\fR is not a persistent property. It is valid only while the system is up. Setting \fBaltroot\fR defaults to using \fBcachefile\fR=none, though this may be overridden        using an explicit setting.
522 .RE
523
524 .sp
525 .LP
526 The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
527 .sp
528 .ne 2
529 .mk
530 .na
531 \fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
532 .ad
533 .sp .6
534 .RS 4n
535 Controls automatic pool expansion when the underlying LUN is grown. If set to \fBon\fR, the pool will be resized according to the size of the expanded device. If the device is part of a mirror or \fBraidz\fR then all devices within that mirror/\fBraidz\fR group must be expanded before the new space is made available to the pool. The default behavior is \fBoff\fR. This property can also be referred to by its shortened column name, \fBexpand\fR.
536 .RE
537
538 .sp
539 .ne 2
540 .mk
541 .na
542 \fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
543 .ad
544 .sp .6
545 .RS 4n
546 Controls automatic device replacement. If set to "\fBoff\fR", device replacement must be initiated by the administrator by using the "\fBzpool replace\fR" command. If set to "\fBon\fR", any new device, found in the same physical location as a device that previously belonged to the pool, is automatically formatted and replaced. The default behavior is "\fBoff\fR". This property can also be referred to by its shortened column name, "replace".
547 .RE
548
549 .sp
550 .ne 2
551 .mk
552 .na
553 \fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
554 .ad
555 .sp .6
556 .RS 4n
557 Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
558 .RE
559
560 .sp
561 .ne 2
562 .mk
563 .na
564 \fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
565 .ad
566 .sp .6
567 .RS 4n
568 Controls the location of where the pool configuration is cached. Discovering all pools on system startup requires a cached copy of the configuration data that is stored on the root file system. All pools in this cache are automatically imported when the system boots. Some environments, such as install and clustering, need to cache this information in a different location so that pools are not automatically imported. Setting this property caches the pool configuration in a different location that can later be imported with "\fBzpool import -c\fR". Setting it to the special value "\fBnone\fR" creates a temporary pool that is never cached, and the special value \fB\&''\fR (empty string) uses the default location. 
569 .sp
570 Multiple pools can share the same cache file. Because the kernel destroys and recreates this file when pools are added and removed, care should be taken when attempting to access this file. When the last pool using a \fBcachefile\fR is exported or destroyed, the file is removed.
571 .RE
572
573 .sp
574 .ne 2
575 .mk
576 .na
577 \fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
578 .ad
579 .sp .6
580 .RS 4n
581 Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See \fBzfs\fR(1M) for more information on \fBZFS\fR delegated administration.
582 .RE
583
584 .sp
585 .ne 2
586 .mk
587 .na
588 \fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
589 .ad
590 .sp .6
591 .RS 4n
592 Controls the system behavior in the event of catastrophic pool failure. This condition is typically a result of a loss of connectivity to the underlying storage device(s) or a failure of all devices within the pool. The behavior of such an event is determined as follows:
593 .sp
594 .ne 2
595 .mk
596 .na
597 \fB\fBwait\fR\fR
598 .ad
599 .RS 12n
600 .rt  
601 Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
602 .RE
603
604 .sp
605 .ne 2
606 .mk
607 .na
608 \fB\fBcontinue\fR\fR
609 .ad
610 .RS 12n
611 .rt  
612 Returns \fBEIO\fR to any new write \fBI/O\fR requests but allows reads to any of the remaining healthy devices. Any write requests that have yet to be committed to disk would be blocked.
613 .RE
614
615 .sp
616 .ne 2
617 .mk
618 .na
619 \fB\fBpanic\fR\fR
620 .ad
621 .RS 12n
622 .rt  
623 Prints out a message to the console and generates a system crash dump.
624 .RE
625
626 .RE
627
628 .sp
629 .ne 2
630 .mk
631 .na
632 \fB\fBlistsnaps\fR=on | off\fR
633 .ad
634 .sp .6
635 .RS 4n
636 Controls whether information about snapshots associated with this pool is output when "\fBzfs list\fR" is run without the \fB-t\fR option. The default value is "off".
637 .RE
638
639 .sp
640 .ne 2
641 .mk
642 .na
643 \fB\fBversion\fR=\fIversion\fR\fR
644 .ad
645 .sp .6
646 .RS 4n
647 The current on-disk version of the pool. This can be increased, but never decreased. The preferred method of updating pools is with the "\fBzpool upgrade\fR" command, though this property can be used when a specific version is needed for backwards compatibility. This property can be any number between 1 and the current version reported by "\fBzpool upgrade -v\fR".
648 .RE
649
650 .SS "Subcommands"
651 .sp
652 .LP
653 All subcommands that modify state are logged persistently to the pool in their original form.
654 .sp
655 .LP
656 The \fBzpool\fR command provides subcommands to create and destroy storage pools, add capacity to storage pools, and provide information about the storage pools. The following subcommands are supported:
657 .sp
658 .ne 2
659 .mk
660 .na
661 \fB\fBzpool\fR \fB-?\fR\fR
662 .ad
663 .sp .6
664 .RS 4n
665 Displays a help message.
666 .RE
667
668 .sp
669 .ne 2
670 .mk
671 .na
672 \fB\fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...\fR
673 .ad
674 .sp .6
675 .RS 4n
676 Adds the specified virtual devices to the given pool. The \fIvdev\fR specification is described in the "Virtual Devices" section. The behavior of the \fB-f\fR option, and the device checks performed are described in the "zpool create" subcommand.
677 .sp
678 .ne 2
679 .mk
680 .na
681 \fB\fB-f\fR\fR
682 .ad
683 .RS 6n
684 .rt  
685 Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
686 .RE
687
688 .sp
689 .ne 2
690 .mk
691 .na
692 \fB\fB-n\fR\fR
693 .ad
694 .RS 6n
695 .rt  
696 Displays the configuration that would be used without actually adding the \fBvdev\fRs. The actual pool creation can still fail due to insufficient privileges or device sharing.
697 .RE
698
699 Do not add a disk that is currently configured as a quorum device to a zpool. After a disk is in the pool, that disk can then be configured as a quorum device.
700 .RE
701
702 .sp
703 .ne 2
704 .mk
705 .na
706 \fB\fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
707 .ad
708 .sp .6
709 .RS 4n
710 Attaches \fInew_device\fR to an existing \fBzpool\fR device. The existing device cannot be part of a \fBraidz\fR configuration. If \fIdevice\fR is not currently part of a mirrored configuration, \fIdevice\fR automatically transforms into a two-way mirror of \fIdevice\fR and \fInew_device\fR. If \fIdevice\fR is part of a two-way mirror, attaching \fInew_device\fR creates a three-way mirror, and so on. In either case, \fInew_device\fR begins to resilver immediately.
711 .sp
712 .ne 2
713 .mk
714 .na
715 \fB\fB-f\fR\fR
716 .ad
717 .RS 6n
718 .rt  
719 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
720 .RE
721
722 .RE
723
724 .sp
725 .ne 2
726 .mk
727 .na
728 \fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
729 .ad
730 .sp .6
731 .RS 4n
732 Clears device errors in a pool. If no arguments are specified, all device errors within the pool are cleared. If one or more devices is specified, only those errors associated with the specified device or devices are cleared.
733 .RE
734
735 .sp
736 .ne 2
737 .mk
738 .na
739 \fB\fBzpool create\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR] ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...\fR
740 .ad
741 .sp .6
742 .RS 4n
743 Creates a new storage pool containing the virtual devices specified on the command line. The pool name must begin with a letter, and can only contain alphanumeric characters as well as underscore ("_"), dash ("-"), and period ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are names beginning with the pattern "c[0-9]". The \fBvdev\fR specification is described in the "Virtual Devices" section.
744 .sp
745 The command verifies that each device specified is accessible and not currently in use by another subsystem. There are some uses, such as being currently mounted, or specified as the dedicated dump device, that prevents a device from ever being used by \fBZFS\fR. Other uses, such as having a preexisting \fBUFS\fR file system, can be overridden with the \fB-f\fR option.
746 .sp
747 The command also checks that the replication strategy for the pool is consistent. An attempt to combine redundant and non-redundant storage in a single pool, or to mix disks and files, results in an error unless \fB-f\fR is specified. The use of differently sized devices within a single \fBraidz\fR or mirror group is also flagged as an error unless \fB-f\fR is specified.
748 .sp
749 Unless the \fB-R\fR option is specified, the default mount point is "/\fIpool\fR". The mount point must not exist or must be empty, or else the root dataset cannot be mounted. This can be overridden with the \fB-m\fR option.
750 .sp
751 .ne 2
752 .mk
753 .na
754 \fB\fB-f\fR\fR
755 .ad
756 .sp .6
757 .RS 4n
758 Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
759 .RE
760
761 .sp
762 .ne 2
763 .mk
764 .na
765 \fB\fB-n\fR\fR
766 .ad
767 .sp .6
768 .RS 4n
769 Displays the configuration that would be used without actually creating the pool. The actual pool creation can still fail due to insufficient privileges or device sharing.
770 .RE
771
772 .sp
773 .ne 2
774 .mk
775 .na
776 \fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
777 .ad
778 .sp .6
779 .RS 4n
780 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
781 .RE
782
783 .sp
784 .ne 2
785 .mk
786 .na
787 \fB\fB-O\fR \fIfile-system-property=value\fR\fR
788 .ad
789 .br
790 .na
791 \fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
792 .ad
793 .sp .6
794 .RS 4n
795 Sets the given file system properties in the root file system of the pool. See the "Properties" section of \fBzfs\fR(1M) for a list of valid properties that can be set.
796 .RE
797
798 .sp
799 .ne 2
800 .mk
801 .na
802 \fB\fB-R\fR \fIroot\fR\fR
803 .ad
804 .sp .6
805 .RS 4n
806 Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
807 .RE
808
809 .sp
810 .ne 2
811 .mk
812 .na
813 \fB\fB-m\fR \fImountpoint\fR\fR
814 .ad
815 .sp .6
816 .RS 4n
817 Sets the mount point for the root dataset. The default mount point is "/\fIpool\fR" or "\fBaltroot\fR/\fIpool\fR" if \fBaltroot\fR is specified. The mount point must be an absolute path, "\fBlegacy\fR", or "\fBnone\fR". For more information on dataset mount points, see \fBzfs\fR(1M).
818 .RE
819
820 .RE
821
822 .sp
823 .ne 2
824 .mk
825 .na
826 \fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
827 .ad
828 .sp .6
829 .RS 4n
830 Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
831 .sp
832 .ne 2
833 .mk
834 .na
835 \fB\fB-f\fR\fR
836 .ad
837 .RS 6n
838 .rt  
839 Forces any active datasets contained within the pool to be unmounted.
840 .RE
841
842 .RE
843
844 .sp
845 .ne 2
846 .mk
847 .na
848 \fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
849 .ad
850 .sp .6
851 .RS 4n
852 Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data.
853 .RE
854
855 .sp
856 .ne 2
857 .mk
858 .na
859 \fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
860 .ad
861 .sp .6
862 .RS 4n
863 Exports the given pools from the system. All devices are marked as exported, but are still considered in use by other subsystems. The devices can be moved between systems (even those of different endianness) and imported as long as a sufficient number of devices are present.
864 .sp
865 Before exporting the pool, all datasets within the pool are unmounted. A pool can not be exported if it has a shared spare that is currently being used.
866 .sp
867 For pools to be portable, you must give the \fBzpool\fR command whole disks, not just slices, so that \fBZFS\fR can label the disks with portable \fBEFI\fR labels. Otherwise, disk drivers on platforms of different endianness will not recognize the disks.
868 .sp
869 .ne 2
870 .mk
871 .na
872 \fB\fB-f\fR\fR
873 .ad
874 .RS 6n
875 .rt  
876 Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
877 .sp
878 This command will forcefully export the pool even if it has a shared spare that is currently being used. This may lead to potential data corruption.
879 .RE
880
881 .RE
882
883 .sp
884 .ne 2
885 .mk
886 .na
887 \fB\fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
888 .ad
889 .sp .6
890 .RS 4n
891 Retrieves the given list of properties (or all properties if "\fBall\fR" is used) for the specified storage pool(s). These properties are displayed with the following fields:
892 .sp
893 .in +2
894 .nf
895        name          Name of storage pool
896         property      Property name
897         value         Property value
898         source        Property source, either 'default' or 'local'.
899 .fi
900 .in -2
901 .sp
902
903 See the "Properties" section for more information on the available pool properties.
904 .RE
905
906 .sp
907 .ne 2
908 .mk
909 .na
910 \fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
911 .ad
912 .sp .6
913 .RS 4n
914 Displays the command history of the specified pools or all pools if no pool is specified.
915 .sp
916 .ne 2
917 .mk
918 .na
919 \fB\fB-i\fR\fR
920 .ad
921 .RS 6n
922 .rt  
923 Displays internally logged \fBZFS\fR events in addition to user initiated events.
924 .RE
925
926 .sp
927 .ne 2
928 .mk
929 .na
930 \fB\fB-l\fR\fR
931 .ad
932 .RS 6n
933 .rt  
934 Displays log records in long format, which in addition to standard format includes, the user name, the hostname, and the zone in which the operation was performed.
935 .RE
936
937 .RE
938
939 .sp
940 .ne 2
941 .mk
942 .na
943 \fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
944 .ad
945 .sp .6
946 .RS 4n
947 Lists pools available to import. If the \fB-d\fR option is not specified, this command searches for devices in "/dev/dsk". The \fB-d\fR option can be specified multiple times, and all directories are searched. If the device appears to be part of an exported pool, this command displays a summary of the pool with the name of the pool, a numeric identifier, as well as the \fIvdev\fR layout and current health of the device for each device or file. Destroyed pools, pools that were previously destroyed with the "\fBzpool destroy\fR" command, are not listed unless the \fB-D\fR option is specified. 
948 .sp
949 The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
950 .sp
951 .ne 2
952 .mk
953 .na
954 \fB\fB-c\fR \fIcachefile\fR\fR
955 .ad
956 .RS 16n
957 .rt  
958 Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
959 .RE
960
961 .sp
962 .ne 2
963 .mk
964 .na
965 \fB\fB-d\fR \fIdir\fR\fR
966 .ad
967 .RS 16n
968 .rt  
969 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. 
970 .RE
971
972 .sp
973 .ne 2
974 .mk
975 .na
976 \fB\fB-D\fR\fR
977 .ad
978 .RS 16n
979 .rt  
980 Lists destroyed pools only.
981 .RE
982
983 .RE
984
985 .sp
986 .ne 2
987 .mk
988 .na
989 \fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR] [\fB-f\fR] [\fB-R\fR \fIroot\fR] \fB-a\fR\fR
990 .ad
991 .sp .6
992 .RS 4n
993 Imports all pools found in the search directories. Identical to the previous command, except that all pools with a sufficient number of devices available are imported. Destroyed pools, pools that were previously destroyed with the "\fBzpool destroy\fR" command, will not be imported unless the \fB-D\fR option is specified.
994 .sp
995 .ne 2
996 .mk
997 .na
998 \fB\fB-o\fR \fImntopts\fR\fR
999 .ad
1000 .RS 21n
1001 .rt  
1002 Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(1M) for a description of dataset properties and mount options.
1003 .RE
1004
1005 .sp
1006 .ne 2
1007 .mk
1008 .na
1009 \fB\fB-o\fR \fIproperty=value\fR\fR
1010 .ad
1011 .RS 21n
1012 .rt  
1013 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1014 .RE
1015
1016 .sp
1017 .ne 2
1018 .mk
1019 .na
1020 \fB\fB-c\fR \fIcachefile\fR\fR
1021 .ad
1022 .RS 21n
1023 .rt  
1024 Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
1025 .RE
1026
1027 .sp
1028 .ne 2
1029 .mk
1030 .na
1031 \fB\fB-d\fR \fIdir\fR\fR
1032 .ad
1033 .RS 21n
1034 .rt  
1035 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. This option is incompatible with the \fB-c\fR option.
1036 .RE
1037
1038 .sp
1039 .ne 2
1040 .mk
1041 .na
1042 \fB\fB-D\fR\fR
1043 .ad
1044 .RS 21n
1045 .rt  
1046 Imports destroyed pools only. The \fB-f\fR option is also required.
1047 .RE
1048
1049 .sp
1050 .ne 2
1051 .mk
1052 .na
1053 \fB\fB-f\fR\fR
1054 .ad
1055 .RS 21n
1056 .rt  
1057 Forces import, even if the pool appears to be potentially active.
1058 .RE
1059
1060 .sp
1061 .ne 2
1062 .mk
1063 .na
1064 \fB\fB-a\fR\fR
1065 .ad
1066 .RS 21n
1067 .rt  
1068 Searches for and imports all pools found. 
1069 .RE
1070
1071 .sp
1072 .ne 2
1073 .mk
1074 .na
1075 \fB\fB-R\fR \fIroot\fR\fR
1076 .ad
1077 .RS 21n
1078 .rt  
1079 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1080 .RE
1081
1082 .RE
1083
1084 .sp
1085 .ne 2
1086 .mk
1087 .na
1088 \fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR] [\fB-f\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR | \fIid\fR [\fInewpool\fR]\fR
1089 .ad
1090 .sp .6
1091 .RS 4n
1092 Imports a specific pool. A pool can be identified by its name or the numeric identifier. If \fInewpool\fR is specified, the pool is imported using the name \fInewpool\fR. Otherwise, it is imported with the same name as its exported name.
1093 .sp
1094 If a device is removed from a system without running "\fBzpool export\fR" first, the device appears as potentially active. It cannot be determined if this was a failed export, or whether the device is really in use from another host. To import a pool in this state, the \fB-f\fR option is required.
1095 .sp
1096 .ne 2
1097 .mk
1098 .na
1099 \fB\fB-o\fR \fImntopts\fR\fR
1100 .ad
1101 .sp .6
1102 .RS 4n
1103 Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(1M) for a description of dataset properties and mount options.
1104 .RE
1105
1106 .sp
1107 .ne 2
1108 .mk
1109 .na
1110 \fB\fB-o\fR \fIproperty=value\fR\fR
1111 .ad
1112 .sp .6
1113 .RS 4n
1114 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1115 .RE
1116
1117 .sp
1118 .ne 2
1119 .mk
1120 .na
1121 \fB\fB-c\fR \fIcachefile\fR\fR
1122 .ad
1123 .sp .6
1124 .RS 4n
1125 Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
1126 .RE
1127
1128 .sp
1129 .ne 2
1130 .mk
1131 .na
1132 \fB\fB-d\fR \fIdir\fR\fR
1133 .ad
1134 .sp .6
1135 .RS 4n
1136 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. This option is incompatible with the \fB-c\fR option.
1137 .RE
1138
1139 .sp
1140 .ne 2
1141 .mk
1142 .na
1143 \fB\fB-D\fR\fR
1144 .ad
1145 .sp .6
1146 .RS 4n
1147 Imports destroyed pool. The \fB-f\fR option is also required.
1148 .RE
1149
1150 .sp
1151 .ne 2
1152 .mk
1153 .na
1154 \fB\fB-f\fR\fR
1155 .ad
1156 .sp .6
1157 .RS 4n
1158 Forces import, even if the pool appears to be potentially active.
1159 .RE
1160
1161 .sp
1162 .ne 2
1163 .mk
1164 .na
1165 \fB\fB-R\fR \fIroot\fR\fR
1166 .ad
1167 .sp .6
1168 .RS 4n
1169 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1170 .RE
1171
1172 .RE
1173
1174 .sp
1175 .ne 2
1176 .mk
1177 .na
1178 \fB\fBzpool iostat\fR [\fB-T\fR \fBu\fR | \fBd\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1179 .ad
1180 .sp .6
1181 .RS 4n
1182 Displays \fBI/O\fR statistics for the given pools. When given an interval, the statistics are printed every \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If no \fIpools\fR are specified, statistics for every pool in the system is shown. If \fIcount\fR is specified, the command exits after \fIcount\fR reports are printed.
1183 .sp
1184 .ne 2
1185 .mk
1186 .na
1187 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1188 .ad
1189 .RS 12n
1190 .rt  
1191 Display a time stamp.
1192 .sp
1193 Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
1194 .RE
1195
1196 .sp
1197 .ne 2
1198 .mk
1199 .na
1200 \fB\fB-v\fR\fR
1201 .ad
1202 .RS 12n
1203 .rt  
1204 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1205 .RE
1206
1207 .RE
1208
1209 .sp
1210 .ne 2
1211 .mk
1212 .na
1213 \fB\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
1214 .ad
1215 .sp .6
1216 .RS 4n
1217 Removes ZFS label information from the specified device. The device must not be part of an active pool configuration.
1218 .sp
1219 .ne 2
1220 .mk
1221 .na
1222 \fB\fB-f\fR\fR
1223 .ad
1224 .RS 12n
1225 .rt  
1226 Treat exported or foreign devices as inactive.
1227 .RE
1228
1229 .RE
1230
1231 .sp
1232 .ne 2
1233 .mk
1234 .na
1235 \fB\fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...\fR
1236 .ad
1237 .sp .6
1238 .RS 4n
1239 Lists the given pools along with a health status and space usage. When given no arguments, all pools in the system are listed.
1240 .sp
1241 .ne 2
1242 .mk
1243 .na
1244 \fB\fB-H\fR\fR
1245 .ad
1246 .RS 12n
1247 .rt  
1248 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1249 .RE
1250
1251 .sp
1252 .ne 2
1253 .mk
1254 .na
1255 \fB\fB-o\fR \fIprops\fR\fR
1256 .ad
1257 .RS 12n
1258 .rt  
1259 Comma-separated list of properties to display. See the "Properties" section for a list of valid properties. The default list is "name, size, used, available, capacity, health, altroot"
1260 .RE
1261
1262 .RE
1263
1264 .sp
1265 .ne 2
1266 .mk
1267 .na
1268 \fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1269 .ad
1270 .sp .6
1271 .RS 4n
1272 Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1273 .sp
1274 This command is not applicable to spares or cache devices.
1275 .sp
1276 .ne 2
1277 .mk
1278 .na
1279 \fB\fB-t\fR\fR
1280 .ad
1281 .RS 6n
1282 .rt  
1283 Temporary. Upon reboot, the specified physical device reverts to its previous state.
1284 .RE
1285
1286 .RE
1287
1288 .sp
1289 .ne 2
1290 .mk
1291 .na
1292 \fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1293 .ad
1294 .sp .6
1295 .RS 4n
1296 Brings the specified physical device online.
1297 .sp
1298 This command is not applicable to spares or cache devices.
1299 .sp
1300 .ne 2
1301 .mk
1302 .na
1303 \fB\fB-e\fR\fR
1304 .ad
1305 .RS 6n
1306 .rt  
1307 Expand the device to use all available space. If the device is part of a mirror or \fBraidz\fR then all devices must be expanded before the new space will become available to the pool.
1308 .RE
1309
1310 .RE
1311
1312 .sp
1313 .ne 2
1314 .mk
1315 .na
1316 \fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1317 .ad
1318 .sp .6
1319 .RS 4n
1320 Removes the specified device from the pool. This command currently only supports removing hot spares, cache, and log devices. A mirrored log device can be removed by specifying the top-level mirror for the log. Non-log devices that are part of a mirrored configuration can be removed using the \fBzpool detach\fR command. Non-redundant and \fBraidz\fR devices cannot be removed from a pool.
1321 .RE
1322
1323 .sp
1324 .ne 2
1325 .mk
1326 .na
1327 \fB\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
1328 .ad
1329 .sp .6
1330 .RS 4n
1331 Replaces \fIold_device\fR with \fInew_device\fR. This is equivalent to attaching \fInew_device\fR, waiting for it to resilver, and then detaching \fIold_device\fR.
1332 .sp
1333 The size of \fInew_device\fR must be greater than or equal to the minimum size of all the devices in a mirror or \fBraidz\fR configuration.
1334 .sp
1335 \fInew_device\fR is required if the pool is not redundant. If \fInew_device\fR is not specified, it defaults to \fIold_device\fR. This form of replacement is useful after an existing disk has failed and has been physically replaced. In this case, the new disk may have the same \fB/dev/dsk\fR path as the old device, even though it is actually a different disk. \fBZFS\fR recognizes this.
1336 .sp
1337 .ne 2
1338 .mk
1339 .na
1340 \fB\fB-f\fR\fR
1341 .ad
1342 .RS 6n
1343 .rt  
1344 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1345 .RE
1346
1347 .RE
1348
1349 .sp
1350 .ne 2
1351 .mk
1352 .na
1353 \fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1354 .ad
1355 .sp .6
1356 .RS 4n
1357 Begins a scrub. The scrub examines all data in the specified pools to verify that it checksums correctly. For replicated (mirror or \fBraidz\fR) devices, \fBZFS\fR automatically repairs any damage discovered during the scrub. The "\fBzpool status\fR" command reports the progress of the scrub and summarizes the results of the scrub upon completion.
1358 .sp
1359 Scrubbing and resilvering are very similar operations. The difference is that resilvering only examines data that \fBZFS\fR knows to be out of date (for example, when attaching a new device to a mirror or replacing an existing device), whereas scrubbing examines all data to discover silent errors due to hardware faults or disk failure.
1360 .sp
1361 Because scrubbing and resilvering are \fBI/O\fR-intensive operations, \fBZFS\fR only allows one at a time. If a scrub is already in progress, the "\fBzpool scrub\fR" command terminates it and starts a new scrub. If a resilver is in progress, \fBZFS\fR does not allow a scrub to be started until the resilver completes.
1362 .sp
1363 .ne 2
1364 .mk
1365 .na
1366 \fB\fB-s\fR\fR
1367 .ad
1368 .RS 6n
1369 .rt  
1370 Stop scrubbing.
1371 .RE
1372
1373 .RE
1374
1375 .sp
1376 .ne 2
1377 .mk
1378 .na
1379 \fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1380 .ad
1381 .sp .6
1382 .RS 4n
1383 Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1384 .RE
1385
1386 .sp
1387 .ne 2
1388 .mk
1389 .na
1390 \fB\fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...\fR
1391 .ad
1392 .sp .6
1393 .RS 4n
1394 Displays the detailed health status for the given pools. If no \fIpool\fR is specified, then the status of each pool in the system is displayed. For more information on pool and device health, see the "Device Failure and Recovery" section.
1395 .sp
1396 If a scrub or resilver is in progress, this command reports the percentage done and the estimated time to completion. Both of these are only approximate, because the amount of data in the pool and the other workloads on the system can change.
1397 .sp
1398 .ne 2
1399 .mk
1400 .na
1401 \fB\fB-x\fR\fR
1402 .ad
1403 .RS 6n
1404 .rt  
1405 Only display status for pools that are exhibiting errors or are otherwise unavailable.
1406 .RE
1407
1408 .sp
1409 .ne 2
1410 .mk
1411 .na
1412 \fB\fB-v\fR\fR
1413 .ad
1414 .RS 6n
1415 .rt  
1416 Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1417 .RE
1418
1419 .RE
1420
1421 .sp
1422 .ne 2
1423 .mk
1424 .na
1425 \fB\fBzpool upgrade\fR\fR
1426 .ad
1427 .sp .6
1428 .RS 4n
1429 Displays all pools formatted using a different \fBZFS\fR on-disk version. Older versions can continue to be used, but some features may not be available. These pools can be upgraded using "\fBzpool upgrade -a\fR". Pools that are formatted with a more recent version are also displayed, although these pools will be inaccessible on the system.
1430 .RE
1431
1432 .sp
1433 .ne 2
1434 .mk
1435 .na
1436 \fB\fBzpool upgrade\fR \fB-v\fR\fR
1437 .ad
1438 .sp .6
1439 .RS 4n
1440 Displays \fBZFS\fR versions supported by the current software. The current \fBZFS\fR versions and all previous supported versions are displayed, along with an explanation of the features provided with each version.
1441 .RE
1442
1443 .sp
1444 .ne 2
1445 .mk
1446 .na
1447 \fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1448 .ad
1449 .sp .6
1450 .RS 4n
1451 Upgrades the given pool to the latest on-disk version. Once this is done, the pool will no longer be accessible on systems running older versions of the software.
1452 .sp
1453 .ne 2
1454 .mk
1455 .na
1456 \fB\fB-a\fR\fR
1457 .ad
1458 .RS 14n
1459 .rt  
1460 Upgrades all pools.
1461 .RE
1462
1463 .sp
1464 .ne 2
1465 .mk
1466 .na
1467 \fB\fB-V\fR \fIversion\fR\fR
1468 .ad
1469 .RS 14n
1470 .rt  
1471 Upgrade to the specified version. If the \fB-V\fR flag is not specified, the pool is upgraded to the most recent version. This option can only be used to increase the version number, and only up to the most recent version supported by this software.
1472 .RE
1473
1474 .RE
1475
1476 .SH EXAMPLES
1477 .LP
1478 \fBExample 1 \fRCreating a RAID-Z Storage Pool
1479 .sp
1480 .LP
1481 The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
1482
1483 .sp
1484 .in +2
1485 .nf
1486 # \fBzpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0\fR
1487 .fi
1488 .in -2
1489 .sp
1490
1491 .LP
1492 \fBExample 2 \fRCreating a Mirrored Storage Pool
1493 .sp
1494 .LP
1495 The following command creates a pool with two mirrors, where each mirror contains two disks.
1496
1497 .sp
1498 .in +2
1499 .nf
1500 # \fBzpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0\fR
1501 .fi
1502 .in -2
1503 .sp
1504
1505 .LP
1506 \fBExample 3 \fRCreating a ZFS Storage Pool by Using Slices
1507 .sp
1508 .LP
1509 The following command creates an unmirrored pool using two disk slices.
1510
1511 .sp
1512 .in +2
1513 .nf
1514 # \fBzpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4\fR
1515 .fi
1516 .in -2
1517 .sp
1518
1519 .LP
1520 \fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
1521 .sp
1522 .LP
1523 The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
1524
1525 .sp
1526 .in +2
1527 .nf
1528 # \fBzpool create tank /path/to/file/a /path/to/file/b\fR
1529 .fi
1530 .in -2
1531 .sp
1532
1533 .LP
1534 \fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
1535 .sp
1536 .LP
1537 The following command adds two mirrored disks to the pool "\fItank\fR", assuming the pool is already made up of two-way mirrors. The additional space is immediately available to any datasets within the pool.
1538
1539 .sp
1540 .in +2
1541 .nf
1542 # \fBzpool add tank mirror c1t0d0 c1t1d0\fR
1543 .fi
1544 .in -2
1545 .sp
1546
1547 .LP
1548 \fBExample 6 \fRListing Available ZFS Storage Pools
1549 .sp
1550 .LP
1551 The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
1552
1553 .sp
1554 .LP
1555 The results from this command are similar to the following:
1556
1557 .sp
1558 .in +2
1559 .nf
1560 # \fBzpool list\fR
1561      NAME              SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
1562      pool             67.5G   2.92M   67.5G     0%  ONLINE     -
1563      tank             67.5G   2.92M   67.5G     0%  ONLINE     -
1564      zion                 -       -       -     0%  FAULTED    -
1565 .fi
1566 .in -2
1567 .sp
1568
1569 .LP
1570 \fBExample 7 \fRDestroying a ZFS Storage Pool
1571 .sp
1572 .LP
1573 The following command destroys the pool "\fItank\fR" and any datasets contained within.
1574
1575 .sp
1576 .in +2
1577 .nf
1578 # \fBzpool destroy -f tank\fR
1579 .fi
1580 .in -2
1581 .sp
1582
1583 .LP
1584 \fBExample 8 \fRExporting a ZFS Storage Pool
1585 .sp
1586 .LP
1587 The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
1588
1589 .sp
1590 .in +2
1591 .nf
1592 # \fBzpool export tank\fR
1593 .fi
1594 .in -2
1595 .sp
1596
1597 .LP
1598 \fBExample 9 \fRImporting a ZFS Storage Pool
1599 .sp
1600 .LP
1601 The following command displays available pools, and then imports the pool "tank" for use on the system.
1602
1603 .sp
1604 .LP
1605 The results from this command are similar to the following:
1606
1607 .sp
1608 .in +2
1609 .nf
1610 # \fBzpool import\fR
1611   pool: tank
1612     id: 15451357997522795478
1613  state: ONLINE
1614 action: The pool can be imported using its name or numeric identifier.
1615 config:
1616
1617         tank        ONLINE
1618           mirror    ONLINE
1619             c1t2d0  ONLINE
1620             c1t3d0  ONLINE
1621
1622 # \fBzpool import tank\fR
1623 .fi
1624 .in -2
1625 .sp
1626
1627 .LP
1628 \fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
1629 .sp
1630 .LP
1631 The following command upgrades all ZFS Storage pools to the current version of the software.
1632
1633 .sp
1634 .in +2
1635 .nf
1636 # \fBzpool upgrade -a\fR
1637 This system is currently running ZFS version 2.
1638 .fi
1639 .in -2
1640 .sp
1641
1642 .LP
1643 \fBExample 11 \fRManaging Hot Spares
1644 .sp
1645 .LP
1646 The following command creates a new pool with an available hot spare:
1647
1648 .sp
1649 .in +2
1650 .nf
1651 # \fBzpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0\fR
1652 .fi
1653 .in -2
1654 .sp
1655
1656 .sp
1657 .LP
1658 If one of the disks were to fail, the pool would be reduced to the degraded state. The failed device can be replaced using the following command:
1659
1660 .sp
1661 .in +2
1662 .nf
1663 # \fBzpool replace tank c0t0d0 c0t3d0\fR
1664 .fi
1665 .in -2
1666 .sp
1667
1668 .sp
1669 .LP
1670 Once the data has been resilvered, the spare is automatically removed and is made available should another device fails. The hot spare can be permanently removed from the pool using the following command:
1671
1672 .sp
1673 .in +2
1674 .nf
1675 # \fBzpool remove tank c0t2d0\fR
1676 .fi
1677 .in -2
1678 .sp
1679
1680 .LP
1681 \fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
1682 .sp
1683 .LP
1684 The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
1685
1686 .sp
1687 .in +2
1688 .nf
1689 # \fBzpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
1690    c4d0 c5d0\fR
1691 .fi
1692 .in -2
1693 .sp
1694
1695 .LP
1696 \fBExample 13 \fRAdding Cache Devices to a ZFS Pool
1697 .sp
1698 .LP
1699 The following command adds two disks for use as cache devices to a ZFS storage pool:
1700
1701 .sp
1702 .in +2
1703 .nf
1704 # \fBzpool add pool cache c2d0 c3d0\fR
1705 .fi
1706 .in -2
1707 .sp
1708
1709 .sp
1710 .LP
1711 Once added, the cache devices gradually fill with content from main memory. Depending on the size of your cache devices, it could take over an hour for them to fill. Capacity and reads can be monitored using the \fBiostat\fR option as follows: 
1712
1713 .sp
1714 .in +2
1715 .nf
1716 # \fBzpool iostat -v pool 5\fR
1717 .fi
1718 .in -2
1719 .sp
1720
1721 .LP
1722 \fBExample 14 \fRRemoving a Mirrored Log Device
1723 .sp
1724 .LP
1725 The following command removes the mirrored log device \fBmirror-2\fR.
1726
1727 .sp
1728 .LP
1729 Given this configuration:
1730
1731 .sp
1732 .in +2
1733 .nf
1734    pool: tank
1735   state: ONLINE
1736   scrub: none requested
1737 config:
1738
1739          NAME        STATE     READ WRITE CKSUM
1740          tank        ONLINE       0     0     0
1741            mirror-0  ONLINE       0     0     0
1742              c6t0d0  ONLINE       0     0     0
1743              c6t1d0  ONLINE       0     0     0
1744            mirror-1  ONLINE       0     0     0
1745              c6t2d0  ONLINE       0     0     0
1746              c6t3d0  ONLINE       0     0     0
1747          logs
1748            mirror-2  ONLINE       0     0     0
1749              c4t0d0  ONLINE       0     0     0
1750              c4t1d0  ONLINE       0     0     0
1751 .fi
1752 .in -2
1753 .sp
1754
1755 .sp
1756 .LP
1757 The command to remove the mirrored log \fBmirror-2\fR is:
1758
1759 .sp
1760 .in +2
1761 .nf
1762 # \fBzpool remove tank mirror-2\fR
1763 .fi
1764 .in -2
1765 .sp
1766
1767 .SH EXIT STATUS
1768 .sp
1769 .LP
1770 The following exit values are returned:
1771 .sp
1772 .ne 2
1773 .mk
1774 .na
1775 \fB\fB0\fR\fR
1776 .ad
1777 .RS 5n
1778 .rt  
1779 Successful completion. 
1780 .RE
1781
1782 .sp
1783 .ne 2
1784 .mk
1785 .na
1786 \fB\fB1\fR\fR
1787 .ad
1788 .RS 5n
1789 .rt  
1790 An error occurred.
1791 .RE
1792
1793 .sp
1794 .ne 2
1795 .mk
1796 .na
1797 \fB\fB2\fR\fR
1798 .ad
1799 .RS 5n
1800 .rt  
1801 Invalid command line options were specified.
1802 .RE
1803
1804 .SH ATTRIBUTES
1805 .sp
1806 .LP
1807 See \fBattributes\fR(5) for descriptions of the following attributes:
1808 .sp
1809
1810 .sp
1811 .TS
1812 tab(\a) box;
1813 cw(2.75i) |cw(2.75i) 
1814 lw(2.75i) |lw(2.75i) 
1815 .
1816 ATTRIBUTE TYPE\aATTRIBUTE VALUE
1817 _
1818 Availability\aSUNWzfsu
1819 _
1820 Interface Stability\aEvolving
1821 .TE
1822
1823 .SH SEE ALSO
1824 .sp
1825 .LP
1826 \fBzfs\fR(1M), \fBattributes\fR(5)