6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / zpool.1m
blobfbfd39357930d7550226ba7ca180042b96c28c1a
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved.
4 .\" Copyright (c) 2013 by Delphix. All rights reserved.
5 .\" The contents of this file are subject to the terms of the Common Development
6 .\" and Distribution License (the "License"). You may not use this file except
7 .\" in compliance with the License. You can obtain a copy of the license at
8 .\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
9 .\"
10 .\" See the License for the specific language governing permissions and
11 .\" limitations under the License. When distributing Covered Code, include this
12 .\" CDDL HEADER in each file and include the License file at
13 .\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this
14 .\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
15 .\" own identifying information:
16 .\" Portions Copyright [yyyy] [name of copyright owner]
17 .TH ZPOOL 1M "Mar 6, 2014"
18 .SH NAME
19 zpool \- configures ZFS storage pools
20 .SH SYNOPSIS
21 .LP
22 .nf
23 \fBzpool\fR [\fB-?\fR]
24 .fi
26 .LP
27 .nf
28 \fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...
29 .fi
31 .LP
32 .nf
33 \fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
34 .fi
36 .LP
37 .nf
38 \fBzpool clear\fR \fIpool\fR [\fIdevice\fR]
39 .fi
41 .LP
42 .nf
43 \fBzpool create\fR [\fB-fnd\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR]
44      ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...
45 .fi
47 .LP
48 .nf
49 \fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
50 .fi
52 .LP
53 .nf
54 \fBzpool detach\fR \fIpool\fR \fIdevice\fR
55 .fi
57 .LP
58 .nf
59 \fBzpool export\fR [\fB-f\fR] \fIpool\fR ...
60 .fi
62 .LP
63 .nf
64 \fBzpool get\fR [\fB-Hp\fR] [\fB-o \fR\fIfield\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
65 .fi
67 .LP
68 .nf
69 \fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...
70 .fi
72 .LP
73 .nf
74 \fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
75 .fi
77 .LP
78 .nf
79 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
80      [\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
81 .fi
83 .LP
84 .nf
85 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
86      [\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]
87 .fi
89 .LP
90 .nf
91 \fBzpool iostat\fR [\fB-T\fR \fBu\fR | \fBd\fR ] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
92 .fi
94 .LP
95 .nf
96 \fBzpool list\fR [\fB-T\fR \fBu\fR | \fBd\fR ] [\fB-Hpv\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
97 .fi
99 .LP
101 \fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
106 \fBzpool online\fR \fIpool\fR \fIdevice\fR ...
111 \fBzpool reguid\fR \fIpool\fR
116 \fBzpool reopen\fR \fIpool\fR
121 \fBzpool remove\fR \fIpool\fR \fIdevice\fR ...
126 \fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR [\fInew_device\fR]
131 \fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
136 \fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR
141 \fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR \fBu\fR | \fBd\fR ] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
146 \fBzpool upgrade\fR
151 \fBzpool upgrade\fR \fB-v\fR
156 \fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...
159 .SH DESCRIPTION
162 The \fBzpool\fR command configures \fBZFS\fR storage pools. A storage pool is a
163 collection of devices that provides physical storage and data replication for
164 \fBZFS\fR datasets.
167 All datasets within a storage pool share the same space. See \fBzfs\fR(1M) for
168 information on managing datasets.
169 .SS "Virtual Devices (\fBvdev\fRs)"
172 A "virtual device" describes a single device or a collection of devices
173 organized according to certain performance and fault characteristics. The
174 following virtual devices are supported:
176 .ne 2
178 \fB\fBdisk\fR\fR
180 .RS 10n
181 A block device, typically located under \fB/dev/dsk\fR. \fBZFS\fR can use
182 individual slices or partitions, though the recommended mode of operation is to
183 use whole disks. A disk can be specified by a full path, or it can be a
184 shorthand name (the relative portion of the path under "/dev/dsk"). A whole
185 disk can be specified by omitting the slice or partition designation. For
186 example, "c0t0d0" is equivalent to "/dev/dsk/c0t0d0s2". When given a whole
187 disk, \fBZFS\fR automatically labels the disk, if necessary.
191 .ne 2
193 \fB\fBfile\fR\fR
195 .RS 10n
196 A regular file. The use of files as a backing store is strongly discouraged. It
197 is designed primarily for experimental purposes, as the fault tolerance of a
198 file is only as good as the file system of which it is a part. A file must be
199 specified by a full path.
203 .ne 2
205 \fB\fBmirror\fR\fR
207 .RS 10n
208 A mirror of two or more devices. Data is replicated in an identical fashion
209 across all components of a mirror. A mirror with \fIN\fR disks of size \fIX\fR
210 can hold \fIX\fR bytes and can withstand (\fIN-1\fR) devices failing before
211 data integrity is compromised.
215 .ne 2
217 \fB\fBraidz\fR\fR
221 \fB\fBraidz1\fR\fR
225 \fB\fBraidz2\fR\fR
229 \fB\fBraidz3\fR\fR
231 .RS 10n
232 A variation on \fBRAID-5\fR that allows for better distribution of parity and
233 eliminates the "\fBRAID-5\fR write hole" (in which data and parity become
234 inconsistent after a power loss). Data and parity is striped across all disks
235 within a \fBraidz\fR group.
237 A \fBraidz\fR group can have single-, double- , or triple parity, meaning that
238 the \fBraidz\fR group can sustain one, two, or three failures, respectively,
239 without losing any data. The \fBraidz1\fR \fBvdev\fR type specifies a
240 single-parity \fBraidz\fR group; the \fBraidz2\fR \fBvdev\fR type specifies a
241 double-parity \fBraidz\fR group; and the \fBraidz3\fR \fBvdev\fR type specifies
242 a triple-parity \fBraidz\fR group. The \fBraidz\fR \fBvdev\fR type is an alias
243 for \fBraidz1\fR.
245 A \fBraidz\fR group with \fIN\fR disks of size \fIX\fR with \fIP\fR parity
246 disks can hold approximately (\fIN-P\fR)*\fIX\fR bytes and can withstand
247 \fIP\fR device(s) failing before data integrity is compromised. The minimum
248 number of devices in a \fBraidz\fR group is one more than the number of parity
249 disks. The recommended number is between 3 and 9 to help increase performance.
253 .ne 2
255 \fB\fBspare\fR\fR
257 .RS 10n
258 A special pseudo-\fBvdev\fR which keeps track of available hot spares for a
259 pool. For more information, see the "Hot Spares" section.
263 .ne 2
265 \fB\fBlog\fR\fR
267 .RS 10n
268 A separate-intent log device. If more than one log device is specified, then
269 writes are load-balanced between devices. Log devices can be mirrored. However,
270 \fBraidz\fR \fBvdev\fR types are not supported for the intent log. For more
271 information, see the "Intent Log" section.
275 .ne 2
277 \fB\fBcache\fR\fR
279 .RS 10n
280 A device used to cache storage pool data. A cache device cannot be cannot be
281 configured as a mirror or \fBraidz\fR group. For more information, see the
282 "Cache Devices" section.
287 Virtual devices cannot be nested, so a mirror or \fBraidz\fR virtual device can
288 only contain files or disks. Mirrors of mirrors (or other combinations) are not
289 allowed.
292 A pool can have any number of virtual devices at the top of the configuration
293 (known as "root vdevs"). Data is dynamically distributed across all top-level
294 devices to balance data among devices. As new virtual devices are added,
295 \fBZFS\fR automatically places data on the newly available devices.
298 Virtual devices are specified one at a time on the command line, separated by
299 whitespace. The keywords "mirror" and "raidz" are used to distinguish where a
300 group ends and another begins. For example, the following creates two root
301 vdevs, each a mirror of two disks:
303 .in +2
305 # \fBzpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0\fR
307 .in -2
310 .SS "Device Failure and Recovery"
313 \fBZFS\fR supports a rich set of mechanisms for handling device failure and
314 data corruption. All metadata and data is checksummed, and \fBZFS\fR
315 automatically repairs bad data from a good copy when corruption is detected.
318 In order to take advantage of these features, a pool must make use of some form
319 of redundancy, using either mirrored or \fBraidz\fR groups. While \fBZFS\fR
320 supports running in a non-redundant configuration, where each root vdev is
321 simply a disk or file, this is strongly discouraged. A single case of bit
322 corruption can render some or all of your data unavailable.
325 A pool's health status is described by one of three states: online, degraded,
326 or faulted. An online pool has all devices operating normally. A degraded pool
327 is one in which one or more devices have failed, but the data is still
328 available due to a redundant configuration. A faulted pool has corrupted
329 metadata, or one or more faulted devices, and insufficient replicas to continue
330 functioning.
333 The health of the top-level vdev, such as mirror or \fBraidz\fR device, is
334 potentially impacted by the state of its associated vdevs, or component
335 devices. A top-level vdev or component device is in one of the following
336 states:
338 .ne 2
340 \fB\fBDEGRADED\fR\fR
342 .RS 12n
343 One or more top-level vdevs is in the degraded state because one or more
344 component devices are offline. Sufficient replicas exist to continue
345 functioning.
347 One or more component devices is in the degraded or faulted state, but
348 sufficient replicas exist to continue functioning. The underlying conditions
349 are as follows:
350 .RS +4
352 .ie t \(bu
353 .el o
354 The number of checksum errors exceeds acceptable levels and the device is
355 degraded as an indication that something may be wrong. \fBZFS\fR continues to
356 use the device as necessary.
358 .RS +4
360 .ie t \(bu
361 .el o
362 The number of I/O errors exceeds acceptable levels. The device could not be
363 marked as faulted because there are insufficient replicas to continue
364 functioning.
369 .ne 2
371 \fB\fBFAULTED\fR\fR
373 .RS 12n
374 One or more top-level vdevs is in the faulted state because one or more
375 component devices are offline. Insufficient replicas exist to continue
376 functioning.
378 One or more component devices is in the faulted state, and insufficient
379 replicas exist to continue functioning. The underlying conditions are as
380 follows:
381 .RS +4
383 .ie t \(bu
384 .el o
385 The device could be opened, but the contents did not match expected values.
387 .RS +4
389 .ie t \(bu
390 .el o
391 The number of I/O errors exceeds acceptable levels and the device is faulted to
392 prevent further use of the device.
397 .ne 2
399 \fB\fBOFFLINE\fR\fR
401 .RS 12n
402 The device was explicitly taken offline by the "\fBzpool offline\fR" command.
406 .ne 2
408 \fB\fBONLINE\fR\fR
410 .RS 12n
411 The device is online and functioning.
415 .ne 2
417 \fB\fBREMOVED\fR\fR
419 .RS 12n
420 The device was physically removed while the system was running. Device removal
421 detection is hardware-dependent and may not be supported on all platforms.
425 .ne 2
427 \fB\fBUNAVAIL\fR\fR
429 .RS 12n
430 The device could not be opened. If a pool is imported when a device was
431 unavailable, then the device will be identified by a unique identifier instead
432 of its path since the path was never correct in the first place.
437 If a device is removed and later re-attached to the system, \fBZFS\fR attempts
438 to put the device online automatically. Device attach detection is
439 hardware-dependent and might not be supported on all platforms.
440 .SS "Hot Spares"
443 \fBZFS\fR allows devices to be associated with pools as "hot spares". These
444 devices are not actively used in the pool, but when an active device fails, it
445 is automatically replaced by a hot spare. To create a pool with hot spares,
446 specify a "spare" \fBvdev\fR with any number of devices. For example,
448 .in +2
450 # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
452 .in -2
457 Spares can be shared across multiple pools, and can be added with the "\fBzpool
458 add\fR" command and removed with the "\fBzpool remove\fR" command. Once a spare
459 replacement is initiated, a new "spare" \fBvdev\fR is created within the
460 configuration that will remain there until the original device is replaced. At
461 this point, the hot spare becomes available again if another device fails.
464 If a pool has a shared spare that is currently being used, the pool can not be
465 exported since other pools may use this shared spare, which may lead to
466 potential data corruption.
469 An in-progress spare replacement can be cancelled by detaching the hot spare.
470 If the original faulted device is detached, then the hot spare assumes its
471 place in the configuration, and is removed from the spare list of all active
472 pools.
475 Spares cannot replace log devices.
476 .SS "Intent Log"
479 The \fBZFS\fR Intent Log (\fBZIL\fR) satisfies \fBPOSIX\fR requirements for
480 synchronous transactions. For instance, databases often require their
481 transactions to be on stable storage devices when returning from a system call.
482 \fBNFS\fR and other applications can also use \fBfsync\fR() to ensure data
483 stability. By default, the intent log is allocated from blocks within the main
484 pool. However, it might be possible to get better performance using separate
485 intent log devices such as \fBNVRAM\fR or a dedicated disk. For example:
487 .in +2
489 \fB# zpool create pool c0d0 c1d0 log c2d0\fR
491 .in -2
496 Multiple log devices can also be specified, and they can be mirrored. See the
497 EXAMPLES section for an example of mirroring multiple log devices.
500 Log devices can be added, replaced, attached, detached, and imported and
501 exported as part of the larger pool. Mirrored log devices can be removed by
502 specifying the top-level mirror for the log.
503 .SS "Cache Devices"
506 Devices can be added to a storage pool as "cache devices." These devices
507 provide an additional layer of caching between main memory and disk. For
508 read-heavy workloads, where the working set size is much larger than what can
509 be cached in main memory, using cache devices allow much more of this working
510 set to be served from low latency media. Using cache devices provides the
511 greatest performance improvement for random read-workloads of mostly static
512 content.
515 To create a pool with cache devices, specify a "cache" \fBvdev\fR with any
516 number of devices. For example:
518 .in +2
520 \fB# zpool create pool c0d0 c1d0 cache c2d0 c3d0\fR
522 .in -2
527 Cache devices cannot be mirrored or part of a \fBraidz\fR configuration. If a
528 read error is encountered on a cache device, that read \fBI/O\fR is reissued to
529 the original storage pool device, which might be part of a mirrored or
530 \fBraidz\fR configuration.
533 The content of the cache devices is considered volatile, as is the case with
534 other system caches.
535 .SS "Properties"
538 Each pool has several properties associated with it. Some properties are
539 read-only statistics while others are configurable and change the behavior of
540 the pool. The following are read-only properties:
542 .ne 2
544 \fB\fBavailable\fR\fR
546 .RS 20n
547 Amount of storage available within the pool. This property can also be referred
548 to by its shortened column name, "avail".
552 .ne 2
554 \fB\fBcapacity\fR\fR
556 .RS 20n
557 Percentage of pool space used. This property can also be referred to by its
558 shortened column name, "cap".
562 .ne 2
564 \fB\fBexpandsize\fR\fR
566 .RS 20n
567 Amount of uninitialized space within the pool or device that can be used to
568 increase the total capacity of the pool.  Uninitialized space consists of
569 any space on an EFI labeled vdev which has not been brought online
570 (i.e. zpool online -e).  This space occurs when a LUN is dynamically expanded.
574 .ne 2
576 \fB\fBfragmentation\fR\fR
578 .RS 20n
579 The amount of fragmentation in the pool.
583 .ne 2
585 \fB\fBfree\fR\fR
587 .RS 20n
588 The amount of free space available in the pool.
592 .ne 2
594 \fB\fBfreeing\fR\fR
596 .RS 20n
597 After a file system or snapshot is destroyed, the space it was using is
598 returned to the pool asynchronously. \fB\fBfreeing\fR\fR is the amount of
599 space remaining to be reclaimed. Over time \fB\fBfreeing\fR\fR will decrease
600 while \fB\fBfree\fR\fR increases.
604 .ne 2
606 \fB\fBhealth\fR\fR
608 .RS 20n
609 The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR",
610 "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
614 .ne 2
616 \fB\fBguid\fR\fR
618 .RS 20n
619 A unique identifier for the pool.
623 .ne 2
625 \fB\fBsize\fR\fR
627 .RS 20n
628 Total size of the storage pool.
632 .ne 2
634 \fB\fBunsupported@\fR\fIfeature_guid\fR\fR
636 .RS 20n
637 Information about unsupported features that are enabled on the pool. See
638 \fBzpool-features\fR(5) for details.
642 .ne 2
644 \fB\fBused\fR\fR
646 .RS 20n
647 Amount of storage space used within the pool.
652 The space usage properties report actual physical space available to the
653 storage pool. The physical space can be different from the total amount of
654 space that any contained datasets can actually use. The amount of space used in
655 a \fBraidz\fR configuration depends on the characteristics of the data being
656 written. In addition, \fBZFS\fR reserves some space for internal accounting
657 that the \fBzfs\fR(1M) command takes into account, but the \fBzpool\fR command
658 does not. For non-full pools of a reasonable size, these effects should be
659 invisible. For small pools, or pools that are close to being completely full,
660 these discrepancies may become more noticeable.
663 The following property can be set at creation time and import time:
665 .ne 2
667 \fB\fBaltroot\fR\fR
669 .sp .6
670 .RS 4n
671 Alternate root directory. If set, this directory is prepended to any mount
672 points within the pool. This can be used when examining an unknown pool where
673 the mount points cannot be trusted, or in an alternate boot environment, where
674 the typical paths are not valid. \fBaltroot\fR is not a persistent property. It
675 is valid only while the system is up. Setting \fBaltroot\fR defaults to using
676 \fBcachefile\fR=none, though this may be overridden using an explicit setting.
681 The following property can be set only at import time:
683 .ne 2
685 \fB\fBreadonly\fR=\fBon\fR | \fBoff\fR\fR
687 .sp .6
688 .RS 4n
689 If set to \fBon\fR, the pool will be imported in read-only mode. This
690 property can also be referred to by its shortened column name, \fBrdonly\fR.
695 The following properties can be set at creation time and import time, and later
696 changed with the \fBzpool set\fR command:
698 .ne 2
700 \fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
702 .sp .6
703 .RS 4n
704 Controls automatic pool expansion when the underlying LUN is grown. If set to
705 \fBon\fR, the pool will be resized according to the size of the expanded
706 device. If the device is part of a mirror or \fBraidz\fR then all devices
707 within that mirror/\fBraidz\fR group must be expanded before the new space is
708 made available to the pool. The default behavior is \fBoff\fR. This property
709 can also be referred to by its shortened column name, \fBexpand\fR.
713 .ne 2
715 \fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
717 .sp .6
718 .RS 4n
719 Controls automatic device replacement. If set to "\fBoff\fR", device
720 replacement must be initiated by the administrator by using the "\fBzpool
721 replace\fR" command. If set to "\fBon\fR", any new device, found in the same
722 physical location as a device that previously belonged to the pool, is
723 automatically formatted and replaced. The default behavior is "\fBoff\fR". This
724 property can also be referred to by its shortened column name, "replace".
728 .ne 2
730 \fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
732 .sp .6
733 .RS 4n
734 Identifies the default bootable dataset for the root pool. This property is
735 expected to be set mainly by the installation and upgrade programs.
739 .ne 2
741 \fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
743 .sp .6
744 .RS 4n
745 Controls the location of where the pool configuration is cached. Discovering
746 all pools on system startup requires a cached copy of the configuration data
747 that is stored on the root file system. All pools in this cache are
748 automatically imported when the system boots. Some environments, such as
749 install and clustering, need to cache this information in a different location
750 so that pools are not automatically imported. Setting this property caches the
751 pool configuration in a different location that can later be imported with
752 "\fBzpool import -c\fR". Setting it to the special value "\fBnone\fR" creates a
753 temporary pool that is never cached, and the special value \fB\&''\fR (empty
754 string) uses the default location.
756 Multiple pools can share the same cache file. Because the kernel destroys and
757 recreates this file when pools are added and removed, care should be taken when
758 attempting to access this file. When the last pool using a \fBcachefile\fR is
759 exported or destroyed, the file is removed.
763 .ne 2
765 \fB\fBcomment\fR=\fB\fItext\fR\fR
767 .RS 4n
768 A text string consisting of printable ASCII characters that will be stored
769 such that it is available even if the pool becomes faulted.  An administrator
770 can provide additional information about a pool using this property.
774 .ne 2
776 \fB\fBdedupditto\fR=\fB\fInumber\fR\fR
778 .sp .6
779 .RS 4n
780 Threshold for the number of block ditto copies. If the reference count for a
781 deduplicated block increases above this number, a new ditto copy of this block
782 is automatically stored. The default setting is 0 which causes no ditto copies
783 to be created for deduplicated blocks. The miniumum legal nonzero setting is 100.
787 .ne 2
789 \fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
791 .sp .6
792 .RS 4n
793 Controls whether a non-privileged user is granted access based on the dataset
794 permissions defined on the dataset. See \fBzfs\fR(1M) for more information on
795 \fBZFS\fR delegated administration.
799 .ne 2
801 \fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
803 .sp .6
804 .RS 4n
805 Controls the system behavior in the event of catastrophic pool failure. This
806 condition is typically a result of a loss of connectivity to the underlying
807 storage device(s) or a failure of all devices within the pool. The behavior of
808 such an event is determined as follows:
810 .ne 2
812 \fB\fBwait\fR\fR
814 .RS 12n
815 Blocks all \fBI/O\fR access until the device connectivity is recovered and the
816 errors are cleared. This is the default behavior.
820 .ne 2
822 \fB\fBcontinue\fR\fR
824 .RS 12n
825 Returns \fBEIO\fR to any new write \fBI/O\fR requests but allows reads to any
826 of the remaining healthy devices. Any write requests that have yet to be
827 committed to disk would be blocked.
831 .ne 2
833 \fB\fBpanic\fR\fR
835 .RS 12n
836 Prints out a message to the console and generates a system crash dump.
842 .ne 2
844 \fB\fBfeature@\fR\fIfeature_name\fR=\fBenabled\fR\fR
846 .RS 4n
847 The value of this property is the current state of \fIfeature_name\fR. The
848 only valid value when setting this property is \fBenabled\fR which moves
849 \fIfeature_name\fR to the enabled state. See \fBzpool-features\fR(5) for
850 details on feature states.
854 .ne 2
856 \fB\fBlistsnaps\fR=on | off\fR
858 .sp .6
859 .RS 4n
860 Controls whether information about snapshots associated with this pool is
861 output when "\fBzfs list\fR" is run without the \fB-t\fR option. The default
862 value is "off".
866 .ne 2
868 \fB\fBversion\fR=\fIversion\fR\fR
870 .sp .6
871 .RS 4n
872 The current on-disk version of the pool. This can be increased, but never
873 decreased. The preferred method of updating pools is with the "\fBzpool
874 upgrade\fR" command, though this property can be used when a specific version
875 is needed for backwards compatibility. Once feature flags is enabled on a
876 pool this property will no longer have a value.
879 .SS "Subcommands"
882 All subcommands that modify state are logged persistently to the pool in their
883 original form.
886 The \fBzpool\fR command provides subcommands to create and destroy storage
887 pools, add capacity to storage pools, and provide information about the storage
888 pools. The following subcommands are supported:
890 .ne 2
892 \fB\fBzpool\fR \fB-?\fR\fR
894 .sp .6
895 .RS 4n
896 Displays a help message.
900 .ne 2
902 \fB\fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...\fR
904 .sp .6
905 .RS 4n
906 Adds the specified virtual devices to the given pool. The \fIvdev\fR
907 specification is described in the "Virtual Devices" section. The behavior of
908 the \fB-f\fR option, and the device checks performed are described in the
909 "zpool create" subcommand.
911 .ne 2
913 \fB\fB-f\fR\fR
915 .RS 6n
916 Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting
917 replication level. Not all devices can be overridden in this manner.
921 .ne 2
923 \fB\fB-n\fR\fR
925 .RS 6n
926 Displays the configuration that would be used without actually adding the
927 \fBvdev\fRs. The actual pool creation can still fail due to insufficient
928 privileges or device sharing.
931 Do not add a disk that is currently configured as a quorum device to a zpool.
932 After a disk is in the pool, that disk can then be configured as a quorum
933 device.
937 .ne 2
939 \fB\fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
941 .sp .6
942 .RS 4n
943 Attaches \fInew_device\fR to an existing \fBzpool\fR device. The existing
944 device cannot be part of a \fBraidz\fR configuration. If \fIdevice\fR is not
945 currently part of a mirrored configuration, \fIdevice\fR automatically
946 transforms into a two-way mirror of \fIdevice\fR and \fInew_device\fR. If
947 \fIdevice\fR is part of a two-way mirror, attaching \fInew_device\fR creates a
948 three-way mirror, and so on. In either case, \fInew_device\fR begins to
949 resilver immediately.
951 .ne 2
953 \fB\fB-f\fR\fR
955 .RS 6n
956 Forces use of \fInew_device\fR, even if its appears to be in use. Not all
957 devices can be overridden in this manner.
963 .ne 2
965 \fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
967 .sp .6
968 .RS 4n
969 Clears device errors in a pool. If no arguments are specified, all device
970 errors within the pool are cleared. If one or more devices is specified, only
971 those errors associated with the specified device or devices are cleared.
975 .ne 2
977 \fB\fBzpool create\fR [\fB-fnd\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR
978 \fIfile-system-property=value\fR] ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR
979 \fIroot\fR] \fIpool\fR \fIvdev\fR ...\fR
981 .sp .6
982 .RS 4n
983 Creates a new storage pool containing the virtual devices specified on the
984 command line. The pool name must begin with a letter, and can only contain
985 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
986 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
987 names beginning with the pattern "c[0-9]". The \fBvdev\fR specification is
988 described in the "Virtual Devices" section.
990 The command verifies that each device specified is accessible and not currently
991 in use by another subsystem. There are some uses, such as being currently
992 mounted, or specified as the dedicated dump device, that prevents a device from
993 ever being used by \fBZFS\fR. Other uses, such as having a preexisting
994 \fBUFS\fR file system, can be overridden with the \fB-f\fR option.
996 The command also checks that the replication strategy for the pool is
997 consistent. An attempt to combine redundant and non-redundant storage in a
998 single pool, or to mix disks and files, results in an error unless \fB-f\fR is
999 specified. The use of differently sized devices within a single \fBraidz\fR or
1000 mirror group is also flagged as an error unless \fB-f\fR is specified.
1002 Unless the \fB-R\fR option is specified, the default mount point is
1003 "/\fIpool\fR". The mount point must not exist or must be empty, or else the
1004 root dataset cannot be mounted. This can be overridden with the \fB-m\fR
1005 option.
1007 By default all supported features are enabled on the new pool unless the
1008 \fB-d\fR option is specified.
1010 .ne 2
1012 \fB\fB-f\fR\fR
1014 .sp .6
1015 .RS 4n
1016 Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting
1017 replication level. Not all devices can be overridden in this manner.
1021 .ne 2
1023 \fB\fB-n\fR\fR
1025 .sp .6
1026 .RS 4n
1027 Displays the configuration that would be used without actually creating the
1028 pool. The actual pool creation can still fail due to insufficient privileges or
1029 device sharing.
1033 .ne 2
1035 \fB\fB-d\fR\fR
1037 .sp .6
1038 .RS 4n
1039 Do not enable any features on the new pool. Individual features can be enabled
1040 by setting their corresponding properties to \fBenabled\fR with the \fB-o\fR
1041 option. See \fBzpool-features\fR(5) for details about feature properties.
1045 .ne 2
1047 \fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
1049 .sp .6
1050 .RS 4n
1051 Sets the given pool properties. See the "Properties" section for a list of
1052 valid properties that can be set.
1056 .ne 2
1058 \fB\fB-O\fR \fIfile-system-property=value\fR\fR
1062 \fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
1064 .sp .6
1065 .RS 4n
1066 Sets the given file system properties in the root file system of the pool. See
1067 the "Properties" section of \fBzfs\fR(1M) for a list of valid properties that
1068 can be set.
1072 .ne 2
1074 \fB\fB-R\fR \fIroot\fR\fR
1076 .sp .6
1077 .RS 4n
1078 Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
1082 .ne 2
1084 \fB\fB-m\fR \fImountpoint\fR\fR
1086 .sp .6
1087 .RS 4n
1088 Sets the mount point for the root dataset. The default mount point is
1089 "/\fIpool\fR" or "\fBaltroot\fR/\fIpool\fR" if \fBaltroot\fR is specified. The
1090 mount point must be an absolute path, "\fBlegacy\fR", or "\fBnone\fR". For more
1091 information on dataset mount points, see \fBzfs\fR(1M).
1097 .ne 2
1099 \fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
1101 .sp .6
1102 .RS 4n
1103 Destroys the given pool, freeing up any devices for other use. This command
1104 tries to unmount any active datasets before destroying the pool.
1106 .ne 2
1108 \fB\fB-f\fR\fR
1110 .RS 6n
1111 Forces any active datasets contained within the pool to be unmounted.
1117 .ne 2
1119 \fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
1121 .sp .6
1122 .RS 4n
1123 Detaches \fIdevice\fR from a mirror. The operation is refused if there are no
1124 other valid replicas of the data.
1128 .ne 2
1130 \fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
1132 .sp .6
1133 .RS 4n
1134 Exports the given pools from the system. All devices are marked as exported,
1135 but are still considered in use by other subsystems. The devices can be moved
1136 between systems (even those of different endianness) and imported as long as a
1137 sufficient number of devices are present.
1139 Before exporting the pool, all datasets within the pool are unmounted. A pool
1140 can not be exported if it has a shared spare that is currently being used.
1142 For pools to be portable, you must give the \fBzpool\fR command whole disks,
1143 not just slices, so that \fBZFS\fR can label the disks with portable \fBEFI\fR
1144 labels. Otherwise, disk drivers on platforms of different endianness will not
1145 recognize the disks.
1147 .ne 2
1149 \fB\fB-f\fR\fR
1151 .RS 6n
1152 Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
1154 This command will forcefully export the pool even if it has a shared spare that
1155 is currently being used. This may lead to potential data corruption.
1161 .ne 2
1163 \fB\fBzpool get\fR [\fB-Hp\fR] [\fB-o \fR\fIfield\fR[,...]]  "\fIall\fR" | \fIproperty\fR[,...]
1164 \fIpool\fR ...\fR
1166 .sp .6
1167 .RS 4n
1168 Retrieves the given list of properties (or all properties if "\fBall\fR" is
1169 used) for the specified storage pool(s). These properties are displayed with
1170 the following fields:
1172 .in +2
1174         name          Name of storage pool
1175         property      Property name
1176         value         Property value
1177         source        Property source, either 'default' or 'local'.
1179 .in -2
1182 See the "Properties" section for more information on the available pool
1183 properties.
1186 .ne 2
1188 \fB\fB-H\fR\fR
1190 .RS 12n
1191 Scripted mode. Do not display headers, and separate fields by a single tab
1192 instead of arbitrary space.
1196 .ne 2
1198 \fB\fB-p\fR\fR
1200 .RS 6n
1201 Display numbers in parsable (exact) values.
1205 .ne 2
1207 \fB\fB-o\fR \fIfield\fR\fR
1209 .RS 6n
1210 A comma-separated list of columns to display. \fBname,property,value,source\fR
1211 is the default value.
1216 .ne 2
1218 \fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
1220 .sp .6
1221 .RS 4n
1222 Displays the command history of the specified pools or all pools if no pool is
1223 specified.
1225 .ne 2
1227 \fB\fB-i\fR\fR
1229 .RS 6n
1230 Displays internally logged \fBZFS\fR events in addition to user initiated
1231 events.
1235 .ne 2
1237 \fB\fB-l\fR\fR
1239 .RS 6n
1240 Displays log records in long format, which in addition to standard format
1241 includes, the user name, the hostname, and the zone in which the operation was
1242 performed.
1248 .ne 2
1250 \fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
1251 [\fB-D\fR]\fR
1253 .sp .6
1254 .RS 4n
1255 Lists pools available to import. If the \fB-d\fR option is not specified, this
1256 command searches for devices in "/dev/dsk". The \fB-d\fR option can be
1257 specified multiple times, and all directories are searched. If the device
1258 appears to be part of an exported pool, this command displays a summary of the
1259 pool with the name of the pool, a numeric identifier, as well as the \fIvdev\fR
1260 layout and current health of the device for each device or file. Destroyed
1261 pools, pools that were previously destroyed with the "\fBzpool destroy\fR"
1262 command, are not listed unless the \fB-D\fR option is specified.
1264 The numeric identifier is unique, and can be used instead of the pool name when
1265 multiple exported pools of the same name are available.
1267 .ne 2
1269 \fB\fB-c\fR \fIcachefile\fR\fR
1271 .RS 16n
1272 Reads configuration from the given \fBcachefile\fR that was created with the
1273 "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of
1274 searching for devices.
1278 .ne 2
1280 \fB\fB-d\fR \fIdir\fR\fR
1282 .RS 16n
1283 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be
1284 specified multiple times.
1288 .ne 2
1290 \fB\fB-D\fR\fR
1292 .RS 16n
1293 Lists destroyed pools only.
1299 .ne 2
1301 \fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR
1302 \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
1303 [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fB-a\fR\fR
1305 .sp .6
1306 .RS 4n
1307 Imports all pools found in the search directories. Identical to the previous
1308 command, except that all pools with a sufficient number of devices available
1309 are imported. Destroyed pools, pools that were previously destroyed with the
1310 "\fBzpool destroy\fR" command, will not be imported unless the \fB-D\fR option
1311 is specified.
1313 .ne 2
1315 \fB\fB-o\fR \fImntopts\fR\fR
1317 .RS 21n
1318 Comma-separated list of mount options to use when mounting datasets within the
1319 pool. See \fBzfs\fR(1M) for a description of dataset properties and mount
1320 options.
1324 .ne 2
1326 \fB\fB-o\fR \fIproperty=value\fR\fR
1328 .RS 21n
1329 Sets the specified property on the imported pool. See the "Properties" section
1330 for more information on the available pool properties.
1334 .ne 2
1336 \fB\fB-c\fR \fIcachefile\fR\fR
1338 .RS 21n
1339 Reads configuration from the given \fBcachefile\fR that was created with the
1340 "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of
1341 searching for devices.
1345 .ne 2
1347 \fB\fB-d\fR \fIdir\fR\fR
1349 .RS 21n
1350 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be
1351 specified multiple times. This option is incompatible with the \fB-c\fR option.
1355 .ne 2
1357 \fB\fB-D\fR\fR
1359 .RS 21n
1360 Imports destroyed pools only. The \fB-f\fR option is also required.
1364 .ne 2
1366 \fB\fB-f\fR\fR
1368 .RS 21n
1369 Forces import, even if the pool appears to be potentially active.
1373 .ne 2
1375 \fB\fB-F\fR\fR
1377 .RS 21n
1378 Recovery mode for a non-importable pool. Attempt to return the pool to an importable
1379 state by discarding the last few transactions. Not all damaged pools can be recovered
1380 by using this option. If successful, the data from the discarded transactions is
1381 irretrievably lost. This option is ignored if the pool is importable or already
1382 imported.
1386 .ne 2
1388 \fB\fB-a\fR\fR
1390 .RS 21n
1391 Searches for and imports all pools found.
1395 .ne 2
1397 \fB\fB-m\fR\fR
1399 .RS 21n
1400 Allows a pool to import when there is a missing log device. Recent transactions
1401 can be lost because the log device will be discarded.
1405 .ne 2
1407 \fB\fB-R\fR \fIroot\fR\fR
1409 .RS 21n
1410 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR"
1411 property to "\fIroot\fR".
1415 .ne 2
1417 \fB\fB-N\fR\fR
1419 .RS 21n
1420 Import the pool without mounting any file systems.
1424 .ne 2
1426 \fB\fB-n\fR\fR
1428 .RS 21n
1429 Used with the \fB-F\fR recovery option. Determines whether a non-importable pool can be made
1430 importable again, but does not actually perform the pool recovery. For more details about pool
1431 recovery mode, see the \fB-F\fR option, above.
1437 .ne 2
1439 \fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR
1440 \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
1441 [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fIpool\fR | \fIid\fR
1442 [\fInewpool\fR]\fR
1444 .sp .6
1445 .RS 4n
1446 Imports a specific pool. A pool can be identified by its name or the numeric
1447 identifier. If \fInewpool\fR is specified, the pool is imported using the name
1448 \fInewpool\fR. Otherwise, it is imported with the same name as its exported
1449 name.
1451 If a device is removed from a system without running "\fBzpool export\fR"
1452 first, the device appears as potentially active. It cannot be determined if
1453 this was a failed export, or whether the device is really in use from another
1454 host. To import a pool in this state, the \fB-f\fR option is required.
1456 .ne 2
1458 \fB\fB-o\fR \fImntopts\fR\fR
1460 .sp .6
1461 .RS 4n
1462 Comma-separated list of mount options to use when mounting datasets within the
1463 pool. See \fBzfs\fR(1M) for a description of dataset properties and mount
1464 options.
1468 .ne 2
1470 \fB\fB-o\fR \fIproperty=value\fR\fR
1472 .sp .6
1473 .RS 4n
1474 Sets the specified property on the imported pool. See the "Properties" section
1475 for more information on the available pool properties.
1479 .ne 2
1481 \fB\fB-c\fR \fIcachefile\fR\fR
1483 .sp .6
1484 .RS 4n
1485 Reads configuration from the given \fBcachefile\fR that was created with the
1486 "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of
1487 searching for devices.
1491 .ne 2
1493 \fB\fB-d\fR \fIdir\fR\fR
1495 .sp .6
1496 .RS 4n
1497 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be
1498 specified multiple times. This option is incompatible with the \fB-c\fR option.
1502 .ne 2
1504 \fB\fB-D\fR\fR
1506 .sp .6
1507 .RS 4n
1508 Imports destroyed pool. The \fB-f\fR option is also required.
1512 .ne 2
1514 \fB\fB-f\fR\fR
1516 .sp .6
1517 .RS 4n
1518 Forces import, even if the pool appears to be potentially active.
1522 .ne 2
1524 \fB\fB-F\fR\fR
1526 .sp .6
1527 .RS 4n
1528 Recovery mode for a non-importable pool. Attempt to return the pool to an importable
1529 state by discarding the last few transactions. Not all damaged pools can be recovered
1530 by using this option. If successful, the data from the discarded transactions is
1531 irretrievably lost. This option is ignored if the pool is importable or already imported.
1535 .ne 2
1537 \fB\fB-R\fR \fIroot\fR\fR
1539 .sp .6
1540 .RS 4n
1541 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR"
1542 property to "\fIroot\fR".
1546 .ne 2
1548 \fB\fB-n\fR\fR
1550 .sp .6
1551 .RS 4n
1552 Used with the \fB-F\fR recovery option. Determines whether a non-importable pool can be made
1553 importable again, but does not actually perform the pool recovery. For more details about pool
1554 recovery mode, see the \fB-F\fR option, above.
1558 .ne 2
1560 \fB\fB-m\fR\fR
1562 .sp .6
1563 .RS 4n
1564 Allows a pool to import when there is a missing log device. Recent transactions
1565 can be lost because the log device will be discarded.
1571 .ne 2
1573 \fB\fBzpool iostat\fR [\fB-T\fR \fBu\fR | \fBd\fR] [\fB-v\fR] [\fIpool\fR] ...
1574 [\fIinterval\fR[\fIcount\fR]]\fR
1576 .sp .6
1577 .RS 4n
1578 Displays \fBI/O\fR statistics for the given pools. When given an interval, the
1579 statistics are printed every \fIinterval\fR seconds until \fBCtrl-C\fR is
1580 pressed. If no \fIpools\fR are specified, statistics for every pool in the
1581 system is shown. If \fIcount\fR is specified, the command exits after
1582 \fIcount\fR reports are printed.
1584 .ne 2
1586 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1588 .RS 12n
1589 Display a time stamp.
1591 Specify \fBu\fR for a printed representation of the internal representation of
1592 time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
1593 \fBdate\fR(1).
1597 .ne 2
1599 \fB\fB-v\fR\fR
1601 .RS 12n
1602 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within
1603 the pool, in addition to the pool-wide statistics.
1609 .ne 2
1611 \fB\fBzpool list\fR [\fB-T\fR \fBu\fR | \fBd\fR] [\fB-Hv\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...
1612 [\fIinterval\fR[\fIcount\fR]]\fR
1614 .sp .6
1615 .RS 4n
1616 Lists the given pools along with a health status and space usage. If no \fIpools\fR are specified,
1617 all pools in the system are listed. When given an \fIinterval\fR, the information is printed every
1618 \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If \fIcount\fR is specified, the command exits
1619 after \fIcount\fR reports are printed.
1621 .ne 2
1623 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1625 .RS 12n
1626 Display a time stamp.
1628 Specify \fBu\fR for a printed representation of the internal representation of
1629 time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
1630 \fBdate\fR(1).
1634 .ne 2
1636 \fB\fB-H\fR\fR
1638 .RS 12n
1639 Scripted mode. Do not display headers, and separate fields by a single tab
1640 instead of arbitrary space.
1644 .ne 2
1646 \fB\fB-p\fR\fR
1648 .RS 12n
1649 Display numbers in parsable (exact) values.
1653 .ne 2
1655 \fB\fB-o\fR \fIprops\fR\fR
1657 .RS 12n
1658 Comma-separated list of properties to display. See the "Properties" section for
1659 a list of valid properties. The default list is "name, size, used, available,
1660 fragmentation, expandsize, capacity, dedupratio, health, altroot"
1664 .ne 2
1666 \fB\fB-v\fR\fR
1668 .RS 12n
1669 Verbose statistics.  Reports usage statistics for individual \fIvdevs\fR within
1670 the pool, in addition to the pool-wise statistics.
1676 .ne 2
1678 \fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1680 .sp .6
1681 .RS 4n
1682 Takes the specified physical device offline. While the \fIdevice\fR is offline,
1683 no attempt is made to read or write to the device.
1685 This command is not applicable to spares or cache devices.
1687 .ne 2
1689 \fB\fB-t\fR\fR
1691 .RS 6n
1692 Temporary. Upon reboot, the specified physical device reverts to its previous
1693 state.
1699 .ne 2
1701 \fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1703 .sp .6
1704 .RS 4n
1705 Brings the specified physical device online.
1707 This command is not applicable to spares or cache devices.
1709 .ne 2
1711 \fB\fB-e\fR\fR
1713 .RS 6n
1714 Expand the device to use all available space. If the device is part of a mirror
1715 or \fBraidz\fR then all devices must be expanded before the new space will
1716 become available to the pool.
1722 .ne 2
1724 \fB\fBzpool reguid\fR \fIpool\fR
1726 .sp .6
1727 .RS 4n
1728 Generates a new unique identifier for the pool. You must ensure that all
1729 devices in this pool are online and healthy before performing this action.
1733 .ne 2
1735 \fB\fBzpool reopen\fR \fIpool\fR
1737 .sp .6
1738 .RS 4n
1739 Reopen all the vdevs associated with the pool.
1743 .ne 2
1745 \fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1747 .sp .6
1748 .RS 4n
1749 Removes the specified device from the pool. This command currently only
1750 supports removing hot spares, cache, and log devices. A mirrored log device can
1751 be removed by specifying the top-level mirror for the log. Non-log devices that
1752 are part of a mirrored configuration can be removed using the \fBzpool
1753 detach\fR command. Non-redundant and \fBraidz\fR devices cannot be removed from
1754 a pool.
1758 .ne 2
1760 \fB\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIold_device\fR
1761 [\fInew_device\fR]\fR
1763 .sp .6
1764 .RS 4n
1765 Replaces \fIold_device\fR with \fInew_device\fR. This is equivalent to
1766 attaching \fInew_device\fR, waiting for it to resilver, and then detaching
1767 \fIold_device\fR.
1769 The size of \fInew_device\fR must be greater than or equal to the minimum size
1770 of all the devices in a mirror or \fBraidz\fR configuration.
1772 \fInew_device\fR is required if the pool is not redundant. If \fInew_device\fR
1773 is not specified, it defaults to \fIold_device\fR. This form of replacement is
1774 useful after an existing disk has failed and has been physically replaced. In
1775 this case, the new disk may have the same \fB/dev/dsk\fR path as the old
1776 device, even though it is actually a different disk. \fBZFS\fR recognizes this.
1778 .ne 2
1780 \fB\fB-f\fR\fR
1782 .RS 6n
1783 Forces use of \fInew_device\fR, even if its appears to be in use. Not all
1784 devices can be overridden in this manner.
1790 .ne 2
1792 \fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1794 .sp .6
1795 .RS 4n
1796 Begins a scrub. The scrub examines all data in the specified pools to verify
1797 that it checksums correctly. For replicated (mirror or \fBraidz\fR) devices,
1798 \fBZFS\fR automatically repairs any damage discovered during the scrub. The
1799 "\fBzpool status\fR" command reports the progress of the scrub and summarizes
1800 the results of the scrub upon completion.
1802 Scrubbing and resilvering are very similar operations. The difference is that
1803 resilvering only examines data that \fBZFS\fR knows to be out of date (for
1804 example, when attaching a new device to a mirror or replacing an existing
1805 device), whereas scrubbing examines all data to discover silent errors due to
1806 hardware faults or disk failure.
1808 Because scrubbing and resilvering are \fBI/O\fR-intensive operations, \fBZFS\fR
1809 only allows one at a time. If a scrub is already in progress, the "\fBzpool
1810 scrub\fR" command terminates it and starts a new scrub. If a resilver is in
1811 progress, \fBZFS\fR does not allow a scrub to be started until the resilver
1812 completes.
1814 .ne 2
1816 \fB\fB-s\fR\fR
1818 .RS 6n
1819 Stop scrubbing.
1825 .ne 2
1827 \fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1829 .sp .6
1830 .RS 4n
1831 Sets the given property on the specified pool. See the "Properties" section for
1832 more information on what properties can be set and acceptable values.
1836 .ne 2
1838 \fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR \fBu\fR | \fBd\fR ] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
1840 .sp .6
1841 .RS 4n
1842 Displays the detailed health status for the given pools. If no \fIpool\fR is
1843 specified, then the status of each pool in the system is displayed. For more
1844 information on pool and device health, see the "Device Failure and Recovery"
1845 section.
1847 If a scrub or resilver is in progress, this command reports the percentage done
1848 and the estimated time to completion. Both of these are only approximate,
1849 because the amount of data in the pool and the other workloads on the system
1850 can change.
1852 .ne 2
1854 \fB\fB-x\fR\fR
1856 .RS 6n
1857 Only display status for pools that are exhibiting errors or are otherwise
1858 unavailable. Warnings about pools not using the latest on-disk format will
1859 not be included.
1863 .ne 2
1865 \fB\fB-v\fR\fR
1867 .RS 6n
1868 Displays verbose data error information, printing out a complete list of all
1869 data errors since the last complete pool scrub.
1873 .ne 2
1875 \fB\fB-D\fR\fR
1877 .RS 6n
1878 Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and
1879 referenced (logically referenced in the pool) block counts and sizes by reference count.
1883 .ne 2
1885 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1887 .RS 12n
1888 Display a time stamp.
1890 Specify \fBu\fR for a printed representation of the internal representation of
1891 time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
1892 \fBdate\fR(1).
1898 .ne 2
1900 \fB\fBzpool upgrade\fR\fR
1902 .sp .6
1903 .RS 4n
1904 Displays pools which do not have all supported features enabled and pools
1905 formatted using a legacy ZFS version number. These pools can continue to be
1906 used, but some features may not be available. Use "\fBzpool upgrade -a\fR"
1907 to enable all features on all pools.
1911 .ne 2
1913 \fB\fBzpool upgrade\fR \fB-v\fR\fR
1915 .sp .6
1916 .RS 4n
1917 Displays legacy \fBZFS\fR versions supported by the current software. See
1918 \fBzpool-features\fR(5) for a description of feature flags features supported
1919 by the current software.
1923 .ne 2
1925 \fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1927 .sp .6
1928 .RS 4n
1929 Enables all supported features on the given pool. Once this is done, the
1930 pool will no longer be accessible on systems that do not support feature
1931 flags. See \fBzpool-features\fR(5) for details on compatibility with systems
1932 that support feature flags, but do not support all features enabled on the
1933 pool.
1935 .ne 2
1937 \fB\fB-a\fR\fR
1939 .RS 14n
1940 Enables all supported features on all pools.
1944 .ne 2
1946 \fB\fB-V\fR \fIversion\fR\fR
1948 .RS 14n
1949 Upgrade to the specified legacy version. If the \fB-V\fR flag is specified, no
1950 features will be enabled on the pool. This option can only be used to increase
1951 the version number up to the last supported legacy version number.
1956 .SH EXAMPLES
1958 \fBExample 1 \fRCreating a RAID-Z Storage Pool
1961 The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR
1962 that consists of six disks.
1965 .in +2
1967 # \fBzpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0\fR
1969 .in -2
1973 \fBExample 2 \fRCreating a Mirrored Storage Pool
1976 The following command creates a pool with two mirrors, where each mirror
1977 contains two disks.
1980 .in +2
1982 # \fBzpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0\fR
1984 .in -2
1988 \fBExample 3 \fRCreating a ZFS Storage Pool by Using Slices
1991 The following command creates an unmirrored pool using two disk slices.
1994 .in +2
1996 # \fBzpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4\fR
1998 .in -2
2002 \fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
2005 The following command creates an unmirrored pool using files. While not
2006 recommended, a pool based on files can be useful for experimental purposes.
2009 .in +2
2011 # \fBzpool create tank /path/to/file/a /path/to/file/b\fR
2013 .in -2
2017 \fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
2020 The following command adds two mirrored disks to the pool "\fItank\fR",
2021 assuming the pool is already made up of two-way mirrors. The additional space
2022 is immediately available to any datasets within the pool.
2025 .in +2
2027 # \fBzpool add tank mirror c1t0d0 c1t1d0\fR
2029 .in -2
2033 \fBExample 6 \fRListing Available ZFS Storage Pools
2036 The following command lists all available pools on the system. In this case,
2037 the pool \fIzion\fR is faulted due to a missing device.
2041 The results from this command are similar to the following:
2044 .in +2
2046 # \fBzpool list\fR
2047 NAME    SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
2048 rpool  19.9G  8.43G  11.4G    33%         -    42%  1.00x  ONLINE  -
2049 tank   61.5G  20.0G  41.5G    48%         -    32%  1.00x  ONLINE  -
2050 zion       -      -      -      -         -      -      -  FAULTED -
2052 .in -2
2056 \fBExample 7 \fRDestroying a ZFS Storage Pool
2059 The following command destroys the pool "\fItank\fR" and any datasets contained
2060 within.
2063 .in +2
2065 # \fBzpool destroy -f tank\fR
2067 .in -2
2071 \fBExample 8 \fRExporting a ZFS Storage Pool
2074 The following command exports the devices in pool \fItank\fR so that they can
2075 be relocated or later imported.
2078 .in +2
2080 # \fBzpool export tank\fR
2082 .in -2
2086 \fBExample 9 \fRImporting a ZFS Storage Pool
2089 The following command displays available pools, and then imports the pool
2090 "tank" for use on the system.
2094 The results from this command are similar to the following:
2097 .in +2
2099 # \fBzpool import\fR
2100   pool: tank
2101     id: 15451357997522795478
2102  state: ONLINE
2103 action: The pool can be imported using its name or numeric identifier.
2104 config:
2106         tank        ONLINE
2107           mirror    ONLINE
2108             c1t2d0  ONLINE
2109             c1t3d0  ONLINE
2111 # \fBzpool import tank\fR
2113 .in -2
2117 \fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
2120 The following command upgrades all ZFS Storage pools to the current version of
2121 the software.
2124 .in +2
2126 # \fBzpool upgrade -a\fR
2127 This system is currently running ZFS version 2.
2129 .in -2
2133 \fBExample 11 \fRManaging Hot Spares
2136 The following command creates a new pool with an available hot spare:
2139 .in +2
2141 # \fBzpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0\fR
2143 .in -2
2148 If one of the disks were to fail, the pool would be reduced to the degraded
2149 state. The failed device can be replaced using the following command:
2152 .in +2
2154 # \fBzpool replace tank c0t0d0 c0t3d0\fR
2156 .in -2
2161 Once the data has been resilvered, the spare is automatically removed and is
2162 made available should another device fails. The hot spare can be permanently
2163 removed from the pool using the following command:
2166 .in +2
2168 # \fBzpool remove tank c0t2d0\fR
2170 .in -2
2174 \fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
2177 The following command creates a ZFS storage pool consisting of two, two-way
2178 mirrors and mirrored log devices:
2181 .in +2
2183 # \fBzpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
2184    c4d0 c5d0\fR
2186 .in -2
2190 \fBExample 13 \fRAdding Cache Devices to a ZFS Pool
2193 The following command adds two disks for use as cache devices to a ZFS storage
2194 pool:
2197 .in +2
2199 # \fBzpool add pool cache c2d0 c3d0\fR
2201 .in -2
2206 Once added, the cache devices gradually fill with content from main memory.
2207 Depending on the size of your cache devices, it could take over an hour for
2208 them to fill. Capacity and reads can be monitored using the \fBiostat\fR option
2209 as follows:
2212 .in +2
2214 # \fBzpool iostat -v pool 5\fR
2216 .in -2
2220 \fBExample 14 \fRRemoving a Mirrored Log Device
2223 The following command removes the mirrored log device \fBmirror-2\fR.
2227 Given this configuration:
2230 .in +2
2232    pool: tank
2233   state: ONLINE
2234   scrub: none requested
2235 config:
2237          NAME        STATE     READ WRITE CKSUM
2238          tank        ONLINE       0     0     0
2239            mirror-0  ONLINE       0     0     0
2240              c6t0d0  ONLINE       0     0     0
2241              c6t1d0  ONLINE       0     0     0
2242            mirror-1  ONLINE       0     0     0
2243              c6t2d0  ONLINE       0     0     0
2244              c6t3d0  ONLINE       0     0     0
2245          logs
2246            mirror-2  ONLINE       0     0     0
2247              c4t0d0  ONLINE       0     0     0
2248              c4t1d0  ONLINE       0     0     0
2250 .in -2
2255 The command to remove the mirrored log \fBmirror-2\fR is:
2258 .in +2
2260 # \fBzpool remove tank mirror-2\fR
2262 .in -2
2266 \fBExample 15 \fRDisplaying expanded space on a device
2269 The following command dipslays the detailed information for the \fIdata\fR
2270 pool. This pool is comprised of a single \fIraidz\fR vdev where one of its
2271 devices increased its capacity by 10GB. In this example, the pool will not
2272 be able to utilized this extra capacity until all the devices under the
2273 \fIraidz\fR vdev have been expanded.
2276 .in +2
2278 # \fBzpool list -v data\fR
2279 NAME         SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
2280 data        23.9G  14.6G  9.30G    48%         -    61%  1.00x  ONLINE  -
2281   raidz1    23.9G  14.6G  9.30G    48%         -
2282     c1t1d0      -      -      -      -         -
2283     c1t2d0      -      -      -      -       10G
2284     c1t3d0      -      -      -      -         -
2286 .in -2
2288 .SH EXIT STATUS
2291 The following exit values are returned:
2293 .ne 2
2295 \fB\fB0\fR\fR
2297 .RS 5n
2298 Successful completion.
2302 .ne 2
2304 \fB\fB1\fR\fR
2306 .RS 5n
2307 An error occurred.
2311 .ne 2
2313 \fB\fB2\fR\fR
2315 .RS 5n
2316 Invalid command line options were specified.
2319 .SH ATTRIBUTES
2322 See \fBattributes\fR(5) for descriptions of the following attributes:
2327 box;
2328 c | c
2329 l | l .
2330 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2332 Interface Stability     Evolving
2335 .SH SEE ALSO
2338 \fBzfs\fR(1M), \fBzpool-features\fR(5), \fBattributes\fR(5)