4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
22 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23 .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24 .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
25 .\" Copyright (c) 2017 Datto Inc.
26 .\" Copyright (c) 2018 George Melikov. All Rights Reserved.
27 .\" Copyright 2017 Nexenta Systems, Inc.
28 .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
35 .Nd configure ZFS storage pools
42 .Oo Fl o Ar property Ns = Ns Ar value Oc
47 .Oo Fl o Ar property Ns = Ns Ar value Oc
48 .Ar pool device new_device
60 .Op Fl m Ar mountpoint
61 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
62 .Oo Fl o Ar feature@feature Ns = Ns Ar value Oc
63 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
75 .Op Fl vHf Oo Ar pool Oc | Fl c
84 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
85 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
94 .Op Fl d Ar dir Ns | Ns device
99 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
100 .Op Fl -rewind-to-checkpoint
101 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
103 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
108 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
109 .Op Fl -rewind-to-checkpoint
110 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
112 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
115 .Ar pool Ns | Ns Ar id
116 .Op Ar newpool Oo Fl t Oc
119 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
120 .Op Fl T Sy u Ns | Ns Sy d
122 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
123 .Op Ar interval Op Ar count
131 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
132 .Op Fl T Sy u Ns | Ns Sy d
133 .Oo Ar pool Oc Ns ...
134 .Op Ar interval Op Ar count
139 .Ar pool Ar device Ns ...
143 .Ar pool Ar device Ns ...
154 .Ar pool Ar device Ns ...
162 .Oo Fl o Ar property Ns = Ns Ar value Oc
163 .Ar pool Ar device Op Ar new_device
170 .Ar property Ns = Ns Ar value
175 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
178 .Oo Ar device Oc Ns ...
181 .Oo Fl c Ar SCRIPT Oc
183 .Op Fl T Sy u Ns | Ns Sy d
184 .Oo Ar pool Oc Ns ...
185 .Op Ar interval Op Ar count
188 .Oo Ar pool Oc Ns ...
197 .Fl a Ns | Ns Ar pool Ns ...
201 command configures ZFS storage pools.
202 A storage pool is a collection of devices that provides physical storage and
203 data replication for ZFS datasets.
204 All datasets within a storage pool share the same space.
207 for information on managing datasets.
208 .Ss Virtual Devices (vdevs)
209 A "virtual device" describes a single device or a collection of devices
210 organized according to certain performance and fault characteristics.
211 The following virtual devices are supported:
214 A block device, typically located under
216 ZFS can use individual slices or partitions, though the recommended mode of
217 operation is to use whole disks.
218 A disk can be specified by a full path, or it can be a shorthand name
219 .Po the relative portion of the path under
222 A whole disk can be specified by omitting the slice or partition designation.
227 When given a whole disk, ZFS automatically labels the disk, if necessary.
230 The use of files as a backing store is strongly discouraged.
231 It is designed primarily for experimental purposes, as the fault tolerance of a
232 file is only as good as the file system of which it is a part.
233 A file must be specified by a full path.
235 A mirror of two or more devices.
236 Data is replicated in an identical fashion across all components of a mirror.
237 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
238 failing before data integrity is compromised.
239 .It Sy raidz , raidz1 , raidz2 , raidz3
240 A variation on RAID-5 that allows for better distribution of parity and
241 eliminates the RAID-5
243 .Pq in which data and parity become inconsistent after a power loss .
244 Data and parity is striped across all disks within a raidz group.
246 A raidz group can have single-, double-, or triple-parity, meaning that the
247 raidz group can sustain one, two, or three failures, respectively, without
251 vdev type specifies a single-parity raidz group; the
253 vdev type specifies a double-parity raidz group; and the
255 vdev type specifies a triple-parity raidz group.
258 vdev type is an alias for
261 A raidz group with N disks of size X with P parity disks can hold approximately
262 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
264 The minimum number of devices in a raidz group is one more than the number of
266 The recommended number is between 3 and 9 to help increase performance.
268 A special pseudo-vdev which keeps track of available hot spares for a pool.
269 For more information, see the
273 A separate intent log device.
274 If more than one log device is specified, then writes are load-balanced between
276 Log devices can be mirrored.
277 However, raidz vdev types are not supported for the intent log.
278 For more information, see the
282 A device dedicated solely for allocating dedup data.
283 The redundancy of this device should match the redundancy of the other normal
284 devices in the pool. If more than one dedup device is specified, then
285 allocations are load-balanced between devices.
287 A device dedicated solely for allocating various kinds of internal metadata,
288 and optionally small file data.
289 The redundancy of this device should match the redundancy of the other normal
290 devices in the pool. If more than one special device is specified, then
291 allocations are load-balanced between devices.
293 For more information on special allocations, see the
294 .Sx Special Allocation Class
297 A device used to cache storage pool data.
298 A cache device cannot be configured as a mirror or raidz group.
299 For more information, see the
304 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
305 contain files or disks.
307 .Pq or other combinations
310 A pool can have any number of virtual devices at the top of the configuration
314 Data is dynamically distributed across all top-level devices to balance data
316 As new virtual devices are added, ZFS automatically places data on the newly
319 Virtual devices are specified one at a time on the command line, separated by
325 are used to distinguish where a group ends and another begins.
326 For example, the following creates two root vdevs, each a mirror of two disks:
328 # zpool create mypool mirror sda sdb mirror sdc sdd
330 .Ss Device Failure and Recovery
331 ZFS supports a rich set of mechanisms for handling device failure and data
333 All metadata and data is checksummed, and ZFS automatically repairs bad data
334 from a good copy when corruption is detected.
336 In order to take advantage of these features, a pool must make use of some form
337 of redundancy, using either mirrored or raidz groups.
338 While ZFS supports running in a non-redundant configuration, where each root
339 vdev is simply a disk or file, this is strongly discouraged.
340 A single case of bit corruption can render some or all of your data unavailable.
342 A pool's health status is described by one of three states: online, degraded,
344 An online pool has all devices operating normally.
345 A degraded pool is one in which one or more devices have failed, but the data is
346 still available due to a redundant configuration.
347 A faulted pool has corrupted metadata, or one or more faulted devices, and
348 insufficient replicas to continue functioning.
350 The health of the top-level vdev, such as mirror or raidz device, is
351 potentially impacted by the state of its associated vdevs, or component
353 A top-level vdev or component device is in one of the following states:
354 .Bl -tag -width "DEGRADED"
356 One or more top-level vdevs is in the degraded state because one or more
357 component devices are offline.
358 Sufficient replicas exist to continue functioning.
360 One or more component devices is in the degraded or faulted state, but
361 sufficient replicas exist to continue functioning.
362 The underlying conditions are as follows:
365 The number of checksum errors exceeds acceptable levels and the device is
366 degraded as an indication that something may be wrong.
367 ZFS continues to use the device as necessary.
369 The number of I/O errors exceeds acceptable levels.
370 The device could not be marked as faulted because there are insufficient
371 replicas to continue functioning.
374 One or more top-level vdevs is in the faulted state because one or more
375 component devices are offline.
376 Insufficient replicas exist to continue functioning.
378 One or more component devices is in the faulted state, and insufficient
379 replicas exist to continue functioning.
380 The underlying conditions are as follows:
383 The device could be opened, but the contents did not match expected values.
385 The number of I/O errors exceeds acceptable levels and the device is faulted to
386 prevent further use of the device.
389 The device was explicitly taken offline by the
393 The device is online and functioning.
395 The device was physically removed while the system was running.
396 Device removal detection is hardware-dependent and may not be supported on all
399 The device could not be opened.
400 If a pool is imported when a device was unavailable, then the device will be
401 identified by a unique identifier instead of its path since the path was never
402 correct in the first place.
405 If a device is removed and later re-attached to the system, ZFS attempts
406 to put the device online automatically.
407 Device attach detection is hardware-dependent and might not be supported on all
410 ZFS allows devices to be associated with pools as
412 These devices are not actively used in the pool, but when an active device
413 fails, it is automatically replaced by a hot spare.
414 To create a pool with hot spares, specify a
416 vdev with any number of devices.
419 # zpool create pool mirror sda sdb spare sdc sdd
422 Spares can be shared across multiple pools, and can be added with the
424 command and removed with the
427 Once a spare replacement is initiated, a new
429 vdev is created within the configuration that will remain there until the
430 original device is replaced.
431 At this point, the hot spare becomes available again if another device fails.
433 If a pool has a shared spare that is currently being used, the pool can not be
434 exported since other pools may use this shared spare, which may lead to
435 potential data corruption.
437 An in-progress spare replacement can be cancelled by detaching the hot spare.
438 If the original faulted device is detached, then the hot spare assumes its
439 place in the configuration, and is removed from the spare list of all active
442 Spares cannot replace log devices.
444 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
446 For instance, databases often require their transactions to be on stable storage
447 devices when returning from a system call.
448 NFS and other applications can also use
450 to ensure data stability.
451 By default, the intent log is allocated from blocks within the main pool.
452 However, it might be possible to get better performance using separate intent
453 log devices such as NVRAM or a dedicated disk.
456 # zpool create pool sda sdb log sdc
459 Multiple log devices can also be specified, and they can be mirrored.
462 section for an example of mirroring multiple log devices.
464 Log devices can be added, replaced, attached, detached and removed. In
465 addition, log devices are imported and exported as part of the pool
467 Mirrored devices can be removed by specifying the top-level mirror vdev.
469 Devices can be added to a storage pool as
471 These devices provide an additional layer of caching between main memory and
473 For read-heavy workloads, where the working set size is much larger than what
474 can be cached in main memory, using cache devices allow much more of this
475 working set to be served from low latency media.
476 Using cache devices provides the greatest performance improvement for random
477 read-workloads of mostly static content.
479 To create a pool with cache devices, specify a
481 vdev with any number of devices.
484 # zpool create pool sda sdb cache sdc sdd
487 Cache devices cannot be mirrored or part of a raidz configuration.
488 If a read error is encountered on a cache device, that read I/O is reissued to
489 the original storage pool device, which might be part of a mirrored or raidz
492 The content of the cache devices is considered volatile, as is the case with
495 Before starting critical procedures that include destructive actions (e.g
497 ), an administrator can checkpoint the pool's state and in the case of a
498 mistake or failure, rewind the entire pool back to the checkpoint.
499 Otherwise, the checkpoint can be discarded when the procedure has completed
502 A pool checkpoint can be thought of as a pool-wide snapshot and should be used
503 with care as it contains every part of the pool's state, from properties to vdev
505 Thus, while a pool has a checkpoint certain operations are not allowed.
506 Specifically, vdev removal/attach/detach, mirror splitting, and
507 changing the pool's guid.
508 Adding a new vdev is supported but in the case of a rewind it will have to be
510 Finally, users of this feature should keep in mind that scrubs in a pool that
511 has a checkpoint do not repair checkpointed data.
513 To create a checkpoint for a pool:
515 # zpool checkpoint pool
518 To later rewind to its checkpointed state, you need to first export it and
519 then rewind it during import:
522 # zpool import --rewind-to-checkpoint pool
525 To discard the checkpoint from a pool:
527 # zpool checkpoint -d pool
530 Dataset reservations (controlled by the
534 zfs properties) may be unenforceable while a checkpoint exists, because the
535 checkpoint is allowed to consume the dataset's reservation.
536 Finally, data that is part of the checkpoint but has been freed in the
537 current state of the pool won't be scanned during a scrub.
538 .Ss Special Allocation Class
539 The allocations in the special class are dedicated to specific block types.
540 By default this includes all metadata, the indirect blocks of user data, and
541 any dedup data. The class can also be provisioned to accept a limited
542 percentage of small file data blocks.
544 A pool must always have at least one general (non-specified) vdev before
545 other devices can be assigned to the special class. If the special class
546 becomes full, then allocations intended for it will spill back into the
549 Dedup data can be excluded from the special class by setting the
550 .Sy zfs_ddt_data_is_special
551 zfs module parameter to false (0).
553 Inclusion of small file blocks in the special class is opt-in. Each dataset
554 can control the size of small file blocks allowed in the special class by
556 .Sy special_small_blocks
557 dataset property. It defaults to zero so you must opt-in by setting it to a
560 for more info on setting this property.
562 Each pool has several properties associated with it.
563 Some properties are read-only statistics while others are configurable and
564 change the behavior of the pool.
566 The following are read-only properties:
569 Amount of storage used within the pool.
571 Percentage of pool space used.
572 This property can also be referred to by its shortened column name,
575 Amount of uninitialized space within the pool or device that can be used to
576 increase the total capacity of the pool.
577 Uninitialized space consists of any space on an EFI labeled vdev which has not
580 .Nm zpool Cm online Fl e
582 This space occurs when a LUN is dynamically expanded.
584 The amount of fragmentation in the pool.
586 The amount of free space available in the pool.
588 After a file system or snapshot is destroyed, the space it was using is
589 returned to the pool asynchronously.
591 is the amount of space remaining to be reclaimed.
598 The current health of the pool.
600 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
602 A unique identifier for the pool.
604 A unique identifier for the pool.
607 property, this identifier is generated every time we load the pool (e.g. does
608 not persist across imports/exports) and never changes while the pool is loaded
611 operation takes place).
613 Total size of the storage pool.
614 .It Sy unsupported@ Ns Em feature_guid
615 Information about unsupported features that are enabled on the pool.
621 The space usage properties report actual physical space available to the
623 The physical space can be different from the total amount of space that any
624 contained datasets can actually use.
625 The amount of space used in a raidz configuration depends on the characteristics
626 of the data being written.
627 In addition, ZFS reserves some space for internal accounting that the
629 command takes into account, but the
632 For non-full pools of a reasonable size, these effects should be invisible.
633 For small pools, or pools that are close to being completely full, these
634 discrepancies may become more noticeable.
636 The following property can be set at creation time and import time:
639 Alternate root directory.
640 If set, this directory is prepended to any mount points within the pool.
641 This can be used when examining an unknown pool where the mount points cannot be
642 trusted, or in an alternate boot environment, where the typical paths are not
645 is not a persistent property.
646 It is valid only while the system is up.
650 .Sy cachefile Ns = Ns Sy none ,
651 though this may be overridden using an explicit setting.
654 The following property can be set only at import time:
656 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
659 the pool will be imported in read-only mode.
660 This property can also be referred to by its shortened column name,
664 The following properties can be set at creation time and import time, and later
669 .It Sy ashift Ns = Ns Sy ashift
670 Pool sector size exponent, to the power of
672 (internally referred to as
674 ). Values from 9 to 16, inclusive, are valid; also, the special
675 value 0 (the default) means to auto-detect using the kernel's block
676 layer and a ZFS internal exception list. I/O operations will be aligned
677 to the specified size boundaries. Additionally, the minimum (disk)
678 write size will be set to the specified size, so this represents a
679 space vs. performance trade-off. For optimal performance, the pool
680 sector size should be greater than or equal to the sector size of the
681 underlying disks. The typical case for setting this property is when
682 performance is important and the underlying disks use 4KiB sectors but
683 report 512B sectors to the OS (for compatibility reasons); in that
686 (which is 1<<12 = 4096). When set, this property is
687 used as the default hint value in subsequent vdev operations (add,
688 attach and replace). Changing this value will not modify any existing
689 vdev, not even on disk replacement; however it can be used, for
690 instance, to replace a dying 512B sectors disk with a newer 4KiB
691 sectors device: this will probably result in bad performance but at the
692 same time could prevent loss of data.
693 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
694 Controls automatic pool expansion when the underlying LUN is grown.
697 the pool will be resized according to the size of the expanded device.
698 If the device is part of a mirror or raidz then all devices within that
699 mirror/raidz group must be expanded before the new space is made available to
701 The default behavior is
703 This property can also be referred to by its shortened column name,
705 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
706 Controls automatic device replacement.
709 device replacement must be initiated by the administrator by using the
714 any new device, found in the same physical location as a device that previously
715 belonged to the pool, is automatically formatted and replaced.
716 The default behavior is
718 This property can also be referred to by its shortened column name,
720 Autoreplace can also be used with virtual disks (like device
721 mapper) provided that you use the /dev/disk/by-vdev paths setup by
722 vdev_id.conf. See the
724 man page for more details.
725 Autoreplace and autoonline require the ZFS Event Daemon be configured and
728 man page for more details.
729 .It Sy bootfs Ns = Ns Sy (unset) Ns | Ns Ar pool Ns / Ns Ar dataset
730 Identifies the default bootable dataset for the root pool. This property is
731 expected to be set mainly by the installation and upgrade programs.
732 Not all Linux distribution boot processes use the bootfs property.
733 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
734 Controls the location of where the pool configuration is cached.
735 Discovering all pools on system startup requires a cached copy of the
736 configuration data that is stored on the root file system.
737 All pools in this cache are automatically imported when the system boots.
738 Some environments, such as install and clustering, need to cache this
739 information in a different location so that pools are not automatically
741 Setting this property caches the pool configuration in a different location that
742 can later be imported with
743 .Nm zpool Cm import Fl c .
744 Setting it to the special value
746 creates a temporary pool that is never cached, and the special value
749 uses the default location.
751 Multiple pools can share the same cache file.
752 Because the kernel destroys and recreates this file when pools are added and
753 removed, care should be taken when attempting to access this file.
754 When the last pool using a
756 is exported or destroyed, the file will be empty.
757 .It Sy comment Ns = Ns Ar text
758 A text string consisting of printable ASCII characters that will be stored
759 such that it is available even if the pool becomes faulted.
760 An administrator can provide additional information about a pool using this
762 .It Sy dedupditto Ns = Ns Ar number
763 Threshold for the number of block ditto copies.
764 If the reference count for a deduplicated block increases above this number, a
765 new ditto copy of this block is automatically stored.
766 The default setting is
768 which causes no ditto copies to be created for deduplicated blocks.
769 The minimum legal nonzero setting is
771 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
772 Controls whether a non-privileged user is granted access based on the dataset
773 permissions defined on the dataset.
776 for more information on ZFS delegated administration.
777 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
778 Controls the system behavior in the event of catastrophic pool failure.
779 This condition is typically a result of a loss of connectivity to the underlying
780 storage device(s) or a failure of all devices within the pool.
781 The behavior of such an event is determined as follows:
782 .Bl -tag -width "continue"
784 Blocks all I/O access until the device connectivity is recovered and the errors
786 This is the default behavior.
790 to any new write I/O requests but allows reads to any of the remaining healthy
792 Any write requests that have yet to be committed to disk would be blocked.
794 Prints out a message to the console and generates a system crash dump.
796 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
797 The value of this property is the current state of
799 The only valid value when setting this property is
803 to the enabled state.
806 for details on feature states.
807 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
808 Controls whether information about snapshots associated with this pool is
816 This property can also be referred to by its shortened name,
818 .It Sy multihost Ns = Ns Sy on Ns | Ns Sy off
819 Controls whether a pool activity check should be performed during
820 .Nm zpool Cm import .
821 When a pool is determined to be active it cannot be imported, even with the
823 option. This property is intended to be used in failover configurations
824 where multiple hosts have access to a pool on shared storage. When this
825 property is on, periodic writes to storage occur to show the pool is in use.
827 .Sy zfs_multihost_interval
829 .Xr zfs-module-parameters 5
830 man page. In order to enable this property each host must set a unique hostid.
834 .Xr spl-module-parameters 5
835 for additional details. The default value is
837 .It Sy version Ns = Ns Ar version
838 The current on-disk version of the pool.
839 This can be increased, but never decreased.
840 The preferred method of updating pools is with the
842 command, though this property can be used when a specific version is needed for
843 backwards compatibility.
844 Once feature flags are enabled on a pool this property will no longer have a
848 All subcommands that modify state are logged persistently to the pool in their
853 command provides subcommands to create and destroy storage pools, add capacity
854 to storage pools, and provide information about the storage pools.
855 The following subcommands are supported:
861 Displays a help message.
866 .Oo Fl o Ar property Ns = Ns Ar value Oc
869 Adds the specified virtual devices to the given pool.
872 specification is described in the
877 option, and the device checks performed are described in the
884 even if they appear in use or specify a conflicting replication level.
885 Not all devices can be overridden in this manner.
889 GUIDs instead of the normal device names. These GUIDs can be used in place of
890 device names for the zpool detach/offline/remove/replace commands.
892 Display real paths for
894 resolving all symbolic links. This can be used to look up the current block
895 device name regardless of the /dev/disk/ path used to open it.
897 Displays the configuration that would be used without actually adding the
899 The actual pool creation can still fail due to insufficient privileges or
902 Display real paths for
904 instead of only the last component of the path. This can be used in
908 .It Fl o Ar property Ns = Ns Ar value
909 Sets the given pool properties. See the
911 section for a list of valid properties that can be set. The only property
912 supported at the moment is ashift.
918 .Oo Fl o Ar property Ns = Ns Ar value Oc
919 .Ar pool device new_device
925 The existing device cannot be part of a raidz configuration.
928 is not currently part of a mirrored configuration,
930 automatically transforms into a two-way mirror of
936 is part of a two-way mirror, attaching
938 creates a three-way mirror, and so on.
941 begins to resilver immediately.
946 even if its appears to be in use.
947 Not all devices can be overridden in this manner.
948 .It Fl o Ar property Ns = Ns Ar value
949 Sets the given pool properties. See the
951 section for a list of valid properties that can be set. The only property
952 supported at the moment is ashift.
960 Checkpoints the current state of
962 , which can be later restored by
963 .Nm zpool Cm import --rewind-to-checkpoint .
964 The existence of a checkpoint in a pool prohibits the following
973 In addition, it may break reservation boundaries if the pool lacks free
977 command indicates the existence of a checkpoint or the progress of discarding a
978 checkpoint from a pool.
981 command reports how much space the checkpoint takes from the pool.
984 Discards an existing checkpoint from
993 Clears device errors in a pool.
994 If no arguments are specified, all device errors within the pool are cleared.
995 If one or more devices is specified, only those errors associated with the
996 specified device or devices are cleared.
1001 .Op Fl m Ar mountpoint
1002 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1003 .Oo Fl o Ar feature@feature Ns = Ns Ar value Oc Ns ...
1004 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
1007 .Ar pool vdev Ns ...
1009 Creates a new storage pool containing the virtual devices specified on the
1011 The pool name must begin with a letter, and can only contain
1012 alphanumeric characters as well as underscore
1028 are reserved, as are names beginning with
1036 specification is described in the
1040 The command verifies that each device specified is accessible and not currently
1041 in use by another subsystem.
1042 There are some uses, such as being currently mounted, or specified as the
1043 dedicated dump device, that prevents a device from ever being used by ZFS.
1044 Other uses, such as having a preexisting UFS file system, can be overridden with
1049 The command also checks that the replication strategy for the pool is
1051 An attempt to combine redundant and non-redundant storage in a single pool, or
1052 to mix disks and files, results in an error unless
1055 The use of differently sized devices within a single raidz or mirror group is
1056 also flagged as an error unless
1062 option is specified, the default mount point is
1064 The mount point must not exist or must be empty, or else the root dataset
1066 This can be overridden with the
1070 By default all supported features are enabled on the new pool unless the
1072 option is specified.
1075 Do not enable any features on the new pool.
1076 Individual features can be enabled by setting their corresponding properties to
1082 .Xr zpool-features 5
1083 for details about feature properties.
1087 even if they appear in use or specify a conflicting replication level.
1088 Not all devices can be overridden in this manner.
1089 .It Fl m Ar mountpoint
1090 Sets the mount point for the root dataset.
1091 The default mount point is
1098 The mount point must be an absolute path,
1102 For more information on dataset mount points, see
1105 Displays the configuration that would be used without actually creating the
1107 The actual pool creation can still fail due to insufficient privileges or
1109 .It Fl o Ar property Ns = Ns Ar value
1110 Sets the given pool properties.
1113 section for a list of valid properties that can be set.
1114 .It Fl o Ar feature@feature Ns = Ns Ar value
1115 Sets the given pool feature. See the
1116 .Xr zpool-features 5
1117 section for a list of valid features that can be set.
1118 Value can be either disabled or enabled.
1119 .It Fl O Ar file-system-property Ns = Ns Ar value
1120 Sets the given file system properties in the root file system of the pool.
1125 for a list of valid properties that can be set.
1128 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
1130 Sets the in-core pool name to
1132 while the on-disk name will be the name specified as the pool name
1134 This will set the default cachefile property to none. This is intended
1135 to handle name space collisions when creating pools for other systems,
1136 such as virtual machines or physical machines whose pools live on network
1145 Destroys the given pool, freeing up any devices for other use.
1146 This command tries to unmount any active datasets before destroying the pool.
1149 Forces any active datasets contained within the pool to be unmounted.
1159 The operation is refused if there are no other valid replicas of the data.
1160 If device may be re-added to the pool later on then consider the
1166 .Op Fl vHf Oo Ar pool Oc | Fl c
1168 Lists all recent events generated by the ZFS kernel modules. These events
1171 and used to automate administrative tasks such as replacing a failed device
1172 with a hot spare. For more information about the subclasses and event payloads
1173 that can be generated see the
1178 Clear all previous events.
1182 Scripted mode. Do not display headers, and separate fields by a
1183 single tab instead of arbitrary space.
1185 Print the entire payload for each event.
1194 Exports the given pools from the system.
1195 All devices are marked as exported, but are still considered in use by other
1197 The devices can be moved between systems
1198 .Pq even those of different endianness
1199 and imported as long as a sufficient number of devices are present.
1201 Before exporting the pool, all datasets within the pool are unmounted.
1202 A pool can not be exported if it has a shared spare that is currently being
1205 For pools to be portable, you must give the
1207 command whole disks, not just partitions, so that ZFS can label the disks with
1208 portable EFI labels.
1209 Otherwise, disk drivers on platforms of different endianness will not recognize
1213 Exports all pools imported on the system.
1215 Forcefully unmount all datasets, using the
1219 This command will forcefully export the pool even if it has a shared spare that
1220 is currently being used.
1221 This may lead to potential data corruption.
1227 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1228 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1229 .Oo Ar pool Oc Ns ...
1231 Retrieves the given list of properties
1233 or all properties if
1237 for the specified storage pool(s).
1238 These properties are displayed with the following fields:
1240 name Name of storage pool
1241 property Property name
1242 value Property value
1243 source Property source, either 'default' or 'local'.
1248 section for more information on the available pool properties.
1252 Do not display headers, and separate fields by a single tab instead of arbitrary
1255 A comma-separated list of columns to display.
1256 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
1257 is the default value.
1259 Display numbers in parsable (exact) values.
1265 .Oo Ar pool Oc Ns ...
1267 Displays the command history of the specified pool(s) or all pools if no pool is
1271 Displays internally logged ZFS events in addition to user initiated events.
1273 Displays log records in long format, which in addition to standard format
1274 includes, the user name, the hostname, and the zone in which the operation was
1281 .Op Fl d Ar dir Ns | Ns device
1283 Lists pools available to import.
1286 option is not specified, this command searches for devices in
1290 option can be specified multiple times, and all directories are searched.
1291 If the device appears to be part of an exported pool, this command displays a
1292 summary of the pool with the name of the pool, a numeric identifier, as well as
1293 the vdev layout and current health of the device for each device or file.
1294 Destroyed pools, pools that were previously destroyed with the
1295 .Nm zpool Cm destroy
1296 command, are not listed unless the
1298 option is specified.
1300 The numeric identifier is unique, and can be used instead of the pool name when
1301 multiple exported pools of the same name are available.
1303 .It Fl c Ar cachefile
1304 Reads configuration from the given
1306 that was created with the
1311 is used instead of searching for devices.
1312 .It Fl d Ar dir Ns | Ns Ar device
1315 or searches for devices or files in
1319 option can be specified multiple times.
1321 Lists destroyed pools only.
1328 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
1329 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
1331 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1335 Imports all pools found in the search directories.
1336 Identical to the previous command, except that all pools with a sufficient
1337 number of devices available are imported.
1338 Destroyed pools, pools that were previously destroyed with the
1339 .Nm zpool Cm destroy
1340 command, will not be imported unless the
1342 option is specified.
1345 Searches for and imports all pools found.
1346 .It Fl c Ar cachefile
1347 Reads configuration from the given
1349 that was created with the
1354 is used instead of searching for devices.
1355 .It Fl d Ar dir Ns | Ns Ar device
1358 or searches for devices or files in
1362 option can be specified multiple times.
1363 This option is incompatible with the
1367 Imports destroyed pools only.
1370 option is also required.
1372 Forces import, even if the pool appears to be potentially active.
1374 Recovery mode for a non-importable pool.
1375 Attempt to return the pool to an importable state by discarding the last few
1377 Not all damaged pools can be recovered by using this option.
1378 If successful, the data from the discarded transactions is irretrievably lost.
1379 This option is ignored if the pool is importable or already imported.
1381 Indicates that this command will request encryption keys for all encrypted
1382 datasets it attempts to mount as it is bringing the pool online. Note that if
1387 this command will block waiting for the keys to be entered. Without this flag
1388 encrypted datasets will be left unavailable until the keys are loaded.
1390 Allows a pool to import when there is a missing log device.
1391 Recent transactions can be lost because the log device will be discarded.
1396 Determines whether a non-importable pool can be made importable again, but does
1397 not actually perform the pool recovery.
1398 For more details about pool recovery mode, see the
1402 Import the pool without mounting any file systems.
1404 Comma-separated list of mount options to use when mounting datasets within the
1408 for a description of dataset properties and mount options.
1409 .It Fl o Ar property Ns = Ns Ar value
1410 Sets the specified property on the imported pool.
1413 section for more information on the available pool properties.
1423 .It Fl -rewind-to-checkpoint
1424 Rewinds pool to the checkpointed state.
1425 Once the pool is imported with this flag there is no way to undo the rewind.
1426 All changes and data that were written after the checkpoint are lost!
1427 The only exception is when the
1429 mounting option is enabled.
1430 In this case, the checkpointed state of the pool is opened and an
1431 administrator can see how the pool would look like if they were
1434 Scan using the default search path, the libblkid cache will not be
1435 consulted. A custom search path may be specified by setting the
1436 ZPOOL_IMPORT_PATH environment variable.
1440 recovery option. Determines whether extreme
1441 measures to find a valid txg should take place. This allows the pool to
1442 be rolled back to a txg which is no longer guaranteed to be consistent.
1443 Pools imported at an inconsistent txg may contain uncorrectable
1444 checksum errors. For more details about pool recovery mode, see the
1446 option, above. WARNING: This option can be extremely hazardous to the
1447 health of your pool and should only be used as a last resort.
1449 Specify the txg to use for rollback. Implies
1452 about pool recovery mode, see the
1454 option, above. WARNING: This option can be extremely hazardous to the
1455 health of your pool and should only be used as a last resort.
1461 .Op Fl F Oo Fl n Oc Oo Fl t Oc Oo Fl T Oc Oo Fl X Oc
1462 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
1464 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1467 .Ar pool Ns | Ns Ar id
1470 Imports a specific pool.
1471 A pool can be identified by its name or the numeric identifier.
1474 is specified, the pool is imported using the name
1476 Otherwise, it is imported with the same name as its exported name.
1478 If a device is removed from a system without running
1480 first, the device appears as potentially active.
1481 It cannot be determined if this was a failed export, or whether the device is
1482 really in use from another host.
1483 To import a pool in this state, the
1487 .It Fl c Ar cachefile
1488 Reads configuration from the given
1490 that was created with the
1495 is used instead of searching for devices.
1496 .It Fl d Ar dir Ns | Ns Ar device
1499 or searches for devices or files in
1503 option can be specified multiple times.
1504 This option is incompatible with the
1508 Imports destroyed pool.
1511 option is also required.
1513 Forces import, even if the pool appears to be potentially active.
1515 Recovery mode for a non-importable pool.
1516 Attempt to return the pool to an importable state by discarding the last few
1518 Not all damaged pools can be recovered by using this option.
1519 If successful, the data from the discarded transactions is irretrievably lost.
1520 This option is ignored if the pool is importable or already imported.
1522 Indicates that this command will request encryption keys for all encrypted
1523 datasets it attempts to mount as it is bringing the pool online. Note that if
1528 this command will block waiting for the keys to be entered. Without this flag
1529 encrypted datasets will be left unavailable until the keys are loaded.
1531 Allows a pool to import when there is a missing log device.
1532 Recent transactions can be lost because the log device will be discarded.
1537 Determines whether a non-importable pool can be made importable again, but does
1538 not actually perform the pool recovery.
1539 For more details about pool recovery mode, see the
1543 Comma-separated list of mount options to use when mounting datasets within the
1547 for a description of dataset properties and mount options.
1548 .It Fl o Ar property Ns = Ns Ar value
1549 Sets the specified property on the imported pool.
1552 section for more information on the available pool properties.
1563 Scan using the default search path, the libblkid cache will not be
1564 consulted. A custom search path may be specified by setting the
1565 ZPOOL_IMPORT_PATH environment variable.
1569 recovery option. Determines whether extreme
1570 measures to find a valid txg should take place. This allows the pool to
1571 be rolled back to a txg which is no longer guaranteed to be consistent.
1572 Pools imported at an inconsistent txg may contain uncorrectable
1573 checksum errors. For more details about pool recovery mode, see the
1575 option, above. WARNING: This option can be extremely hazardous to the
1576 health of your pool and should only be used as a last resort.
1578 Specify the txg to use for rollback. Implies
1581 about pool recovery mode, see the
1583 option, above. WARNING: This option can be extremely hazardous to the
1584 health of your pool and should only be used as a last resort.
1590 is temporary. Temporary pool names last until export. Ensures that
1591 the original pool name will be used in all label updates and therefore
1592 is retained upon export.
1593 Will also set -o cachefile=none when not explicitly specified.
1598 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
1599 .Op Fl T Sy u Ns | Ns Sy d
1601 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
1602 .Op Ar interval Op Ar count
1604 Displays I/O statistics for the given pools/vdevs. You can pass in a
1605 list of pools, a pool and list of vdevs in that pool, or a list of any
1606 vdevs from any pool. If no items are specified, statistics for every
1607 pool in the system are shown.
1610 the statistics are printed every
1612 seconds until ^C is pressed. If count is specified, the command exits
1613 after count reports are printed. The first report printed is always
1614 the statistics since boot regardless of whether
1618 are passed. However, this behavior can be suppressed with the
1620 flag. Also note that the units of
1624 that are printed in the report are in base 1024. To get the raw
1629 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1630 Run a script (or scripts) on each vdev and include the output as a new column
1633 output. Users can run any script found in their
1635 directory or from the system
1636 .Pa /etc/zfs/zpool.d
1637 directory. Script names containing the slash (/) character are not allowed.
1638 The default search path can be overridden by setting the
1639 ZPOOL_SCRIPTS_PATH environment variable. A privileged user can run
1641 if they have the ZPOOL_SCRIPTS_AS_ROOT
1642 environment variable set. If a script requires the use of a privileged
1645 then it's recommended you allow the user access to it in
1647 or add the user to the
1648 .Pa /etc/sudoers.d/zfs
1653 is passed without a script name, it prints a list of all scripts.
1655 also sets verbose mode
1656 .No \&( Ns Fl v Ns No \&).
1658 Script output should be in the form of "name=value". The column name is
1659 set to "name" and the value is set to "value". Multiple lines can be
1660 used to output multiple columns. The first line of output not in the
1661 "name=value" format is displayed without a column title, and no more
1662 output after that is displayed. This can be useful for printing error
1663 messages. Blank or NULL values are printed as a '-' to make output
1666 The following environment variables are set before running each script:
1667 .Bl -tag -width "VDEV_PATH"
1669 Full path to the vdev
1671 .Bl -tag -width "VDEV_UPATH"
1673 Underlying path to the vdev (/dev/sd*). For use with device mapper,
1674 multipath, or partitioned vdevs.
1676 .Bl -tag -width "VDEV_ENC_SYSFS_PATH"
1677 .It Sy VDEV_ENC_SYSFS_PATH
1678 The sysfs path to the enclosure for the vdev (if any).
1680 .It Fl T Sy u Ns | Ns Sy d
1681 Display a time stamp.
1684 for a printed representation of the internal representation of time.
1689 for standard date format.
1693 Display vdev GUIDs instead of the normal device names. These GUIDs
1694 can be used in place of device names for the zpool
1695 detach/offline/remove/replace commands.
1697 Scripted mode. Do not display headers, and separate fields by a
1698 single tab instead of arbitrary space.
1700 Display real paths for vdevs resolving all symbolic links. This can
1701 be used to look up the current block device name regardless of the
1703 path used to open it.
1705 Display numbers in parsable (exact) values. Time values are in
1708 Display full paths for vdevs instead of only the last component of
1709 the path. This can be used in conjunction with the
1713 Print request size histograms for the leaf ZIOs. This includes
1714 histograms of individual ZIOs (
1716 and aggregate ZIOs (
1718 These stats can be useful for seeing how well the ZFS IO aggregator is
1719 working. Do not confuse these request size stats with the block layer
1720 requests; it's possible ZIOs can be broken up before being sent to the
1723 Verbose statistics Reports usage statistics for individual vdevs within the
1724 pool, in addition to the pool-wide statistics.
1726 Omit statistics since boot.
1727 Normally the first line of output reports the statistics since boot.
1728 This option suppresses that first line of output.
1730 Display latency histograms:
1733 Total IO time (queuing + disk IO time).
1735 Disk IO time (time reading/writing the disk).
1737 Amount of time IO spent in synchronous priority queues. Does not include
1740 Amount of time IO spent in asynchronous priority queues. Does not include
1743 Amount of time IO spent in scrub queue. Does not include disk time.
1745 Include average latency statistics:
1748 Average total IO time (queuing + disk IO time).
1750 Average disk IO time (time reading/writing the disk).
1752 Average amount of time IO spent in synchronous priority queues. Does
1753 not include disk time.
1755 Average amount of time IO spent in asynchronous priority queues.
1756 Does not include disk time.
1758 Average queuing time in scrub queue. Does not include disk time.
1760 Include active queue statistics. Each priority queue has both
1765 IOs. Pending IOs are waiting to
1766 be issued to the disk, and active IOs have been issued to disk and are
1767 waiting for completion. These stats are broken out by priority queue:
1769 .Ar syncq_read/write :
1770 Current number of entries in synchronous priority
1772 .Ar asyncq_read/write :
1773 Current number of entries in asynchronous priority queues.
1775 Current number of entries in scrub queue.
1777 All queue statistics are instantaneous measurements of the number of
1778 entries in the queues. If you specify an interval, the measurements
1779 will be sampled from the end of the interval.
1787 Removes ZFS label information from the specified
1791 must not be part of an active pool configuration.
1794 Treat exported or foreign devices as inactive.
1800 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1801 .Op Fl T Sy u Ns | Ns Sy d
1802 .Oo Ar pool Oc Ns ...
1803 .Op Ar interval Op Ar count
1805 Lists the given pools along with a health status and space usage.
1808 are specified, all pools in the system are listed.
1811 the information is printed every
1813 seconds until ^C is pressed.
1816 is specified, the command exits after
1818 reports are printed.
1821 Display vdev GUIDs instead of the normal device names. These GUIDs
1822 can be used in place of device names for the zpool
1823 detach/offline/remove/replace commands.
1826 Do not display headers, and separate fields by a single tab instead of arbitrary
1828 .It Fl o Ar property
1829 Comma-separated list of properties to display.
1832 section for a list of valid properties.
1834 .Cm name , size , allocated , free , checkpoint, expandsize , fragmentation ,
1835 .Cm capacity , dedupratio , health , altroot .
1837 Display real paths for vdevs resolving all symbolic links. This can
1838 be used to look up the current block device name regardless of the
1839 /dev/disk/ path used to open it.
1841 Display numbers in parsable
1845 Display full paths for vdevs instead of only the last component of
1846 the path. This can be used in conjunction with the
1849 .It Fl T Sy u Ns | Ns Sy d
1850 Display a time stamp.
1853 for a printed representation of the internal representation of time.
1858 for standard date format.
1863 Reports usage statistics for individual vdevs within the pool, in addition to
1864 the pool-wise statistics.
1871 .Ar pool Ar device Ns ...
1873 Takes the specified physical device offline.
1876 is offline, no attempt is made to read or write to the device.
1877 This command is not applicable to spares.
1880 Force fault. Instead of offlining the disk, put it into a faulted
1881 state. The fault will persist across imports unless the
1886 Upon reboot, the specified physical device reverts to its previous state.
1892 .Ar pool Ar device Ns ...
1894 Brings the specified physical device online.
1895 This command is not applicable to spares.
1898 Expand the device to use all available space.
1899 If the device is part of a mirror or raidz then all devices must be expanded
1900 before the new space will become available to the pool.
1907 Generates a new unique identifier for the pool.
1908 You must ensure that all devices in this pool are online and healthy before
1909 performing this action.
1916 Reopen all the vdevs associated with the pool.
1919 Do not restart an in-progress scrub operation. This is not recommended and can
1920 result in partially resilvered devices unless a second scrub is performed.
1926 .Ar pool Ar device Ns ...
1928 Removes the specified device from the pool.
1929 This command supports removing hot spare, cache, log, and both mirrored and
1930 non-redundant primary top-level vdevs, including dedup and special vdevs.
1931 When the primary pool storage includes a top-level raidz vdev only hot spare,
1932 cache, and log devices can be removed.
1934 Removing a top-level vdev reduces the total amount of space in the storage pool.
1935 The specified device will be evacuated by copying all allocated space from it to
1936 the other devices in the pool.
1939 command initiates the removal and returns, while the evacuation continues in
1941 The removal progress can be monitored with
1942 .Nm zpool Cm status.
1945 feature flag must be enabled to remove a top-level vdev, see
1946 .Xr zpool-features 5 .
1948 A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
1950 Non-log devices or data devices that are part of a mirrored configuration can be removed using
1956 Do not actually perform the removal ("no-op").
1957 Instead, print the estimated amount of memory that will be used by the
1958 mapping table after the removal completes.
1959 This is nonzero only for top-level vdevs.
1963 Used in conjunction with the
1965 flag, displays numbers as parsable (exact) values.
1973 Stops and cancels an in-progress removal of a top-level vdev.
1978 .Op Fl o Ar property Ns = Ns Ar value
1979 .Ar pool Ar device Op Ar new_device
1985 This is equivalent to attaching
1987 waiting for it to resilver, and then detaching
1992 must be greater than or equal to the minimum size of all the devices in a mirror
1993 or raidz configuration.
1996 is required if the pool is not redundant.
1999 is not specified, it defaults to
2001 This form of replacement is useful after an existing disk has failed and has
2002 been physically replaced.
2003 In this case, the new disk may have the same
2005 path as the old device, even though it is actually a different disk.
2006 ZFS recognizes this.
2011 even if its appears to be in use.
2012 Not all devices can be overridden in this manner.
2013 .It Fl o Ar property Ns = Ns Ar value
2014 Sets the given pool properties. See the
2016 section for a list of valid properties that can be set.
2017 The only property supported at the moment is
2026 Begins a scrub or resumes a paused scrub.
2027 The scrub examines all data in the specified pools to verify that it checksums
2031 devices, ZFS automatically repairs any damage discovered during the scrub.
2034 command reports the progress of the scrub and summarizes the results of the
2035 scrub upon completion.
2037 Scrubbing and resilvering are very similar operations.
2038 The difference is that resilvering only examines data that ZFS knows to be out
2041 for example, when attaching a new device to a mirror or replacing an existing
2044 whereas scrubbing examines all data to discover silent errors due to hardware
2045 faults or disk failure.
2047 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
2049 If a scrub is paused, the
2052 If a resilver is in progress, ZFS does not allow a scrub to be started until the
2061 Scrub pause state and progress are periodically synced to disk.
2062 If the system is restarted or pool is exported during a paused scrub,
2063 even after import, scrub will remain paused until it is resumed.
2064 Once resumed the scrub will pick up from the place where it was last
2065 checkpointed to disk.
2066 To resume a paused scrub issue
2073 .Ar property Ns = Ns Ar value
2076 Sets the given property on the specified pool.
2079 section for more information on what properties can be set and acceptable
2085 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2096 must be mirrors and the pool must not be in the process of resilvering.
2097 At the time of the split,
2099 will be a replica of
2102 last device in each mirror is split from
2107 The optional device specification causes the specified device(s) to be
2110 and, should any devices remain unspecified,
2111 the last device in each mirror is used as would be by default.
2114 Display vdev GUIDs instead of the normal device names. These GUIDs
2115 can be used in place of device names for the zpool
2116 detach/offline/remove/replace commands.
2118 Display real paths for vdevs resolving all symbolic links. This can
2119 be used to look up the current block device name regardless of the
2121 path used to open it.
2123 Indicates that this command will request encryption keys for all encrypted
2124 datasets it attempts to mount as it is bringing the new pool online. Note that
2125 if any datasets have a
2129 this command will block waiting for the keys to be entered. Without this flag
2130 encrypted datasets will be left unavailable until the keys are loaded.
2132 Do dry run, do not actually perform the split.
2133 Print out the expected configuration of
2136 Display full paths for vdevs instead of only the last component of
2137 the path. This can be used in conjunction with the
2140 .It Fl o Ar property Ns = Ns Ar value
2141 Sets the specified property for
2145 section for more information on the available pool properties.
2153 and automatically import it.
2158 .Op Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
2160 .Op Fl T Sy u Ns | Ns Sy d
2161 .Oo Ar pool Oc Ns ...
2162 .Op Ar interval Op Ar count
2164 Displays the detailed health status for the given pools.
2167 is specified, then the status of each pool in the system is displayed.
2168 For more information on pool and device health, see the
2169 .Sx Device Failure and Recovery
2172 If a scrub or resilver is in progress, this command reports the percentage done
2173 and the estimated time to completion.
2174 Both of these are only approximate, because the amount of data in the pool and
2175 the other workloads on the system can change.
2177 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
2178 Run a script (or scripts) on each vdev and include the output as a new column
2185 for complete details.
2187 Display vdev GUIDs instead of the normal device names. These GUIDs
2188 can be used in place of device names for the zpool
2189 detach/offline/remove/replace commands.
2191 Display real paths for vdevs resolving all symbolic links. This can
2192 be used to look up the current block device name regardless of the
2194 path used to open it.
2196 Display full paths for vdevs instead of only the last component of
2197 the path. This can be used in conjunction with the
2201 Display a histogram of deduplication statistics, showing the allocated
2202 .Pq physically present on disk
2204 .Pq logically referenced in the pool
2205 block counts and sizes by reference count.
2206 .It Fl T Sy u Ns | Ns Sy d
2207 Display a time stamp.
2210 for a printed representation of the internal representation of time.
2215 for standard date format.
2219 Displays verbose data error information, printing out a complete list of all
2220 data errors since the last complete pool scrub.
2222 Only display status for pools that are exhibiting errors or are otherwise
2224 Warnings about pools not using the latest on-disk format will not be included.
2231 This command forces all in-core dirty data to be written to the primary
2232 pool storage and not the ZIL. It will also update administrative
2233 information including quota reporting. Without arguments,
2235 will sync all pools on the system. Otherwise, it will sync only the
2241 Displays pools which do not have all supported features enabled and pools
2242 formatted using a legacy ZFS version number.
2243 These pools can continue to be used, but some features may not be available.
2245 .Nm zpool Cm upgrade Fl a
2246 to enable all features on all pools.
2252 Displays legacy ZFS versions supported by the current software.
2254 .Xr zpool-features 5
2255 for a description of feature flags features supported by the current software.
2260 .Fl a Ns | Ns Ar pool Ns ...
2262 Enables all supported features on the given pool.
2263 Once this is done, the pool will no longer be accessible on systems that do not
2264 support feature flags.
2267 for details on compatibility with systems that support feature flags, but do not
2268 support all features enabled on the pool.
2271 Enables all supported features on all pools.
2273 Upgrade to the specified legacy version.
2276 flag is specified, no features will be enabled on the pool.
2277 This option can only be used to increase the version number up to the last
2278 supported legacy version number.
2282 The following exit values are returned:
2285 Successful completion.
2289 Invalid command line options were specified.
2293 .It Sy Example 1 No Creating a RAID-Z Storage Pool
2294 The following command creates a pool with a single raidz root vdev that
2295 consists of six disks.
2297 # zpool create tank raidz sda sdb sdc sdd sde sdf
2299 .It Sy Example 2 No Creating a Mirrored Storage Pool
2300 The following command creates a pool with two mirrors, where each mirror
2303 # zpool create tank mirror sda sdb mirror sdc sdd
2305 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Partitions
2306 The following command creates an unmirrored pool using two disk partitions.
2308 # zpool create tank sda1 sdb2
2310 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
2311 The following command creates an unmirrored pool using files.
2312 While not recommended, a pool based on files can be useful for experimental
2315 # zpool create tank /path/to/file/a /path/to/file/b
2317 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
2318 The following command adds two mirrored disks to the pool
2320 assuming the pool is already made up of two-way mirrors.
2321 The additional space is immediately available to any datasets within the pool.
2323 # zpool add tank mirror sda sdb
2325 .It Sy Example 6 No Listing Available ZFS Storage Pools
2326 The following command lists all available pools on the system.
2327 In this case, the pool
2329 is faulted due to a missing device.
2330 The results from this command are similar to the following:
2333 NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2334 rpool 19.9G 8.43G 11.4G - 33% 42% 1.00x ONLINE -
2335 tank 61.5G 20.0G 41.5G - 48% 32% 1.00x ONLINE -
2336 zion - - - - - - - FAULTED -
2338 .It Sy Example 7 No Destroying a ZFS Storage Pool
2339 The following command destroys the pool
2341 and any datasets contained within.
2343 # zpool destroy -f tank
2345 .It Sy Example 8 No Exporting a ZFS Storage Pool
2346 The following command exports the devices in pool
2348 so that they can be relocated or later imported.
2352 .It Sy Example 9 No Importing a ZFS Storage Pool
2353 The following command displays available pools, and then imports the pool
2355 for use on the system.
2356 The results from this command are similar to the following:
2360 id: 15451357997522795478
2362 action: The pool can be imported using its name or numeric identifier.
2372 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
2373 The following command upgrades all ZFS Storage pools to the current version of
2377 This system is currently running ZFS version 2.
2379 .It Sy Example 11 No Managing Hot Spares
2380 The following command creates a new pool with an available hot spare:
2382 # zpool create tank mirror sda sdb spare sdc
2385 If one of the disks were to fail, the pool would be reduced to the degraded
2387 The failed device can be replaced using the following command:
2389 # zpool replace tank sda sdd
2392 Once the data has been resilvered, the spare is automatically removed and is
2393 made available for use should another device fail.
2394 The hot spare can be permanently removed from the pool using the following
2397 # zpool remove tank sdc
2399 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
2400 The following command creates a ZFS storage pool consisting of two, two-way
2401 mirrors and mirrored log devices:
2403 # zpool create pool mirror sda sdb mirror sdc sdd log mirror \\
2406 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
2407 The following command adds two disks for use as cache devices to a ZFS storage
2410 # zpool add pool cache sdc sdd
2413 Once added, the cache devices gradually fill with content from main memory.
2414 Depending on the size of your cache devices, it could take over an hour for
2416 Capacity and reads can be monitored using the
2420 # zpool iostat -v pool 5
2422 .It Sy Example 14 No Removing a Mirrored top-level (Log or Data) Device
2423 The following commands remove the mirrored log device
2425 and mirrored top-level data device
2428 Given this configuration:
2432 scrub: none requested
2435 NAME STATE READ WRITE CKSUM
2437 mirror-0 ONLINE 0 0 0
2440 mirror-1 ONLINE 0 0 0
2444 mirror-2 ONLINE 0 0 0
2449 The command to remove the mirrored log
2453 # zpool remove tank mirror-2
2456 The command to remove the mirrored data
2460 # zpool remove tank mirror-1
2462 .It Sy Example 15 No Displaying expanded space on a device
2463 The following command displays the detailed information for the pool
2465 This pool is comprised of a single raidz vdev where one of its devices
2466 increased its capacity by 10GB.
2467 In this example, the pool will not be able to utilize this extra capacity until
2468 all the devices under the raidz vdev have been expanded.
2470 # zpool list -v data
2471 NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2472 data 23.9G 14.6G 9.30G - 48% 61% 1.00x ONLINE -
2473 raidz1 23.9G 14.6G 9.30G - 48%
2478 .It Sy Example 16 No Adding output columns
2479 Additional columns can be added to the
2487 # zpool status -c vendor,model,size
2488 NAME STATE READ WRITE CKSUM vendor model size
2490 mirror-0 ONLINE 0 0 0
2491 U1 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2492 U10 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2493 U11 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2494 U12 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2495 U13 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2496 U14 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2498 # zpool iostat -vc slaves
2499 capacity operations bandwidth
2500 pool alloc free read write read write slaves
2501 ---------- ----- ----- ----- ----- ----- ----- ---------
2502 tank 20.4G 7.23T 26 152 20.7M 21.6M
2503 mirror 20.4G 7.23T 26 152 20.7M 21.6M
2504 U1 - - 0 31 1.46K 20.6M sdb sdff
2505 U10 - - 0 1 3.77K 13.3K sdas sdgw
2506 U11 - - 0 1 288K 13.3K sdat sdgx
2507 U12 - - 0 1 78.4K 13.3K sdau sdgy
2508 U13 - - 0 1 128K 13.3K sdav sdgz
2509 U14 - - 0 1 63.2K 13.3K sdfk sdg
2512 .Sh ENVIRONMENT VARIABLES
2513 .Bl -tag -width "ZFS_ABORT"
2517 to dump core on exit for the purposes of running
2520 .Bl -tag -width "ZPOOL_IMPORT_PATH"
2521 .It Ev ZPOOL_IMPORT_PATH
2522 The search path for devices or files to use with the pool. This is a colon-separated list of directories in which
2524 looks for device nodes and files.
2530 .Bl -tag -width "ZPOOL_VDEV_NAME_GUID"
2531 .It Ev ZPOOL_VDEV_NAME_GUID
2533 .Nm zpool subcommands to output vdev guids by default. This behavior
2536 command line option.
2538 .Bl -tag -width "ZPOOL_VDEV_NAME_FOLLOW_LINKS"
2539 .It Ev ZPOOL_VDEV_NAME_FOLLOW_LINKS
2542 subcommands to follow links for vdev names by default. This behavior is identical to the
2544 command line option.
2546 .Bl -tag -width "ZPOOL_VDEV_NAME_PATH"
2547 .It Ev ZPOOL_VDEV_NAME_PATH
2550 subcommands to output full vdev path names by default. This
2551 behavior is identical to the
2553 command line option.
2555 .Bl -tag -width "ZFS_VDEV_DEVID_OPT_OUT"
2556 .It Ev ZFS_VDEV_DEVID_OPT_OUT
2557 Older ZFS on Linux implementations had issues when attempting to display pool
2558 config VDEV names if a
2560 NVP value is present in the pool's config.
2562 For example, a pool that originated on illumos platform would have a devid
2563 value in the config and
2565 would fail when listing the config.
2566 This would also be true for future Linux based pools.
2568 A pool can be stripped of any
2570 values on import or prevented from adding
2576 .Sy ZFS_VDEV_DEVID_OPT_OUT .
2578 .Bl -tag -width "ZPOOL_SCRIPTS_AS_ROOT"
2579 .It Ev ZPOOL_SCRIPTS_AS_ROOT
2580 Allow a privileged user to run the
2581 .Nm zpool status/iostat
2584 option. Normally, only unprivileged users are allowed to run
2587 .Bl -tag -width "ZPOOL_SCRIPTS_PATH"
2588 .It Ev ZPOOL_SCRIPTS_PATH
2589 The search path for scripts when running
2590 .Nm zpool status/iostat
2593 option. This is a colon-separated list of directories and overrides the default
2596 .Pa /etc/zfs/zpool.d
2599 .Bl -tag -width "ZPOOL_SCRIPTS_ENABLED"
2600 .It Ev ZPOOL_SCRIPTS_ENABLED
2602 .Nm zpool status/iostat
2606 .Sy ZPOOL_SCRIPTS_ENABLED
2607 is not set, it is assumed that the user is allowed to run
2608 .Nm zpool status/iostat -c .
2610 .Sh INTERFACE STABILITY
2614 .Xr zfs-module-parameters 5 ,
2615 .Xr zpool-features 5 ,