ec931a22a17b35a8d40ea65a12987a2d12a1c711
[zfs.git] / man / man8 / zpool.8
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
4 .\" 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.
5 .\" 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
6 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH zpool 8 "2 August 2012" "ZFS pool 28, filesystem 5" "System Administration Commands"
8 .SH NAME
9 zpool \- configures ZFS storage pools
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBzpool\fR [\fB-?\fR]
14 .fi
15
16 .LP
17 .nf
18 \fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...
19 .fi
20
21 .LP
22 .nf
23 \fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
24 .fi
25
26 .LP
27 .nf
28 \fBzpool clear\fR \fIpool\fR [\fIdevice\fR]
29 .fi
30
31 .LP
32 .nf
33 \fBzpool create\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR] 
34      ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...
35 .fi
36
37 .LP
38 .nf
39 \fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
40 .fi
41
42 .LP
43 .nf
44 \fBzpool detach\fR \fIpool\fR \fIdevice\fR
45 .fi
46
47 .LP
48 .nf
49 \fBzpool export\fR [\fB-f\fR] \fIpool\fR ...
50 .fi
51
52 .LP
53 .nf
54 \fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
55 .fi
56
57 .LP
58 .nf
59 \fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...
60 .fi
61
62 .LP
63 .nf
64 \fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
65 .fi
66
67 .LP
68 .nf
69 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
70      [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fB-a\fR
71 .fi
72
73 .LP
74 .nf
75 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
76      [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fIpool\fR |\fIid\fR [\fInewpool\fR]
77 .fi
78
79 .LP
80 .nf
81 \fBzpool iostat\fR [\fB-T\fR u | d ] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
82 .fi
83
84 .LP
85 .nf
86 \fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
87 .fi
88
89 .LP
90 .nf
91 \fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
92 .fi
93
94 .LP
95 .nf
96 \fBzpool online\fR \fIpool\fR \fIdevice\fR ...
97 .fi
98
99 .LP
100 .nf
101 \fBzpool reguid\fR \fIpool\fR
102 .fi
103
104 .LP
105 .nf
106 \fBzpool remove\fR \fIpool\fR \fIdevice\fR ...
107 .fi
108
109 .LP
110 .nf
111 \fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR [\fInew_device\fR]
112 .fi
113
114 .LP
115 .nf
116 \fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
117 .fi
118
119 .LP
120 .nf
121 \fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR
122 .fi
123
124 .LP
125 .nf
126 \fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...
127 .fi
128
129 .LP
130 .nf
131 \fBzpool upgrade\fR 
132 .fi
133
134 .LP
135 .nf
136 \fBzpool upgrade\fR \fB-v\fR
137 .fi
138
139 .LP
140 .nf
141 \fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...
142 .fi
143
144 .SH DESCRIPTION
145 .sp
146 .LP
147 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.
148 .sp
149 .LP
150 All datasets within a storage pool share the same space. See \fBzfs\fR(8) for information on managing datasets.
151 .SS "Virtual Devices (\fBvdev\fRs)"
152 .sp
153 .LP
154 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:
155 .sp
156 .ne 2
157 .mk
158 .na
159 \fB\fBdisk\fR\fR
160 .ad
161 .RS 10n
162 .rt  
163 A block device, typically located under \fB/dev\fR. \fBZFS\fR can use individual 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"). For example, "sda" is equivalent to "/dev/sda". A whole disk can be specified by omitting the partition designation. When given a whole disk, \fBZFS\fR automatically labels the disk, if necessary.
164 .RE
165
166 .sp
167 .ne 2
168 .mk
169 .na
170 \fB\fBfile\fR\fR
171 .ad
172 .RS 10n
173 .rt  
174 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.
175 .RE
176
177 .sp
178 .ne 2
179 .mk
180 .na
181 \fB\fBmirror\fR\fR
182 .ad
183 .RS 10n
184 .rt  
185 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.
186 .RE
187
188 .sp
189 .ne 2
190 .mk
191 .na
192 \fB\fBraidz\fR\fR
193 .ad
194 .br
195 .na
196 \fB\fBraidz1\fR\fR
197 .ad
198 .br
199 .na
200 \fB\fBraidz2\fR\fR
201 .ad
202 .br
203 .na
204 \fB\fBraidz3\fR\fR
205 .ad
206 .RS 10n
207 .rt  
208 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.
209 .sp
210 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.
211 .sp
212 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.
213 .RE
214
215 .sp
216 .ne 2
217 .mk
218 .na
219 \fB\fBspare\fR\fR
220 .ad
221 .RS 10n
222 .rt  
223 A special pseudo-\fBvdev\fR which keeps track of available hot spares for a pool. For more information, see the "Hot Spares" section.
224 .RE
225
226 .sp
227 .ne 2
228 .mk
229 .na
230 \fB\fBlog\fR\fR
231 .ad
232 .RS 10n
233 .rt  
234 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.
235 .RE
236
237 .sp
238 .ne 2
239 .mk
240 .na
241 \fB\fBcache\fR\fR
242 .ad
243 .RS 10n
244 .rt  
245 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.
246 .RE
247
248 .sp
249 .LP
250 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.
251 .sp
252 .LP
253 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.
254 .sp
255 .LP
256 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:
257 .sp
258 .in +2
259 .nf
260 # \fBzpool create mypool mirror sda sdb mirror sdc sdd\fR
261 .fi
262 .in -2
263 .sp
264
265 .SS "Device Failure and Recovery"
266 .sp
267 .LP
268 \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.
269 .sp
270 .LP
271 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.
272 .sp
273 .LP
274 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. 
275 .sp
276 .LP
277 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:
278 .sp
279 .ne 2
280 .mk
281 .na
282 \fB\fBDEGRADED\fR\fR
283 .ad
284 .RS 12n
285 .rt  
286 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.
287 .sp
288 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:
289 .RS +4
290 .TP
291 .ie t \(bu
292 .el o
293 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.
294 .RE
295 .RS +4
296 .TP
297 .ie t \(bu
298 .el o
299 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.
300 .RE
301 .RE
302
303 .sp
304 .ne 2
305 .mk
306 .na
307 \fB\fBFAULTED\fR\fR
308 .ad
309 .RS 12n
310 .rt  
311 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. 
312 .sp
313 One or more component devices is in the faulted state, and insufficient replicas exist to continue functioning. The underlying conditions are as follows:
314 .RS +4
315 .TP
316 .ie t \(bu
317 .el o
318 The device could be opened, but the contents did not match expected values. 
319 .RE
320 .RS +4
321 .TP
322 .ie t \(bu
323 .el o
324 The number of I/O errors exceeds acceptable levels and the device is faulted to prevent further use of the device.
325 .RE
326 .RE
327
328 .sp
329 .ne 2
330 .mk
331 .na
332 \fB\fBOFFLINE\fR\fR
333 .ad
334 .RS 12n
335 .rt  
336 The device was explicitly taken offline by the "\fBzpool offline\fR" command.
337 .RE
338
339 .sp
340 .ne 2
341 .mk
342 .na
343 \fB\fBONLINE\fR\fR
344 .ad
345 .RS 12n
346 .rt  
347 The device is online and functioning.
348 .RE
349
350 .sp
351 .ne 2
352 .mk
353 .na
354 \fB\fBREMOVED\fR\fR
355 .ad
356 .RS 12n
357 .rt  
358 The device was physically removed while the system was running. Device removal detection is hardware-dependent and may not be supported on all platforms.
359 .RE
360
361 .sp
362 .ne 2
363 .mk
364 .na
365 \fB\fBUNAVAIL\fR\fR
366 .ad
367 .RS 12n
368 .rt  
369 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.
370 .RE
371
372 .sp
373 .LP
374 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.
375 .SS "Hot Spares"
376 .sp
377 .LP
378 \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, 
379 .sp
380 .in +2
381 .nf
382 # zpool create pool mirror sda sdb spare sdc sdd
383 .fi
384 .in -2
385 .sp
386
387 .sp
388 .LP
389 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.
390 .sp
391 .LP
392 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.
393 .sp
394 .LP
395 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.
396 .sp
397 .LP
398 Spares cannot replace log devices.
399 .SS "Intent Log"
400 .sp
401 .LP
402 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:
403 .sp
404 .in +2
405 .nf
406 \fB# zpool create pool sda sdb log sdc\fR
407 .fi
408 .in -2
409 .sp
410
411 .sp
412 .LP
413 Multiple log devices can also be specified, and they can be mirrored. See the EXAMPLES section for an example of mirroring multiple log devices.
414 .sp
415 .LP
416 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.
417 .SS "Cache Devices"
418 .sp
419 .LP
420 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.
421 .sp
422 .LP
423 To create a pool with cache devices, specify a "cache" \fBvdev\fR with any number of devices. For example:
424 .sp
425 .in +2
426 .nf
427 \fB# zpool create pool sda sdb cache sdc sdd\fR
428 .fi
429 .in -2
430 .sp
431
432 .sp
433 .LP
434 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.
435 .sp
436 .LP
437 The content of the cache devices is considered volatile, as is the case with other system caches.
438 .SS "Properties"
439 .sp
440 .LP
441 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:
442 .sp
443 .ne 2
444 .mk
445 .na
446 \fB\fBavailable\fR\fR
447 .ad
448 .RS 20n
449 .rt  
450 Amount of storage available within the pool. This property can also be referred to by its shortened column name, "avail".
451 .RE
452
453 .sp
454 .ne 2
455 .mk
456 .na
457 \fB\fBcapacity\fR\fR
458 .ad
459 .RS 20n
460 .rt  
461 Percentage of pool space used. This property can also be referred to by its shortened column name, "cap".
462 .RE
463
464 .sp
465 .ne 2
466 .mk
467 .na
468 \fB\fBcomment\fR\fR
469 .ad
470 .RS 20n
471 .rt
472 A text string consisting of printable ASCII characters that will be stored such that it is available even if the pool becomes faulted.  An administrator can provide additional information about a pool using this property.
473 .RE
474
475 .sp
476 .ne 2
477 .mk
478 .na
479 \fB\fBhealth\fR\fR
480 .ad
481 .RS 20n
482 .rt  
483 The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR", "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
484 .RE
485
486 .sp
487 .ne 2
488 .mk
489 .na
490 \fB\fBguid\fR\fR
491 .ad
492 .RS 20n
493 .rt  
494 A unique identifier for the pool.
495 .RE
496
497 .sp
498 .ne 2
499 .mk
500 .na
501 \fB\fBsize\fR\fR
502 .ad
503 .RS 20n
504 .rt  
505 Total size of the storage pool.
506 .RE
507
508 .sp
509 .ne 2
510 .mk
511 .na
512 \fB\fBused\fR\fR
513 .ad
514 .RS 20n
515 .rt  
516 Amount of storage space used within the pool.
517 .RE
518
519 .sp
520 .LP
521 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(8) 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.
522
523 .sp
524 .LP
525 The following property can be set at creation time:
526 .sp
527 .ne 2
528 .mk
529 .na
530 \fB\fBashift\fR\fR
531 .ad
532 .sp .6
533 .RS 4n
534 Pool sector size exponent, to the power of 2 (internally referred to as "ashift"). I/O operations will be aligned to the specified size boundaries. Additionally, the minimum (disk) write size will be set to the specified size, so this represents a space vs. performance trade-off. The typical case for setting this property is when performance is important and the underlying disks use 4KiB sectors but report 512B sectors to the OS (for compatibility reasons); in that case, set \fBashift=12\fR (which is 1<<12 = 4096).
535 .LP
536 For optimal performance, the pool sector size should be greater than or equal to the sector size of the underlying disks. Since the property cannot be changed after pool creation, if in a given pool, you \fIever\fR want to use drives that \fIreport\fR 4KiB sectors, you must set \fBashift=12\fR at pool creation time.
537 .RE
538
539 .sp
540 .LP
541 The following property can be set at creation time and import time:
542 .sp
543 .ne 2
544 .mk
545 .na
546 \fB\fBaltroot\fR\fR
547 .ad
548 .sp .6
549 .RS 4n
550 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.
551 .RE
552
553 .sp
554 .LP
555 The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
556 .sp
557 .ne 2
558 .mk
559 .na
560 \fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
561 .ad
562 .sp .6
563 .RS 4n
564 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.
565 .RE
566
567 .sp
568 .ne 2
569 .mk
570 .na
571 \fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
572 .ad
573 .sp .6
574 .RS 4n
575 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".
576 .RE
577
578 .sp
579 .ne 2
580 .mk
581 .na
582 \fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
583 .ad
584 .sp .6
585 .RS 4n
586 Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
587 .RE
588
589 .sp
590 .ne 2
591 .mk
592 .na
593 \fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
594 .ad
595 .sp .6
596 .RS 4n
597 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. 
598 .sp
599 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.
600 .RE
601
602 .sp
603 .ne 2
604 .mk
605 .na
606 \fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
607 .ad
608 .sp .6
609 .RS 4n
610 Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See \fBzfs\fR(8) for more information on \fBZFS\fR delegated administration.
611 .RE
612
613 .sp
614 .ne 2
615 .mk
616 .na
617 \fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
618 .ad
619 .sp .6
620 .RS 4n
621 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:
622 .sp
623 .ne 2
624 .mk
625 .na
626 \fB\fBwait\fR\fR
627 .ad
628 .RS 12n
629 .rt  
630 Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
631 .RE
632
633 .sp
634 .ne 2
635 .mk
636 .na
637 \fB\fBcontinue\fR\fR
638 .ad
639 .RS 12n
640 .rt  
641 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.
642 .RE
643
644 .sp
645 .ne 2
646 .mk
647 .na
648 \fB\fBpanic\fR\fR
649 .ad
650 .RS 12n
651 .rt  
652 Prints out a message to the console and generates a system crash dump.
653 .RE
654
655 .RE
656
657 .sp
658 .ne 2
659 .mk
660 .na
661 \fB\fBlistsnaps\fR=on | off\fR
662 .ad
663 .sp .6
664 .RS 4n
665 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".
666 .RE
667
668 .sp
669 .ne 2
670 .mk
671 .na
672 \fB\fBversion\fR=\fIversion\fR\fR
673 .ad
674 .sp .6
675 .RS 4n
676 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".
677 .RE
678
679 .SS "Subcommands"
680 .sp
681 .LP
682 All subcommands that modify state are logged persistently to the pool in their original form.
683 .sp
684 .LP
685 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:
686 .sp
687 .ne 2
688 .mk
689 .na
690 \fB\fBzpool\fR \fB-?\fR\fR
691 .ad
692 .sp .6
693 .RS 4n
694 Displays a help message.
695 .RE
696
697 .sp
698 .ne 2
699 .mk
700 .na
701 \fB\fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...\fR
702 .ad
703 .sp .6
704 .RS 4n
705 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.
706 .sp
707 .ne 2
708 .mk
709 .na
710 \fB\fB-f\fR\fR
711 .ad
712 .RS 6n
713 .rt  
714 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.
715 .RE
716
717 .sp
718 .ne 2
719 .mk
720 .na
721 \fB\fB-n\fR\fR
722 .ad
723 .RS 6n
724 .rt  
725 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.
726 .RE
727
728 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.
729 .RE
730
731 .sp
732 .ne 2
733 .mk
734 .na
735 \fB\fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
736 .ad
737 .sp .6
738 .RS 4n
739 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.
740 .sp
741 .ne 2
742 .mk
743 .na
744 \fB\fB-f\fR\fR
745 .ad
746 .RS 6n
747 .rt  
748 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
749 .RE
750
751 .RE
752
753 .sp
754 .ne 2
755 .mk
756 .na
757 \fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
758 .ad
759 .sp .6
760 .RS 4n
761 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.
762 .RE
763
764 .sp
765 .ne 2
766 .mk
767 .na
768 \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
769 .ad
770 .sp .6
771 .RS 4n
772 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 ("-"), period ("."), colon (":"), and space (" "). 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.
773 .sp
774 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.
775 .sp
776 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.
777 .sp
778 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.
779 .sp
780 .ne 2
781 .mk
782 .na
783 \fB\fB-f\fR\fR
784 .ad
785 .sp .6
786 .RS 4n
787 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.
788 .RE
789
790 .sp
791 .ne 2
792 .mk
793 .na
794 \fB\fB-n\fR\fR
795 .ad
796 .sp .6
797 .RS 4n
798 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.
799 .RE
800
801 .sp
802 .ne 2
803 .mk
804 .na
805 \fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
806 .ad
807 .sp .6
808 .RS 4n
809 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
810 .RE
811
812 .sp
813 .ne 2
814 .mk
815 .na
816 \fB\fB-O\fR \fIfile-system-property=value\fR\fR
817 .ad
818 .br
819 .na
820 \fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
821 .ad
822 .sp .6
823 .RS 4n
824 Sets the given file system properties in the root file system of the pool. See the "Properties" section of \fBzfs\fR(8) for a list of valid properties that can be set.
825 .RE
826
827 .sp
828 .ne 2
829 .mk
830 .na
831 \fB\fB-R\fR \fIroot\fR\fR
832 .ad
833 .sp .6
834 .RS 4n
835 Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
836 .RE
837
838 .sp
839 .ne 2
840 .mk
841 .na
842 \fB\fB-m\fR \fImountpoint\fR\fR
843 .ad
844 .sp .6
845 .RS 4n
846 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(8).
847 .RE
848
849 .RE
850
851 .sp
852 .ne 2
853 .mk
854 .na
855 \fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
856 .ad
857 .sp .6
858 .RS 4n
859 Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
860 .sp
861 .ne 2
862 .mk
863 .na
864 \fB\fB-f\fR\fR
865 .ad
866 .RS 6n
867 .rt  
868 Forces any active datasets contained within the pool to be unmounted.
869 .RE
870
871 .RE
872
873 .sp
874 .ne 2
875 .mk
876 .na
877 \fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
878 .ad
879 .sp .6
880 .RS 4n
881 Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data.
882 .RE
883
884 .sp
885 .ne 2
886 .mk
887 .na
888 \fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
889 .ad
890 .sp .6
891 .RS 4n
892 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.
893 .sp
894 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.
895 .sp
896 For pools to be portable, you must give the \fBzpool\fR command whole disks, not just partitions, 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.
897 .sp
898 .ne 2
899 .mk
900 .na
901 \fB\fB-f\fR\fR
902 .ad
903 .RS 6n
904 .rt  
905 Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
906 .sp
907 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.
908 .RE
909
910 .RE
911
912 .sp
913 .ne 2
914 .mk
915 .na
916 \fB\fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
917 .ad
918 .sp .6
919 .RS 4n
920 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:
921 .sp
922 .in +2
923 .nf
924        name          Name of storage pool
925         property      Property name
926         value         Property value
927         source        Property source, either 'default' or 'local'.
928 .fi
929 .in -2
930 .sp
931
932 See the "Properties" section for more information on the available pool properties.
933 .RE
934
935 .sp
936 .ne 2
937 .mk
938 .na
939 \fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
940 .ad
941 .sp .6
942 .RS 4n
943 Displays the command history of the specified pools or all pools if no pool is specified.
944 .sp
945 .ne 2
946 .mk
947 .na
948 \fB\fB-i\fR\fR
949 .ad
950 .RS 6n
951 .rt  
952 Displays internally logged \fBZFS\fR events in addition to user initiated events.
953 .RE
954
955 .sp
956 .ne 2
957 .mk
958 .na
959 \fB\fB-l\fR\fR
960 .ad
961 .RS 6n
962 .rt  
963 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.
964 .RE
965
966 .RE
967
968 .sp
969 .ne 2
970 .mk
971 .na
972 \fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
973 .ad
974 .sp .6
975 .RS 4n
976 Lists pools available to import. If the \fB-d\fR option is not specified, this command searches for devices in "/dev". 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. 
977 .sp
978 The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
979 .sp
980 .ne 2
981 .mk
982 .na
983 \fB\fB-c\fR \fIcachefile\fR\fR
984 .ad
985 .RS 16n
986 .rt  
987 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.
988 .RE
989
990 .sp
991 .ne 2
992 .mk
993 .na
994 \fB\fB-d\fR \fIdir\fR\fR
995 .ad
996 .RS 16n
997 .rt  
998 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. 
999 .RE
1000
1001 .sp
1002 .ne 2
1003 .mk
1004 .na
1005 \fB\fB-D\fR\fR
1006 .ad
1007 .RS 16n
1008 .rt  
1009 Lists destroyed pools only.
1010 .RE
1011
1012 .RE
1013
1014 .sp
1015 .ne 2
1016 .mk
1017 .na
1018 \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-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fB-a\fR\fR
1019 .ad
1020 .sp .6
1021 .RS 4n
1022 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.
1023 .sp
1024 .ne 2
1025 .mk
1026 .na
1027 \fB\fB-o\fR \fImntopts\fR\fR
1028 .ad
1029 .RS 21n
1030 .rt  
1031 Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(8) for a description of dataset properties and mount options.
1032 .RE
1033
1034 .sp
1035 .ne 2
1036 .mk
1037 .na
1038 \fB\fB-o\fR \fIproperty=value\fR\fR
1039 .ad
1040 .RS 21n
1041 .rt  
1042 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1043 .RE
1044
1045 .sp
1046 .ne 2
1047 .mk
1048 .na
1049 \fB\fB-c\fR \fIcachefile\fR\fR
1050 .ad
1051 .RS 21n
1052 .rt  
1053 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.
1054 .RE
1055
1056 .sp
1057 .ne 2
1058 .mk
1059 .na
1060 \fB\fB-d\fR \fIdir\fR\fR
1061 .ad
1062 .RS 21n
1063 .rt  
1064 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.
1065 .RE
1066
1067 .sp
1068 .ne 2
1069 .mk
1070 .na
1071 \fB\fB-D\fR\fR
1072 .ad
1073 .RS 21n
1074 .rt  
1075 Imports destroyed pools only. The \fB-f\fR option is also required.
1076 .RE
1077
1078 .sp
1079 .ne 2
1080 .mk
1081 .na
1082 \fB\fB-f\fR\fR
1083 .ad
1084 .RS 21n
1085 .rt  
1086 Forces import, even if the pool appears to be potentially active.
1087 .RE
1088
1089 .sp
1090 .ne 2
1091 .mk
1092 .na
1093 \fB\fB-F\fR\fR
1094 .ad
1095 .RS 21n
1096 Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported.
1097 .RE
1098
1099 .sp
1100 .ne 2
1101 .mk
1102 .na
1103 \fB\fB-a\fR\fR
1104 .ad
1105 .RS 21n
1106 .rt  
1107 Searches for and imports all pools found. 
1108 .RE
1109
1110 .sp
1111 .ne 2
1112 .mk
1113 .na
1114 \fB\fB-m\fR\fR
1115 .ad
1116 .RS 21n
1117 Allows a pool to import when there is a missing log device.
1118 .RE
1119
1120 .sp
1121 .ne 2
1122 .mk
1123 .na
1124 \fB\fB-R\fR \fIroot\fR\fR
1125 .ad
1126 .RS 21n
1127 .rt  
1128 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1129 .RE
1130
1131 .sp
1132 .ne 2
1133 .mk
1134 .na
1135 \fB\fB-N\fR\fR
1136 .ad
1137 .RS 21n
1138 Import the pool without mounting any file systems.
1139 .RE
1140
1141 .sp
1142 .ne 2
1143 .mk
1144 .na
1145 \fB\fB-n\fR\fR
1146 .ad
1147 .RS 21n
1148 Used with the \fB-F\fR recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the \fB-F\fR option, above.
1149 .RE
1150
1151 .RE
1152
1153 .sp
1154 .ne 2
1155 .mk
1156 .na
1157 \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-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fIpool\fR | \fIid\fR [\fInewpool\fR]\fR
1158 .ad
1159 .sp .6
1160 .RS 4n
1161 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.
1162 .sp
1163 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.
1164 .sp
1165 .ne 2
1166 .mk
1167 .na
1168 \fB\fB-o\fR \fImntopts\fR\fR
1169 .ad
1170 .sp .6
1171 .RS 4n
1172 Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(8) for a description of dataset properties and mount options.
1173 .RE
1174
1175 .sp
1176 .ne 2
1177 .mk
1178 .na
1179 \fB\fB-o\fR \fIproperty=value\fR\fR
1180 .ad
1181 .sp .6
1182 .RS 4n
1183 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1184 .RE
1185
1186 .sp
1187 .ne 2
1188 .mk
1189 .na
1190 \fB\fB-c\fR \fIcachefile\fR\fR
1191 .ad
1192 .sp .6
1193 .RS 4n
1194 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.
1195 .RE
1196
1197 .sp
1198 .ne 2
1199 .mk
1200 .na
1201 \fB\fB-d\fR \fIdir\fR\fR
1202 .ad
1203 .sp .6
1204 .RS 4n
1205 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.
1206 .RE
1207
1208 .sp
1209 .ne 2
1210 .mk
1211 .na
1212 \fB\fB-D\fR\fR
1213 .ad
1214 .sp .6
1215 .RS 4n
1216 Imports destroyed pool. The \fB-f\fR option is also required.
1217 .RE
1218
1219 .sp
1220 .ne 2
1221 .mk
1222 .na
1223 \fB\fB-f\fR\fR
1224 .ad
1225 .sp .6
1226 .RS 4n
1227 Forces import, even if the pool appears to be potentially active.
1228 .RE
1229
1230 .sp
1231 .ne 2
1232 .mk
1233 .na
1234 \fB\fB-F\fR\fR
1235 .ad
1236 .sp .6
1237 .RS 4n
1238 Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported.
1239 .RE
1240
1241 .sp
1242 .ne 2
1243 .mk
1244 .na
1245 \fB\fB-R\fR \fIroot\fR\fR
1246 .ad
1247 .sp .6
1248 .RS 4n
1249 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1250 .RE
1251
1252 .sp
1253 .ne 2
1254 .mk
1255 .na
1256 \fB\fB-n\fR\fR
1257 .ad
1258 .sp .6
1259 .RS 4n
1260 Used with the \fB-F\fR recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the \fB-F\fR option, above.
1261 .RE
1262
1263 .sp
1264 .ne 2
1265 .mk
1266 .na
1267 \fB\fB-m\fR\fR
1268 .ad
1269 .sp .6
1270 .RS 4n
1271 Allows a pool to import when there is a missing log device.
1272 .RE
1273
1274 .RE
1275
1276 .sp
1277 .ne 2
1278 .mk
1279 .na
1280 \fB\fBzpool iostat\fR [\fB-T\fR \fBu\fR | \fBd\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1281 .ad
1282 .sp .6
1283 .RS 4n
1284 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.
1285 .sp
1286 .ne 2
1287 .mk
1288 .na
1289 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1290 .ad
1291 .RS 12n
1292 .rt  
1293 Display a time stamp.
1294 .sp
1295 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).
1296 .RE
1297
1298 .sp
1299 .ne 2
1300 .mk
1301 .na
1302 \fB\fB-v\fR\fR
1303 .ad
1304 .RS 12n
1305 .rt  
1306 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1307 .RE
1308
1309 .RE
1310
1311 .sp
1312 .ne 2
1313 .mk
1314 .na
1315 \fB\fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...\fR
1316 .ad
1317 .sp .6
1318 .RS 4n
1319 Lists the given pools along with a health status and space usage. When given no arguments, all pools in the system are listed.
1320 .sp
1321 .ne 2
1322 .mk
1323 .na
1324 \fB\fB-H\fR\fR
1325 .ad
1326 .RS 12n
1327 .rt  
1328 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1329 .RE
1330
1331 .sp
1332 .ne 2
1333 .mk
1334 .na
1335 \fB\fB-o\fR \fIprops\fR\fR
1336 .ad
1337 .RS 12n
1338 .rt  
1339 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"
1340 .RE
1341
1342 .RE
1343
1344 .sp
1345 .ne 2
1346 .mk
1347 .na
1348 \fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1349 .ad
1350 .sp .6
1351 .RS 4n
1352 Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1353 .sp
1354 This command is not applicable to spares or cache devices.
1355 .sp
1356 .ne 2
1357 .mk
1358 .na
1359 \fB\fB-t\fR\fR
1360 .ad
1361 .RS 6n
1362 .rt  
1363 Temporary. Upon reboot, the specified physical device reverts to its previous state.
1364 .RE
1365
1366 .RE
1367
1368 .sp
1369 .ne 2
1370 .mk
1371 .na
1372 \fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1373 .ad
1374 .sp .6
1375 .RS 4n
1376 Brings the specified physical device online.
1377 .sp
1378 This command is not applicable to spares or cache devices.
1379 .sp
1380 .ne 2
1381 .mk
1382 .na
1383 \fB\fB-e\fR\fR
1384 .ad
1385 .RS 6n
1386 .rt  
1387 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.
1388 .RE
1389
1390 .RE
1391
1392 .sp
1393 .ne 2
1394 .mk
1395 .na
1396 \fB\fBzpool reguid\fR \fIpool\fR
1397 .ad
1398 .sp .6
1399 .RS 4n
1400 Generates a new unique identifier for the pool.  You must ensure that all devices in this pool are online and
1401 healthy before performing this action.
1402 .RE
1403
1404 .sp
1405 .ne 2
1406 .na
1407 \fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1408 .ad
1409 .sp .6
1410 .RS 4n
1411 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.
1412 .RE
1413
1414 .sp
1415 .ne 2
1416 .mk
1417 .na
1418 \fB\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
1419 .ad
1420 .sp .6
1421 .RS 4n
1422 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.
1423 .sp
1424 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.
1425 .sp
1426 \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\fR path as the old device, even though it is actually a different disk. \fBZFS\fR recognizes this.
1427 .sp
1428 .ne 2
1429 .mk
1430 .na
1431 \fB\fB-f\fR\fR
1432 .ad
1433 .RS 6n
1434 .rt  
1435 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1436 .RE
1437
1438 .RE
1439
1440 .sp
1441 .ne 2
1442 .mk
1443 .na
1444 \fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1445 .ad
1446 .sp .6
1447 .RS 4n
1448 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.
1449 .sp
1450 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.
1451 .sp
1452 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.
1453 .sp
1454 .ne 2
1455 .mk
1456 .na
1457 \fB\fB-s\fR\fR
1458 .ad
1459 .RS 6n
1460 .rt  
1461 Stop scrubbing.
1462 .RE
1463
1464 .RE
1465
1466 .sp
1467 .ne 2
1468 .mk
1469 .na
1470 \fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1471 .ad
1472 .sp .6
1473 .RS 4n
1474 Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1475 .RE
1476
1477 .sp
1478 .ne 2
1479 .mk
1480 .na
1481 \fB\fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...\fR
1482 .ad
1483 .sp .6
1484 .RS 4n
1485 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.
1486 .sp
1487 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.
1488 .sp
1489 .ne 2
1490 .mk
1491 .na
1492 \fB\fB-x\fR\fR
1493 .ad
1494 .RS 6n
1495 .rt  
1496 Only display status for pools that are exhibiting errors or are otherwise unavailable.
1497 .RE
1498
1499 .sp
1500 .ne 2
1501 .mk
1502 .na
1503 \fB\fB-v\fR\fR
1504 .ad
1505 .RS 6n
1506 .rt  
1507 Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1508 .RE
1509
1510 .RE
1511
1512 .sp
1513 .ne 2
1514 .mk
1515 .na
1516 \fB\fBzpool upgrade\fR\fR
1517 .ad
1518 .sp .6
1519 .RS 4n
1520 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.
1521 .RE
1522
1523 .sp
1524 .ne 2
1525 .mk
1526 .na
1527 \fB\fBzpool upgrade\fR \fB-v\fR\fR
1528 .ad
1529 .sp .6
1530 .RS 4n
1531 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.
1532 .RE
1533
1534 .sp
1535 .ne 2
1536 .mk
1537 .na
1538 \fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1539 .ad
1540 .sp .6
1541 .RS 4n
1542 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.
1543 .sp
1544 .ne 2
1545 .mk
1546 .na
1547 \fB\fB-a\fR\fR
1548 .ad
1549 .RS 14n
1550 .rt  
1551 Upgrades all pools.
1552 .RE
1553
1554 .sp
1555 .ne 2
1556 .mk
1557 .na
1558 \fB\fB-V\fR \fIversion\fR\fR
1559 .ad
1560 .RS 14n
1561 .rt  
1562 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.
1563 .RE
1564
1565 .RE
1566
1567 .SH EXAMPLES
1568 .LP
1569 \fBExample 1 \fRCreating a RAID-Z Storage Pool
1570 .sp
1571 .LP
1572 The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
1573
1574 .sp
1575 .in +2
1576 .nf
1577 # \fBzpool create tank raidz sda sdb sdc sdd sde sdf\fR
1578 .fi
1579 .in -2
1580 .sp
1581
1582 .LP
1583 \fBExample 2 \fRCreating a Mirrored Storage Pool
1584 .sp
1585 .LP
1586 The following command creates a pool with two mirrors, where each mirror contains two disks.
1587
1588 .sp
1589 .in +2
1590 .nf
1591 # \fBzpool create tank mirror sda sdb mirror sdc sdd\fR
1592 .fi
1593 .in -2
1594 .sp
1595
1596 .LP
1597 \fBExample 3 \fRCreating a ZFS Storage Pool by Using Partitions
1598 .sp
1599 .LP
1600 The following command creates an unmirrored pool using two disk partitions.
1601
1602 .sp
1603 .in +2
1604 .nf
1605 # \fBzpool create tank sda1 sdb2\fR
1606 .fi
1607 .in -2
1608 .sp
1609
1610 .LP
1611 \fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
1612 .sp
1613 .LP
1614 The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
1615
1616 .sp
1617 .in +2
1618 .nf
1619 # \fBzpool create tank /path/to/file/a /path/to/file/b\fR
1620 .fi
1621 .in -2
1622 .sp
1623
1624 .LP
1625 \fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
1626 .sp
1627 .LP
1628 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.
1629
1630 .sp
1631 .in +2
1632 .nf
1633 # \fBzpool add tank mirror sda sdb\fR
1634 .fi
1635 .in -2
1636 .sp
1637
1638 .LP
1639 \fBExample 6 \fRListing Available ZFS Storage Pools
1640 .sp
1641 .LP
1642 The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
1643
1644 .sp
1645 .LP
1646 The results from this command are similar to the following:
1647
1648 .sp
1649 .in +2
1650 .nf
1651 # \fBzpool list\fR
1652      NAME              SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
1653      pool             67.5G   2.92M   67.5G     0%  ONLINE     -
1654      tank             67.5G   2.92M   67.5G     0%  ONLINE     -
1655      zion                 -       -       -     0%  FAULTED    -
1656 .fi
1657 .in -2
1658 .sp
1659
1660 .LP
1661 \fBExample 7 \fRDestroying a ZFS Storage Pool
1662 .sp
1663 .LP
1664 The following command destroys the pool \fItank\fR and any datasets contained within.
1665
1666 .sp
1667 .in +2
1668 .nf
1669 # \fBzpool destroy -f tank\fR
1670 .fi
1671 .in -2
1672 .sp
1673
1674 .LP
1675 \fBExample 8 \fRExporting a ZFS Storage Pool
1676 .sp
1677 .LP
1678 The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
1679
1680 .sp
1681 .in +2
1682 .nf
1683 # \fBzpool export tank\fR
1684 .fi
1685 .in -2
1686 .sp
1687
1688 .LP
1689 \fBExample 9 \fRImporting a ZFS Storage Pool
1690 .sp
1691 .LP
1692 The following command displays available pools, and then imports the pool \fItank\fR for use on the system.
1693
1694 .sp
1695 .LP
1696 The results from this command are similar to the following:
1697
1698 .sp
1699 .in +2
1700 .nf
1701 # \fBzpool import\fR
1702   pool: tank
1703     id: 15451357997522795478
1704  state: ONLINE
1705 action: The pool can be imported using its name or numeric identifier.
1706 config:
1707
1708         tank        ONLINE
1709           mirror    ONLINE
1710             sda     ONLINE
1711             sdb     ONLINE
1712
1713 # \fBzpool import tank\fR
1714 .fi
1715 .in -2
1716 .sp
1717
1718 .LP
1719 \fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
1720 .sp
1721 .LP
1722 The following command upgrades all ZFS Storage pools to the current version of the software.
1723
1724 .sp
1725 .in +2
1726 .nf
1727 # \fBzpool upgrade -a\fR
1728 This system is currently running ZFS pool version 28.
1729 .fi
1730 .in -2
1731 .sp
1732
1733 .LP
1734 \fBExample 11 \fRManaging Hot Spares
1735 .sp
1736 .LP
1737 The following command creates a new pool with an available hot spare:
1738
1739 .sp
1740 .in +2
1741 .nf
1742 # \fBzpool create tank mirror sda sdb spare sdc\fR
1743 .fi
1744 .in -2
1745 .sp
1746
1747 .sp
1748 .LP
1749 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:
1750
1751 .sp
1752 .in +2
1753 .nf
1754 # \fBzpool replace tank sda sdd\fR
1755 .fi
1756 .in -2
1757 .sp
1758
1759 .sp
1760 .LP
1761 Once the data has been resilvered, the spare is automatically removed and is made available for use should another device fails. The hot spare can be permanently removed from the pool using the following command:
1762
1763 .sp
1764 .in +2
1765 .nf
1766 # \fBzpool remove tank sdc\fR
1767 .fi
1768 .in -2
1769 .sp
1770
1771 .LP
1772 \fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
1773 .sp
1774 .LP
1775 The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
1776
1777 .sp
1778 .in +2
1779 .nf
1780 # \fBzpool create pool mirror sda sdb mirror sdc sdd log mirror \e
1781    sde sdf\fR
1782 .fi
1783 .in -2
1784 .sp
1785
1786 .LP
1787 \fBExample 13 \fRAdding Cache Devices to a ZFS Pool
1788 .sp
1789 .LP
1790 The following command adds two disks for use as cache devices to a ZFS storage pool:
1791
1792 .sp
1793 .in +2
1794 .nf
1795 # \fBzpool add pool cache sdc sdd\fR
1796 .fi
1797 .in -2
1798 .sp
1799
1800 .sp
1801 .LP
1802 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: 
1803
1804 .sp
1805 .in +2
1806 .nf
1807 # \fBzpool iostat -v pool 5\fR
1808 .fi
1809 .in -2
1810 .sp
1811
1812 .LP
1813 \fBExample 14 \fRRemoving a Mirrored Log Device
1814 .sp
1815 .LP
1816 The following command removes the mirrored log device \fBmirror-2\fR.
1817
1818 .sp
1819 .LP
1820 Given this configuration:
1821
1822 .sp
1823 .in +2
1824 .nf
1825    pool: tank
1826   state: ONLINE
1827   scrub: none requested
1828 config:
1829
1830          NAME        STATE     READ WRITE CKSUM
1831          tank        ONLINE       0     0     0
1832            mirror-0  ONLINE       0     0     0
1833              sda     ONLINE       0     0     0
1834              sdb     ONLINE       0     0     0
1835            mirror-1  ONLINE       0     0     0
1836              sdc     ONLINE       0     0     0
1837              sdd     ONLINE       0     0     0
1838          logs
1839            mirror-2  ONLINE       0     0     0
1840              sde     ONLINE       0     0     0
1841              sdf     ONLINE       0     0     0
1842 .fi
1843 .in -2
1844 .sp
1845
1846 .sp
1847 .LP
1848 The command to remove the mirrored log \fBmirror-2\fR is:
1849
1850 .sp
1851 .in +2
1852 .nf
1853 # \fBzpool remove tank mirror-2\fR
1854 .fi
1855 .in -2
1856 .sp
1857
1858 .SH EXIT STATUS
1859 .sp
1860 .LP
1861 The following exit values are returned:
1862 .sp
1863 .ne 2
1864 .mk
1865 .na
1866 \fB\fB0\fR\fR
1867 .ad
1868 .RS 5n
1869 .rt  
1870 Successful completion. 
1871 .RE
1872
1873 .sp
1874 .ne 2
1875 .mk
1876 .na
1877 \fB\fB1\fR\fR
1878 .ad
1879 .RS 5n
1880 .rt  
1881 An error occurred.
1882 .RE
1883
1884 .sp
1885 .ne 2
1886 .mk
1887 .na
1888 \fB\fB2\fR\fR
1889 .ad
1890 .RS 5n
1891 .rt  
1892 Invalid command line options were specified.
1893 .RE
1894
1895 .SH SEE ALSO
1896 .sp
1897 .LP
1898 \fBzfs\fR(8)