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
124 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
125 .Op Fl T Sy u Ns | Ns Sy d
127 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
128 .Op Ar interval Op Ar count
136 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
137 .Op Fl T Sy u Ns | Ns Sy d
138 .Oo Ar pool Oc Ns ...
139 .Op Ar interval Op Ar count
144 .Ar pool Ar device Ns ...
148 .Ar pool Ar device Ns ...
159 .Ar pool Ar device Ns ...
167 .Oo Fl o Ar property Ns = Ns Ar value Oc
168 .Ar pool Ar device Op Ar new_device
185 .Ar property Ns = Ns Ar value
190 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
193 .Oo Ar device Oc Ns ...
196 .Oo Fl c Ar SCRIPT Oc
198 .Op Fl T Sy u Ns | Ns Sy d
199 .Oo Ar pool Oc Ns ...
200 .Op Ar interval Op Ar count
203 .Oo Ar pool Oc Ns ...
212 .Fl a Ns | Ns Ar pool Ns ...
216 command configures ZFS storage pools.
217 A storage pool is a collection of devices that provides physical storage and
218 data replication for ZFS datasets.
219 All datasets within a storage pool share the same space.
222 for information on managing datasets.
223 .Ss Virtual Devices (vdevs)
224 A "virtual device" describes a single device or a collection of devices
225 organized according to certain performance and fault characteristics.
226 The following virtual devices are supported:
229 A block device, typically located under
231 ZFS can use individual slices or partitions, though the recommended mode of
232 operation is to use whole disks.
233 A disk can be specified by a full path, or it can be a shorthand name
234 .Po the relative portion of the path under
237 A whole disk can be specified by omitting the slice or partition designation.
242 When given a whole disk, ZFS automatically labels the disk, if necessary.
245 The use of files as a backing store is strongly discouraged.
246 It is designed primarily for experimental purposes, as the fault tolerance of a
247 file is only as good as the file system of which it is a part.
248 A file must be specified by a full path.
250 A mirror of two or more devices.
251 Data is replicated in an identical fashion across all components of a mirror.
252 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
253 failing before data integrity is compromised.
254 .It Sy raidz , raidz1 , raidz2 , raidz3
255 A variation on RAID-5 that allows for better distribution of parity and
256 eliminates the RAID-5
258 .Pq in which data and parity become inconsistent after a power loss .
259 Data and parity is striped across all disks within a raidz group.
261 A raidz group can have single-, double-, or triple-parity, meaning that the
262 raidz group can sustain one, two, or three failures, respectively, without
266 vdev type specifies a single-parity raidz group; the
268 vdev type specifies a double-parity raidz group; and the
270 vdev type specifies a triple-parity raidz group.
273 vdev type is an alias for
276 A raidz group with N disks of size X with P parity disks can hold approximately
277 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
279 The minimum number of devices in a raidz group is one more than the number of
281 The recommended number is between 3 and 9 to help increase performance.
283 A pseudo-vdev which keeps track of available hot spares for a pool.
284 For more information, see the
288 A separate intent log device.
289 If more than one log device is specified, then writes are load-balanced between
291 Log devices can be mirrored.
292 However, raidz vdev types are not supported for the intent log.
293 For more information, see the
297 A device dedicated solely for dedup data.
298 The redundancy of this device should match the redundancy of the other normal
299 devices in the pool. If more than one dedup device is specified, then
300 allocations are load-balanced between those devices.
302 A device dedicated solely for allocating various kinds of internal metadata,
303 and optionally small file data.
304 The redundancy of this device should match the redundancy of the other normal
305 devices in the pool. If more than one special device is specified, then
306 allocations are load-balanced between those devices.
308 For more information on special allocations, see the
309 .Sx Special Allocation Class
312 A device used to cache storage pool data.
313 A cache device cannot be configured as a mirror or raidz group.
314 For more information, see the
319 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
320 contain files or disks.
322 .Pq or other combinations
325 A pool can have any number of virtual devices at the top of the configuration
329 Data is dynamically distributed across all top-level devices to balance data
331 As new virtual devices are added, ZFS automatically places data on the newly
334 Virtual devices are specified one at a time on the command line, separated by
340 are used to distinguish where a group ends and another begins.
341 For example, the following creates two root vdevs, each a mirror of two disks:
343 # zpool create mypool mirror sda sdb mirror sdc sdd
345 .Ss Device Failure and Recovery
346 ZFS supports a rich set of mechanisms for handling device failure and data
348 All metadata and data is checksummed, and ZFS automatically repairs bad data
349 from a good copy when corruption is detected.
351 In order to take advantage of these features, a pool must make use of some form
352 of redundancy, using either mirrored or raidz groups.
353 While ZFS supports running in a non-redundant configuration, where each root
354 vdev is simply a disk or file, this is strongly discouraged.
355 A single case of bit corruption can render some or all of your data unavailable.
357 A pool's health status is described by one of three states: online, degraded,
359 An online pool has all devices operating normally.
360 A degraded pool is one in which one or more devices have failed, but the data is
361 still available due to a redundant configuration.
362 A faulted pool has corrupted metadata, or one or more faulted devices, and
363 insufficient replicas to continue functioning.
365 The health of the top-level vdev, such as mirror or raidz device, is
366 potentially impacted by the state of its associated vdevs, or component
368 A top-level vdev or component device is in one of the following states:
369 .Bl -tag -width "DEGRADED"
371 One or more top-level vdevs is in the degraded state because one or more
372 component devices are offline.
373 Sufficient replicas exist to continue functioning.
375 One or more component devices is in the degraded or faulted state, but
376 sufficient replicas exist to continue functioning.
377 The underlying conditions are as follows:
380 The number of checksum errors exceeds acceptable levels and the device is
381 degraded as an indication that something may be wrong.
382 ZFS continues to use the device as necessary.
384 The number of I/O errors exceeds acceptable levels.
385 The device could not be marked as faulted because there are insufficient
386 replicas to continue functioning.
389 One or more top-level vdevs is in the faulted state because one or more
390 component devices are offline.
391 Insufficient replicas exist to continue functioning.
393 One or more component devices is in the faulted state, and insufficient
394 replicas exist to continue functioning.
395 The underlying conditions are as follows:
398 The device could be opened, but the contents did not match expected values.
400 The number of I/O errors exceeds acceptable levels and the device is faulted to
401 prevent further use of the device.
404 The device was explicitly taken offline by the
408 The device is online and functioning.
410 The device was physically removed while the system was running.
411 Device removal detection is hardware-dependent and may not be supported on all
414 The device could not be opened.
415 If a pool is imported when a device was unavailable, then the device will be
416 identified by a unique identifier instead of its path since the path was never
417 correct in the first place.
420 If a device is removed and later re-attached to the system, ZFS attempts
421 to put the device online automatically.
422 Device attach detection is hardware-dependent and might not be supported on all
425 ZFS allows devices to be associated with pools as
427 These devices are not actively used in the pool, but when an active device
428 fails, it is automatically replaced by a hot spare.
429 To create a pool with hot spares, specify a
431 vdev with any number of devices.
434 # zpool create pool mirror sda sdb spare sdc sdd
437 Spares can be shared across multiple pools, and can be added with the
439 command and removed with the
442 Once a spare replacement is initiated, a new
444 vdev is created within the configuration that will remain there until the
445 original device is replaced.
446 At this point, the hot spare becomes available again if another device fails.
448 If a pool has a shared spare that is currently being used, the pool can not be
449 exported since other pools may use this shared spare, which may lead to
450 potential data corruption.
452 Shared spares add some risk. If the pools are imported on different hosts, and
453 both pools suffer a device failure at the same time, both could attempt to use
454 the spare at the same time. This may not be detected, resulting in data
457 An in-progress spare replacement can be cancelled by detaching the hot spare.
458 If the original faulted device is detached, then the hot spare assumes its
459 place in the configuration, and is removed from the spare list of all active
462 Spares cannot replace log devices.
464 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
466 For instance, databases often require their transactions to be on stable storage
467 devices when returning from a system call.
468 NFS and other applications can also use
470 to ensure data stability.
471 By default, the intent log is allocated from blocks within the main pool.
472 However, it might be possible to get better performance using separate intent
473 log devices such as NVRAM or a dedicated disk.
476 # zpool create pool sda sdb log sdc
479 Multiple log devices can also be specified, and they can be mirrored.
482 section for an example of mirroring multiple log devices.
484 Log devices can be added, replaced, attached, detached and removed. In
485 addition, log devices are imported and exported as part of the pool
487 Mirrored devices can be removed by specifying the top-level mirror vdev.
489 Devices can be added to a storage pool as
491 These devices provide an additional layer of caching between main memory and
493 For read-heavy workloads, where the working set size is much larger than what
494 can be cached in main memory, using cache devices allow much more of this
495 working set to be served from low latency media.
496 Using cache devices provides the greatest performance improvement for random
497 read-workloads of mostly static content.
499 To create a pool with cache devices, specify a
501 vdev with any number of devices.
504 # zpool create pool sda sdb cache sdc sdd
507 Cache devices cannot be mirrored or part of a raidz configuration.
508 If a read error is encountered on a cache device, that read I/O is reissued to
509 the original storage pool device, which might be part of a mirrored or raidz
512 The content of the cache devices is considered volatile, as is the case with
515 Before starting critical procedures that include destructive actions (e.g
517 ), an administrator can checkpoint the pool's state and in the case of a
518 mistake or failure, rewind the entire pool back to the checkpoint.
519 Otherwise, the checkpoint can be discarded when the procedure has completed
522 A pool checkpoint can be thought of as a pool-wide snapshot and should be used
523 with care as it contains every part of the pool's state, from properties to vdev
525 Thus, while a pool has a checkpoint certain operations are not allowed.
526 Specifically, vdev removal/attach/detach, mirror splitting, and
527 changing the pool's guid.
528 Adding a new vdev is supported but in the case of a rewind it will have to be
530 Finally, users of this feature should keep in mind that scrubs in a pool that
531 has a checkpoint do not repair checkpointed data.
533 To create a checkpoint for a pool:
535 # zpool checkpoint pool
538 To later rewind to its checkpointed state, you need to first export it and
539 then rewind it during import:
542 # zpool import --rewind-to-checkpoint pool
545 To discard the checkpoint from a pool:
547 # zpool checkpoint -d pool
550 Dataset reservations (controlled by the
554 zfs properties) may be unenforceable while a checkpoint exists, because the
555 checkpoint is allowed to consume the dataset's reservation.
556 Finally, data that is part of the checkpoint but has been freed in the
557 current state of the pool won't be scanned during a scrub.
558 .Ss Special Allocation Class
559 The allocations in the special class are dedicated to specific block types.
560 By default this includes all metadata, the indirect blocks of user data, and
561 any dedup data. The class can also be provisioned to accept a limited
562 percentage of small file data blocks.
564 A pool must always have at least one general (non-specified) vdev before
565 other devices can be assigned to the special class. If the special class
566 becomes full, then allocations intended for it will spill back into the
569 Dedup data can be excluded from the special class by setting the
570 .Sy zfs_ddt_data_is_special
571 zfs module parameter to false (0).
573 Inclusion of small file blocks in the special class is opt-in. Each dataset
574 can control the size of small file blocks allowed in the special class by
576 .Sy special_small_blocks
577 dataset property. It defaults to zero, so you must opt-in by setting it to a
580 for more info on setting this property.
582 Each pool has several properties associated with it.
583 Some properties are read-only statistics while others are configurable and
584 change the behavior of the pool.
586 The following are read-only properties:
589 Amount of storage used within the pool.
594 for more information.
596 Percentage of pool space used.
597 This property can also be referred to by its shortened column name,
600 Amount of uninitialized space within the pool or device that can be used to
601 increase the total capacity of the pool.
602 Uninitialized space consists of any space on an EFI labeled vdev which has not
605 .Nm zpool Cm online Fl e
607 This space occurs when a LUN is dynamically expanded.
609 The amount of fragmentation in the pool. As the amount of space
611 increases, it becomes more difficult to locate
613 space. This may result in lower write performance compared to pools with more
614 unfragmented free space.
616 The amount of free space available in the pool.
620 property describes how much new data can be written to ZFS filesystems/volumes.
623 property is not generally useful for this purpose, and can be substantially more than the zfs
625 space. This discrepancy is due to several factors, including raidz party; zfs
626 reservation, quota, refreservation, and refquota properties; and space set aside by
629 .Xr zfs-module-parameters 5
630 for more information).
632 After a file system or snapshot is destroyed, the space it was using is
633 returned to the pool asynchronously.
635 is the amount of space remaining to be reclaimed.
642 The current health of the pool.
644 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
646 A unique identifier for the pool.
648 A unique identifier for the pool.
651 property, this identifier is generated every time we load the pool (e.g. does
652 not persist across imports/exports) and never changes while the pool is loaded
655 operation takes place).
657 Total size of the storage pool.
658 .It Sy unsupported@ Ns Em feature_guid
659 Information about unsupported features that are enabled on the pool.
665 The space usage properties report actual physical space available to the
667 The physical space can be different from the total amount of space that any
668 contained datasets can actually use.
669 The amount of space used in a raidz configuration depends on the characteristics
670 of the data being written.
671 In addition, ZFS reserves some space for internal accounting that the
673 command takes into account, but the
676 For non-full pools of a reasonable size, these effects should be invisible.
677 For small pools, or pools that are close to being completely full, these
678 discrepancies may become more noticeable.
680 The following property can be set at creation time and import time:
683 Alternate root directory.
684 If set, this directory is prepended to any mount points within the pool.
685 This can be used when examining an unknown pool where the mount points cannot be
686 trusted, or in an alternate boot environment, where the typical paths are not
689 is not a persistent property.
690 It is valid only while the system is up.
694 .Sy cachefile Ns = Ns Sy none ,
695 though this may be overridden using an explicit setting.
698 The following property can be set only at import time:
700 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
703 the pool will be imported in read-only mode.
704 This property can also be referred to by its shortened column name,
708 The following properties can be set at creation time and import time, and later
713 .It Sy ashift Ns = Ns Sy ashift
714 Pool sector size exponent, to the power of
716 (internally referred to as
718 ). Values from 9 to 16, inclusive, are valid; also, the
719 value 0 (the default) means to auto-detect using the kernel's block
720 layer and a ZFS internal exception list. I/O operations will be aligned
721 to the specified size boundaries. Additionally, the minimum (disk)
722 write size will be set to the specified size, so this represents a
723 space vs. performance trade-off. For optimal performance, the pool
724 sector size should be greater than or equal to the sector size of the
725 underlying disks. The typical case for setting this property is when
726 performance is important and the underlying disks use 4KiB sectors but
727 report 512B sectors to the OS (for compatibility reasons); in that
730 (which is 1<<12 = 4096). When set, this property is
731 used as the default hint value in subsequent vdev operations (add,
732 attach and replace). Changing this value will not modify any existing
733 vdev, not even on disk replacement; however it can be used, for
734 instance, to replace a dying 512B sectors disk with a newer 4KiB
735 sectors device: this will probably result in bad performance but at the
736 same time could prevent loss of data.
737 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
738 Controls automatic pool expansion when the underlying LUN is grown.
741 the pool will be resized according to the size of the expanded device.
742 If the device is part of a mirror or raidz then all devices within that
743 mirror/raidz group must be expanded before the new space is made available to
745 The default behavior is
747 This property can also be referred to by its shortened column name,
749 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
750 Controls automatic device replacement.
753 device replacement must be initiated by the administrator by using the
758 any new device, found in the same physical location as a device that previously
759 belonged to the pool, is automatically formatted and replaced.
760 The default behavior is
762 This property can also be referred to by its shortened column name,
764 Autoreplace can also be used with virtual disks (like device
765 mapper) provided that you use the /dev/disk/by-vdev paths setup by
766 vdev_id.conf. See the
768 man page for more details.
769 Autoreplace and autoonline require the ZFS Event Daemon be configured and
772 man page for more details.
773 .It Sy bootfs Ns = Ns Sy (unset) Ns | Ns Ar pool Ns / Ns Ar dataset
774 Identifies the default bootable dataset for the root pool. This property is
775 expected to be set mainly by the installation and upgrade programs.
776 Not all Linux distribution boot processes use the bootfs property.
777 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
778 Controls the location of where the pool configuration is cached.
779 Discovering all pools on system startup requires a cached copy of the
780 configuration data that is stored on the root file system.
781 All pools in this cache are automatically imported when the system boots.
782 Some environments, such as install and clustering, need to cache this
783 information in a different location so that pools are not automatically
785 Setting this property caches the pool configuration in a different location that
786 can later be imported with
787 .Nm zpool Cm import Fl c .
788 Setting it to the value
790 creates a temporary pool that is never cached, and the
793 uses the default location.
795 Multiple pools can share the same cache file.
796 Because the kernel destroys and recreates this file when pools are added and
797 removed, care should be taken when attempting to access this file.
798 When the last pool using a
800 is exported or destroyed, the file will be empty.
801 .It Sy comment Ns = Ns Ar text
802 A text string consisting of printable ASCII characters that will be stored
803 such that it is available even if the pool becomes faulted.
804 An administrator can provide additional information about a pool using this
806 .It Sy dedupditto Ns = Ns Ar number
807 Threshold for the number of block ditto copies.
808 If the reference count for a deduplicated block increases above this number, a
809 new ditto copy of this block is automatically stored.
810 The default setting is
812 which causes no ditto copies to be created for deduplicated blocks.
813 The minimum legal nonzero setting is
815 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
816 Controls whether a non-privileged user is granted access based on the dataset
817 permissions defined on the dataset.
820 for more information on ZFS delegated administration.
821 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
822 Controls the system behavior in the event of catastrophic pool failure.
823 This condition is typically a result of a loss of connectivity to the underlying
824 storage device(s) or a failure of all devices within the pool.
825 The behavior of such an event is determined as follows:
826 .Bl -tag -width "continue"
828 Blocks all I/O access until the device connectivity is recovered and the errors
830 This is the default behavior.
834 to any new write I/O requests but allows reads to any of the remaining healthy
836 Any write requests that have yet to be committed to disk would be blocked.
838 Prints out a message to the console and generates a system crash dump.
840 .It Sy autotrim Ns = Ns Sy on Ns | Ns Sy off
843 space which has been recently freed, and is no longer allocated by the pool,
844 will be periodically trimmed. This allows block device vdevs which support
845 BLKDISCARD, such as SSDs, or file vdevs on which the underlying file system
846 supports hole-punching, to reclaim unused blocks. The default setting for
850 Automatic TRIM does not immediately reclaim blocks after a free. Instead,
851 it will optimistically delay allowing smaller ranges to be aggregated in to
852 a few larger ones. These can then be issued more efficiently to the storage.
854 Be aware that automatic trimming of recently freed data blocks can put
855 significant stress on the underlying storage devices. This will vary
856 depending of how well the specific device handles these commands. For
857 lower end devices it is often possible to achieve most of the benefits
858 of automatic trimming by running an on-demand (manual) TRIM periodically
862 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
863 The value of this property is the current state of
865 The only valid value when setting this property is
869 to the enabled state.
872 for details on feature states.
873 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
874 Controls whether information about snapshots associated with this pool is
882 This property can also be referred to by its shortened name,
884 .It Sy multihost Ns = Ns Sy on Ns | Ns Sy off
885 Controls whether a pool activity check should be performed during
886 .Nm zpool Cm import .
887 When a pool is determined to be active it cannot be imported, even with the
889 option. This property is intended to be used in failover configurations
890 where multiple hosts have access to a pool on shared storage.
892 Multihost provides protection on import only. It does not protect against an
893 individual device being used in multiple pools, regardless of the type of vdev.
894 See the discussion under
897 When this property is on, periodic writes to storage occur to show the pool is
899 .Sy zfs_multihost_interval
901 .Xr zfs-module-parameters 5
902 man page. In order to enable this property each host must set a unique hostid.
906 .Xr spl-module-parameters 5
907 for additional details. The default value is
909 .It Sy version Ns = Ns Ar version
910 The current on-disk version of the pool.
911 This can be increased, but never decreased.
912 The preferred method of updating pools is with the
914 command, though this property can be used when a specific version is needed for
915 backwards compatibility.
916 Once feature flags are enabled on a pool this property will no longer have a
920 All subcommands that modify state are logged persistently to the pool in their
925 command provides subcommands to create and destroy storage pools, add capacity
926 to storage pools, and provide information about the storage pools.
927 The following subcommands are supported:
933 Displays a help message.
938 .Oo Fl o Ar property Ns = Ns Ar value Oc
941 Adds the specified virtual devices to the given pool.
944 specification is described in the
949 option, and the device checks performed are described in the
956 even if they appear in use or specify a conflicting replication level.
957 Not all devices can be overridden in this manner.
961 GUIDs instead of the normal device names. These GUIDs can be used in place of
962 device names for the zpool detach/offline/remove/replace commands.
964 Display real paths for
966 resolving all symbolic links. This can be used to look up the current block
967 device name regardless of the /dev/disk/ path used to open it.
969 Displays the configuration that would be used without actually adding the
971 The actual pool creation can still fail due to insufficient privileges or
974 Display real paths for
976 instead of only the last component of the path. This can be used in
980 .It Fl o Ar property Ns = Ns Ar value
981 Sets the given pool properties. See the
983 section for a list of valid properties that can be set. The only property
984 supported at the moment is ashift.
990 .Oo Fl o Ar property Ns = Ns Ar value Oc
991 .Ar pool device new_device
997 The existing device cannot be part of a raidz configuration.
1000 is not currently part of a mirrored configuration,
1002 automatically transforms into a two-way mirror of
1008 is part of a two-way mirror, attaching
1010 creates a three-way mirror, and so on.
1013 begins to resilver immediately.
1018 even if it appears to be in use.
1019 Not all devices can be overridden in this manner.
1020 .It Fl o Ar property Ns = Ns Ar value
1021 Sets the given pool properties. See the
1023 section for a list of valid properties that can be set. The only property
1024 supported at the moment is ashift.
1032 Checkpoints the current state of
1034 , which can be later restored by
1035 .Nm zpool Cm import --rewind-to-checkpoint .
1036 The existence of a checkpoint in a pool prohibits the following
1045 In addition, it may break reservation boundaries if the pool lacks free
1049 command indicates the existence of a checkpoint or the progress of discarding a
1050 checkpoint from a pool.
1053 command reports how much space the checkpoint takes from the pool.
1056 Discards an existing checkpoint from
1065 Clears device errors in a pool.
1066 If no arguments are specified, all device errors within the pool are cleared.
1067 If one or more devices is specified, only those errors associated with the
1068 specified device or devices are cleared.
1069 If multihost is enabled, and the pool has been suspended, this will not
1070 resume I/O. While the pool was suspended, it may have been imported on
1071 another host, and resuming I/O could result in pool damage.
1076 .Op Fl m Ar mountpoint
1077 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1078 .Oo Fl o Ar feature@feature Ns = Ns Ar value Oc Ns ...
1079 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
1082 .Ar pool vdev Ns ...
1084 Creates a new storage pool containing the virtual devices specified on the
1086 The pool name must begin with a letter, and can only contain
1087 alphanumeric characters as well as underscore
1103 are reserved, as are names beginning with
1111 specification is described in the
1115 The command attempts to verify that each device specified is accessible and not
1116 currently in use by another subsystem. However this check is not robust enough
1117 to detect simultaneous attempts to use a new device in different pools, even if
1122 administrator must ensure that simultaneous invocations of any combination of
1127 .Sy zpool labelclear ,
1128 do not refer to the same device. Using the same device in two pools will
1129 result in pool corruption.
1131 There are some uses, such as being currently mounted, or specified as the
1132 dedicated dump device, that prevents a device from ever being used by ZFS.
1133 Other uses, such as having a preexisting UFS file system, can be overridden with
1138 The command also checks that the replication strategy for the pool is
1140 An attempt to combine redundant and non-redundant storage in a single pool, or
1141 to mix disks and files, results in an error unless
1144 The use of differently sized devices within a single raidz or mirror group is
1145 also flagged as an error unless
1151 option is specified, the default mount point is
1153 The mount point must not exist or must be empty, or else the root dataset
1155 This can be overridden with the
1159 By default all supported features are enabled on the new pool unless the
1161 option is specified.
1164 Do not enable any features on the new pool.
1165 Individual features can be enabled by setting their corresponding properties to
1171 .Xr zpool-features 5
1172 for details about feature properties.
1176 even if they appear in use or specify a conflicting replication level.
1177 Not all devices can be overridden in this manner.
1178 .It Fl m Ar mountpoint
1179 Sets the mount point for the root dataset.
1180 The default mount point is
1187 The mount point must be an absolute path,
1191 For more information on dataset mount points, see
1194 Displays the configuration that would be used without actually creating the
1196 The actual pool creation can still fail due to insufficient privileges or
1198 .It Fl o Ar property Ns = Ns Ar value
1199 Sets the given pool properties.
1202 section for a list of valid properties that can be set.
1203 .It Fl o Ar feature@feature Ns = Ns Ar value
1204 Sets the given pool feature. See the
1205 .Xr zpool-features 5
1206 section for a list of valid features that can be set.
1207 Value can be either disabled or enabled.
1208 .It Fl O Ar file-system-property Ns = Ns Ar value
1209 Sets the given file system properties in the root file system of the pool.
1214 for a list of valid properties that can be set.
1217 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
1219 Sets the in-core pool name to
1221 while the on-disk name will be the name specified as the pool name
1223 This will set the default cachefile property to none. This is intended
1224 to handle name space collisions when creating pools for other systems,
1225 such as virtual machines or physical machines whose pools live on network
1234 Destroys the given pool, freeing up any devices for other use.
1235 This command tries to unmount any active datasets before destroying the pool.
1238 Forces any active datasets contained within the pool to be unmounted.
1248 The operation is refused if there are no other valid replicas of the data.
1249 If device may be re-added to the pool later on then consider the
1255 .Op Fl vHf Oo Ar pool Oc | Fl c
1257 Lists all recent events generated by the ZFS kernel modules. These events
1260 and used to automate administrative tasks such as replacing a failed device
1261 with a hot spare. For more information about the subclasses and event payloads
1262 that can be generated see the
1267 Clear all previous events.
1271 Scripted mode. Do not display headers, and separate fields by a
1272 single tab instead of arbitrary space.
1274 Print the entire payload for each event.
1283 Exports the given pools from the system.
1284 All devices are marked as exported, but are still considered in use by other
1286 The devices can be moved between systems
1287 .Pq even those of different endianness
1288 and imported as long as a sufficient number of devices are present.
1290 Before exporting the pool, all datasets within the pool are unmounted.
1291 A pool can not be exported if it has a shared spare that is currently being
1294 For pools to be portable, you must give the
1296 command whole disks, not just partitions, so that ZFS can label the disks with
1297 portable EFI labels.
1298 Otherwise, disk drivers on platforms of different endianness will not recognize
1302 Exports all pools imported on the system.
1304 Forcefully unmount all datasets, using the
1308 This command will forcefully export the pool even if it has a shared spare that
1309 is currently being used.
1310 This may lead to potential data corruption.
1316 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1317 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1318 .Oo Ar pool Oc Ns ...
1320 Retrieves the given list of properties
1322 or all properties if
1326 for the specified storage pool(s).
1327 These properties are displayed with the following fields:
1329 name Name of storage pool
1330 property Property name
1331 value Property value
1332 source Property source, either 'default' or 'local'.
1337 section for more information on the available pool properties.
1341 Do not display headers, and separate fields by a single tab instead of arbitrary
1344 A comma-separated list of columns to display.
1345 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
1346 is the default value.
1348 Display numbers in parsable (exact) values.
1354 .Oo Ar pool Oc Ns ...
1356 Displays the command history of the specified pool(s) or all pools if no pool is
1360 Displays internally logged ZFS events in addition to user initiated events.
1362 Displays log records in long format, which in addition to standard format
1363 includes, the user name, the hostname, and the zone in which the operation was
1370 .Op Fl d Ar dir Ns | Ns device
1372 Lists pools available to import.
1375 option is not specified, this command searches for devices in
1379 option can be specified multiple times, and all directories are searched.
1380 If the device appears to be part of an exported pool, this command displays a
1381 summary of the pool with the name of the pool, a numeric identifier, as well as
1382 the vdev layout and current health of the device for each device or file.
1383 Destroyed pools, pools that were previously destroyed with the
1384 .Nm zpool Cm destroy
1385 command, are not listed unless the
1387 option is specified.
1389 The numeric identifier is unique, and can be used instead of the pool name when
1390 multiple exported pools of the same name are available.
1392 .It Fl c Ar cachefile
1393 Reads configuration from the given
1395 that was created with the
1400 is used instead of searching for devices.
1401 .It Fl d Ar dir Ns | Ns Ar device
1404 or searches for devices or files in
1408 option can be specified multiple times.
1410 Lists destroyed pools only.
1417 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
1418 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
1420 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1424 Imports all pools found in the search directories.
1425 Identical to the previous command, except that all pools with a sufficient
1426 number of devices available are imported.
1427 Destroyed pools, pools that were previously destroyed with the
1428 .Nm zpool Cm destroy
1429 command, will not be imported unless the
1431 option is specified.
1434 Searches for and imports all pools found.
1435 .It Fl c Ar cachefile
1436 Reads configuration from the given
1438 that was created with the
1443 is used instead of searching for devices.
1444 .It Fl d Ar dir Ns | Ns Ar device
1447 or searches for devices or files in
1451 option can be specified multiple times.
1452 This option is incompatible with the
1456 Imports destroyed pools only.
1459 option is also required.
1461 Forces import, even if the pool appears to be potentially active.
1463 Recovery mode for a non-importable pool.
1464 Attempt to return the pool to an importable state by discarding the last few
1466 Not all damaged pools can be recovered by using this option.
1467 If successful, the data from the discarded transactions is irretrievably lost.
1468 This option is ignored if the pool is importable or already imported.
1470 Indicates that this command will request encryption keys for all encrypted
1471 datasets it attempts to mount as it is bringing the pool online. Note that if
1476 this command will block waiting for the keys to be entered. Without this flag
1477 encrypted datasets will be left unavailable until the keys are loaded.
1479 Allows a pool to import when there is a missing log device.
1480 Recent transactions can be lost because the log device will be discarded.
1485 Determines whether a non-importable pool can be made importable again, but does
1486 not actually perform the pool recovery.
1487 For more details about pool recovery mode, see the
1491 Import the pool without mounting any file systems.
1493 Comma-separated list of mount options to use when mounting datasets within the
1497 for a description of dataset properties and mount options.
1498 .It Fl o Ar property Ns = Ns Ar value
1499 Sets the specified property on the imported pool.
1502 section for more information on the available pool properties.
1512 .It Fl -rewind-to-checkpoint
1513 Rewinds pool to the checkpointed state.
1514 Once the pool is imported with this flag there is no way to undo the rewind.
1515 All changes and data that were written after the checkpoint are lost!
1516 The only exception is when the
1518 mounting option is enabled.
1519 In this case, the checkpointed state of the pool is opened and an
1520 administrator can see how the pool would look like if they were
1523 Scan using the default search path, the libblkid cache will not be
1524 consulted. A custom search path may be specified by setting the
1525 ZPOOL_IMPORT_PATH environment variable.
1529 recovery option. Determines whether extreme
1530 measures to find a valid txg should take place. This allows the pool to
1531 be rolled back to a txg which is no longer guaranteed to be consistent.
1532 Pools imported at an inconsistent txg may contain uncorrectable
1533 checksum errors. For more details about pool recovery mode, see the
1535 option, above. WARNING: This option can be extremely hazardous to the
1536 health of your pool and should only be used as a last resort.
1538 Specify the txg to use for rollback. Implies
1541 about pool recovery mode, see the
1543 option, above. WARNING: This option can be extremely hazardous to the
1544 health of your pool and should only be used as a last resort.
1550 .Op Fl F Oo Fl n Oc Oo Fl t Oc Oo Fl T Oc Oo Fl X Oc
1551 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
1553 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1556 .Ar pool Ns | Ns Ar id
1559 Imports a specific pool.
1560 A pool can be identified by its name or the numeric identifier.
1563 is specified, the pool is imported using the name
1565 Otherwise, it is imported with the same name as its exported name.
1567 If a device is removed from a system without running
1569 first, the device appears as potentially active.
1570 It cannot be determined if this was a failed export, or whether the device is
1571 really in use from another host.
1572 To import a pool in this state, the
1576 .It Fl c Ar cachefile
1577 Reads configuration from the given
1579 that was created with the
1584 is used instead of searching for devices.
1585 .It Fl d Ar dir Ns | Ns Ar device
1588 or searches for devices or files in
1592 option can be specified multiple times.
1593 This option is incompatible with the
1597 Imports destroyed pool.
1600 option is also required.
1602 Forces import, even if the pool appears to be potentially active.
1604 Recovery mode for a non-importable pool.
1605 Attempt to return the pool to an importable state by discarding the last few
1607 Not all damaged pools can be recovered by using this option.
1608 If successful, the data from the discarded transactions is irretrievably lost.
1609 This option is ignored if the pool is importable or already imported.
1611 Indicates that this command will request encryption keys for all encrypted
1612 datasets it attempts to mount as it is bringing the pool online. Note that if
1617 this command will block waiting for the keys to be entered. Without this flag
1618 encrypted datasets will be left unavailable until the keys are loaded.
1620 Allows a pool to import when there is a missing log device.
1621 Recent transactions can be lost because the log device will be discarded.
1626 Determines whether a non-importable pool can be made importable again, but does
1627 not actually perform the pool recovery.
1628 For more details about pool recovery mode, see the
1632 Comma-separated list of mount options to use when mounting datasets within the
1636 for a description of dataset properties and mount options.
1637 .It Fl o Ar property Ns = Ns Ar value
1638 Sets the specified property on the imported pool.
1641 section for more information on the available pool properties.
1652 Scan using the default search path, the libblkid cache will not be
1653 consulted. A custom search path may be specified by setting the
1654 ZPOOL_IMPORT_PATH environment variable.
1658 recovery option. Determines whether extreme
1659 measures to find a valid txg should take place. This allows the pool to
1660 be rolled back to a txg which is no longer guaranteed to be consistent.
1661 Pools imported at an inconsistent txg may contain uncorrectable
1662 checksum errors. For more details about pool recovery mode, see the
1664 option, above. WARNING: This option can be extremely hazardous to the
1665 health of your pool and should only be used as a last resort.
1667 Specify the txg to use for rollback. Implies
1670 about pool recovery mode, see the
1672 option, above. WARNING: This option can be extremely hazardous to the
1673 health of your pool and should only be used as a last resort.
1679 is temporary. Temporary pool names last until export. Ensures that
1680 the original pool name will be used in all label updates and therefore
1681 is retained upon export.
1682 Will also set -o cachefile=none when not explicitly specified.
1689 .Op Ar device Ns ...
1691 Begins initializing by writing to all unallocated regions on the specified
1692 devices, or all eligible devices in the pool if no individual devices are
1694 Only leaf data or log devices may be initialized.
1697 Cancel initializing on the specified devices, or all eligible devices if none
1699 If one or more target devices are invalid or are not currently being
1700 initialized, the command will fail and no cancellation will occur on any device.
1702 Suspend initializing on the specified devices, or all eligible devices if none
1704 If one or more target devices are invalid or are not currently being
1705 initialized, the command will fail and no suspension will occur on any device.
1706 Initializing can then be resumed by running
1707 .Nm zpool Cm initialize
1708 with no flags on the relevant target devices.
1713 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
1714 .Op Fl T Sy u Ns | Ns Sy d
1716 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
1717 .Op Ar interval Op Ar count
1719 Displays logical I/O statistics for the given pools/vdevs. Physical I/Os may
1722 If writes are located nearby, they may be merged into a single
1723 larger operation. Additional I/O may be generated depending on the level of
1725 To filter output, you may pass in a list of pools, a pool and list of vdevs
1726 in that pool, or a list of any vdevs from any pool. If no items are specified,
1727 statistics for every pool in the system are shown.
1730 the statistics are printed every
1732 seconds until ^C is pressed. If
1734 flag is specified the headers are displayed only once, otherwise they are
1735 displayed periodically. If count is specified, the command exits
1736 after count reports are printed. The first report printed is always
1737 the statistics since boot regardless of whether
1741 are passed. However, this behavior can be suppressed with the
1743 flag. Also note that the units of
1747 that are printed in the report are in base 1024. To get the raw
1752 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1753 Run a script (or scripts) on each vdev and include the output as a new column
1756 output. Users can run any script found in their
1758 directory or from the system
1759 .Pa /etc/zfs/zpool.d
1760 directory. Script names containing the slash (/) character are not allowed.
1761 The default search path can be overridden by setting the
1762 ZPOOL_SCRIPTS_PATH environment variable. A privileged user can run
1764 if they have the ZPOOL_SCRIPTS_AS_ROOT
1765 environment variable set. If a script requires the use of a privileged
1768 then it's recommended you allow the user access to it in
1770 or add the user to the
1771 .Pa /etc/sudoers.d/zfs
1776 is passed without a script name, it prints a list of all scripts.
1778 also sets verbose mode
1779 .No \&( Ns Fl v Ns No \&).
1781 Script output should be in the form of "name=value". The column name is
1782 set to "name" and the value is set to "value". Multiple lines can be
1783 used to output multiple columns. The first line of output not in the
1784 "name=value" format is displayed without a column title, and no more
1785 output after that is displayed. This can be useful for printing error
1786 messages. Blank or NULL values are printed as a '-' to make output
1789 The following environment variables are set before running each script:
1790 .Bl -tag -width "VDEV_PATH"
1792 Full path to the vdev
1794 .Bl -tag -width "VDEV_UPATH"
1796 Underlying path to the vdev (/dev/sd*). For use with device mapper,
1797 multipath, or partitioned vdevs.
1799 .Bl -tag -width "VDEV_ENC_SYSFS_PATH"
1800 .It Sy VDEV_ENC_SYSFS_PATH
1801 The sysfs path to the enclosure for the vdev (if any).
1803 .It Fl T Sy u Ns | Ns Sy d
1804 Display a time stamp.
1807 for a printed representation of the internal representation of time.
1812 for standard date format.
1816 Display vdev GUIDs instead of the normal device names. These GUIDs
1817 can be used in place of device names for the zpool
1818 detach/offline/remove/replace commands.
1820 Scripted mode. Do not display headers, and separate fields by a
1821 single tab instead of arbitrary space.
1823 Display real paths for vdevs resolving all symbolic links. This can
1824 be used to look up the current block device name regardless of the
1826 path used to open it.
1828 Print headers only once when passed
1830 Display numbers in parsable (exact) values. Time values are in
1833 Display full paths for vdevs instead of only the last component of
1834 the path. This can be used in conjunction with the
1838 Print request size histograms for the leaf vdev's IO. This includes
1839 histograms of individual IOs (ind) and aggregate IOs (agg). These stats
1840 can be useful for observing how well IO aggregation is working. Note
1841 that TRIM IOs may exceed 16M, but will be counted as 16M.
1843 Verbose statistics Reports usage statistics for individual vdevs within the
1844 pool, in addition to the pool-wide statistics.
1846 Omit statistics since boot.
1847 Normally the first line of output reports the statistics since boot.
1848 This option suppresses that first line of output.
1851 Display latency histograms:
1854 Total IO time (queuing + disk IO time).
1856 Disk IO time (time reading/writing the disk).
1858 Amount of time IO spent in synchronous priority queues. Does not include
1861 Amount of time IO spent in asynchronous priority queues. Does not include
1864 Amount of time IO spent in scrub queue. Does not include disk time.
1866 Include average latency statistics:
1869 Average total IO time (queuing + disk IO time).
1871 Average disk IO time (time reading/writing the disk).
1873 Average amount of time IO spent in synchronous priority queues. Does
1874 not include disk time.
1876 Average amount of time IO spent in asynchronous priority queues.
1877 Does not include disk time.
1879 Average queuing time in scrub queue. Does not include disk time.
1881 Average queuing time in trim queue. Does not include disk time.
1883 Include active queue statistics. Each priority queue has both
1888 IOs. Pending IOs are waiting to
1889 be issued to the disk, and active IOs have been issued to disk and are
1890 waiting for completion. These stats are broken out by priority queue:
1892 .Ar syncq_read/write :
1893 Current number of entries in synchronous priority
1895 .Ar asyncq_read/write :
1896 Current number of entries in asynchronous priority queues.
1898 Current number of entries in scrub queue.
1900 Current number of entries in trim queue.
1902 All queue statistics are instantaneous measurements of the number of
1903 entries in the queues. If you specify an interval, the measurements
1904 will be sampled from the end of the interval.
1912 Removes ZFS label information from the specified
1916 must not be part of an active pool configuration.
1919 Treat exported or foreign devices as inactive.
1925 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1926 .Op Fl T Sy u Ns | Ns Sy d
1927 .Oo Ar pool Oc Ns ...
1928 .Op Ar interval Op Ar count
1930 Lists the given pools along with a health status and space usage.
1933 are specified, all pools in the system are listed.
1936 the information is printed every
1938 seconds until ^C is pressed.
1941 is specified, the command exits after
1943 reports are printed.
1946 Display vdev GUIDs instead of the normal device names. These GUIDs
1947 can be used in place of device names for the zpool
1948 detach/offline/remove/replace commands.
1951 Do not display headers, and separate fields by a single tab instead of arbitrary
1953 .It Fl o Ar property
1954 Comma-separated list of properties to display.
1957 section for a list of valid properties.
1959 .Cm name , size , allocated , free , checkpoint, expandsize , fragmentation ,
1960 .Cm capacity , dedupratio , health , altroot .
1962 Display real paths for vdevs resolving all symbolic links. This can
1963 be used to look up the current block device name regardless of the
1964 /dev/disk/ path used to open it.
1966 Display numbers in parsable
1970 Display full paths for vdevs instead of only the last component of
1971 the path. This can be used in conjunction with the
1974 .It Fl T Sy u Ns | Ns Sy d
1975 Display a time stamp.
1978 for a printed representation of the internal representation of time.
1983 for standard date format.
1988 Reports usage statistics for individual vdevs within the pool, in addition to
1989 the pool-wise statistics.
1996 .Ar pool Ar device Ns ...
1998 Takes the specified physical device offline.
2001 is offline, no attempt is made to read or write to the device.
2002 This command is not applicable to spares.
2005 Force fault. Instead of offlining the disk, put it into a faulted
2006 state. The fault will persist across imports unless the
2011 Upon reboot, the specified physical device reverts to its previous state.
2017 .Ar pool Ar device Ns ...
2019 Brings the specified physical device online.
2020 This command is not applicable to spares.
2023 Expand the device to use all available space.
2024 If the device is part of a mirror or raidz then all devices must be expanded
2025 before the new space will become available to the pool.
2032 Generates a new unique identifier for the pool.
2033 You must ensure that all devices in this pool are online and healthy before
2034 performing this action.
2041 Reopen all the vdevs associated with the pool.
2044 Do not restart an in-progress scrub operation. This is not recommended and can
2045 result in partially resilvered devices unless a second scrub is performed.
2051 .Ar pool Ar device Ns ...
2053 Removes the specified device from the pool.
2054 This command supports removing hot spare, cache, log, and both mirrored and
2055 non-redundant primary top-level vdevs, including dedup and special vdevs.
2056 When the primary pool storage includes a top-level raidz vdev only hot spare,
2057 cache, and log devices can be removed.
2059 Removing a top-level vdev reduces the total amount of space in the storage pool.
2060 The specified device will be evacuated by copying all allocated space from it to
2061 the other devices in the pool.
2064 command initiates the removal and returns, while the evacuation continues in
2066 The removal progress can be monitored with
2067 .Nm zpool Cm status .
2068 If an IO error is encountered during the removal process it will be
2071 feature flag must be enabled to remove a top-level vdev, see
2072 .Xr zpool-features 5 .
2074 A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
2076 Non-log devices or data devices that are part of a mirrored configuration can be removed using
2082 Do not actually perform the removal ("no-op").
2083 Instead, print the estimated amount of memory that will be used by the
2084 mapping table after the removal completes.
2085 This is nonzero only for top-level vdevs.
2089 Used in conjunction with the
2091 flag, displays numbers as parsable (exact) values.
2099 Stops and cancels an in-progress removal of a top-level vdev.
2104 .Op Fl o Ar property Ns = Ns Ar value
2105 .Ar pool Ar device Op Ar new_device
2111 This is equivalent to attaching
2113 waiting for it to resilver, and then detaching
2118 must be greater than or equal to the minimum size of all the devices in a mirror
2119 or raidz configuration.
2122 is required if the pool is not redundant.
2125 is not specified, it defaults to
2127 This form of replacement is useful after an existing disk has failed and has
2128 been physically replaced.
2129 In this case, the new disk may have the same
2131 path as the old device, even though it is actually a different disk.
2132 ZFS recognizes this.
2137 even if it appears to be in use.
2138 Not all devices can be overridden in this manner.
2139 .It Fl o Ar property Ns = Ns Ar value
2140 Sets the given pool properties. See the
2142 section for a list of valid properties that can be set.
2143 The only property supported at the moment is
2152 Begins a scrub or resumes a paused scrub.
2153 The scrub examines all data in the specified pools to verify that it checksums
2157 devices, ZFS automatically repairs any damage discovered during the scrub.
2160 command reports the progress of the scrub and summarizes the results of the
2161 scrub upon completion.
2163 Scrubbing and resilvering are very similar operations.
2164 The difference is that resilvering only examines data that ZFS knows to be out
2167 for example, when attaching a new device to a mirror or replacing an existing
2170 whereas scrubbing examines all data to discover silent errors due to hardware
2171 faults or disk failure.
2173 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
2175 If a scrub is paused, the
2178 If a resilver is in progress, ZFS does not allow a scrub to be started until the
2187 Scrub pause state and progress are periodically synced to disk.
2188 If the system is restarted or pool is exported during a paused scrub,
2189 even after import, scrub will remain paused until it is resumed.
2190 Once resumed the scrub will pick up from the place where it was last
2191 checkpointed to disk.
2192 To resume a paused scrub issue
2201 Starts a resilver. If an existing resilver is already running it will be
2202 restarted from the beginning. Any drives that were scheduled for a deferred
2203 resilver will be added to the new one.
2210 .Op Ar device Ns ...
2212 Initiates an immediate on-demand TRIM operation for all of the free space in
2213 a pool. This operation informs the underlying storage devices of all blocks
2214 in the pool which are no longer allocated and allows thinly provisioned
2215 devices to reclaim the space.
2217 A manual on-demand TRIM operation can be initiated irrespective of the
2219 pool property setting. See the documentation for the
2221 property above for the types of vdev devices which can be trimmed.
2224 Causes a secure TRIM to be initiated. When performing a secure TRIM, the
2225 device guarantees that data stored on the trimmed blocks has been erased.
2226 This requires support from the device and is not supported by all SSDs.
2227 .It Fl r -rate Ar rate
2228 Controls the rate at which the TRIM operation progresses. Without this
2229 option TRIM is executed as quickly as possible. The rate, expressed in bytes
2230 per second, is applied on a per-vdev basis and may be set differently for
2233 Cancel trimming on the specified devices, or all eligible devices if none
2235 If one or more target devices are invalid or are not currently being
2236 trimmed, the command will fail and no cancellation will occur on any device.
2238 Suspend trimming on the specified devices, or all eligible devices if none
2240 If one or more target devices are invalid or are not currently being
2241 trimmed, the command will fail and no suspension will occur on any device.
2242 Trimming can then be resumed by running
2244 with no flags on the relevant target devices.
2249 .Ar property Ns = Ns Ar value
2252 Sets the given property on the specified pool.
2255 section for more information on what properties can be set and acceptable
2261 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2272 must be mirrors and the pool must not be in the process of resilvering.
2273 At the time of the split,
2275 will be a replica of
2278 last device in each mirror is split from
2283 The optional device specification causes the specified device(s) to be
2286 and, should any devices remain unspecified,
2287 the last device in each mirror is used as would be by default.
2290 Display vdev GUIDs instead of the normal device names. These GUIDs
2291 can be used in place of device names for the zpool
2292 detach/offline/remove/replace commands.
2294 Display real paths for vdevs resolving all symbolic links. This can
2295 be used to look up the current block device name regardless of the
2297 path used to open it.
2299 Indicates that this command will request encryption keys for all encrypted
2300 datasets it attempts to mount as it is bringing the new pool online. Note that
2301 if any datasets have a
2305 this command will block waiting for the keys to be entered. Without this flag
2306 encrypted datasets will be left unavailable until the keys are loaded.
2308 Do dry run, do not actually perform the split.
2309 Print out the expected configuration of
2312 Display full paths for vdevs instead of only the last component of
2313 the path. This can be used in conjunction with the
2316 .It Fl o Ar property Ns = Ns Ar value
2317 Sets the specified property for
2321 section for more information on the available pool properties.
2329 and automatically import it.
2334 .Op Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
2336 .Op Fl T Sy u Ns | Ns Sy d
2337 .Oo Ar pool Oc Ns ...
2338 .Op Ar interval Op Ar count
2340 Displays the detailed health status for the given pools.
2343 is specified, then the status of each pool in the system is displayed.
2344 For more information on pool and device health, see the
2345 .Sx Device Failure and Recovery
2348 If a scrub or resilver is in progress, this command reports the percentage done
2349 and the estimated time to completion.
2350 Both of these are only approximate, because the amount of data in the pool and
2351 the other workloads on the system can change.
2353 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
2354 Run a script (or scripts) on each vdev and include the output as a new column
2361 for complete details.
2363 Display vdev initialization status.
2365 Display vdev GUIDs instead of the normal device names. These GUIDs
2366 can be used in place of device names for the zpool
2367 detach/offline/remove/replace commands.
2369 Display real paths for vdevs resolving all symbolic links. This can
2370 be used to look up the current block device name regardless of the
2372 path used to open it.
2374 Display numbers in parsable (exact) values.
2376 Display full paths for vdevs instead of only the last component of
2377 the path. This can be used in conjunction with the
2381 Display a histogram of deduplication statistics, showing the allocated
2382 .Pq physically present on disk
2384 .Pq logically referenced in the pool
2385 block counts and sizes by reference count.
2387 Display the number of leaf VDEV slow IOs. This is the number of IOs that
2388 didn't complete in \fBzio_slow_io_ms\fR milliseconds (default 30 seconds).
2389 This does not necessarily mean the IOs failed to complete, just took an
2390 unreasonably long amount of time. This may indicate a problem with the
2393 Display vdev TRIM status.
2394 .It Fl T Sy u Ns | Ns Sy d
2395 Display a time stamp.
2398 for a printed representation of the internal representation of time.
2403 for standard date format.
2407 Displays verbose data error information, printing out a complete list of all
2408 data errors since the last complete pool scrub.
2410 Only display status for pools that are exhibiting errors or are otherwise
2412 Warnings about pools not using the latest on-disk format will not be included.
2419 This command forces all in-core dirty data to be written to the primary
2420 pool storage and not the ZIL. It will also update administrative
2421 information including quota reporting. Without arguments,
2423 will sync all pools on the system. Otherwise, it will sync only the
2429 Displays pools which do not have all supported features enabled and pools
2430 formatted using a legacy ZFS version number.
2431 These pools can continue to be used, but some features may not be available.
2433 .Nm zpool Cm upgrade Fl a
2434 to enable all features on all pools.
2440 Displays legacy ZFS versions supported by the current software.
2442 .Xr zpool-features 5
2443 for a description of feature flags features supported by the current software.
2448 .Fl a Ns | Ns Ar pool Ns ...
2450 Enables all supported features on the given pool.
2451 Once this is done, the pool will no longer be accessible on systems that do not
2452 support feature flags.
2454 .Xr zpool-features 5
2455 for details on compatibility with systems that support feature flags, but do not
2456 support all features enabled on the pool.
2459 Enables all supported features on all pools.
2461 Upgrade to the specified legacy version.
2464 flag is specified, no features will be enabled on the pool.
2465 This option can only be used to increase the version number up to the last
2466 supported legacy version number.
2470 The following exit values are returned:
2473 Successful completion.
2477 Invalid command line options were specified.
2481 .It Sy Example 1 No Creating a RAID-Z Storage Pool
2482 The following command creates a pool with a single raidz root vdev that
2483 consists of six disks.
2485 # zpool create tank raidz sda sdb sdc sdd sde sdf
2487 .It Sy Example 2 No Creating a Mirrored Storage Pool
2488 The following command creates a pool with two mirrors, where each mirror
2491 # zpool create tank mirror sda sdb mirror sdc sdd
2493 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Partitions
2494 The following command creates an unmirrored pool using two disk partitions.
2496 # zpool create tank sda1 sdb2
2498 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
2499 The following command creates an unmirrored pool using files.
2500 While not recommended, a pool based on files can be useful for experimental
2503 # zpool create tank /path/to/file/a /path/to/file/b
2505 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
2506 The following command adds two mirrored disks to the pool
2508 assuming the pool is already made up of two-way mirrors.
2509 The additional space is immediately available to any datasets within the pool.
2511 # zpool add tank mirror sda sdb
2513 .It Sy Example 6 No Listing Available ZFS Storage Pools
2514 The following command lists all available pools on the system.
2515 In this case, the pool
2517 is faulted due to a missing device.
2518 The results from this command are similar to the following:
2521 NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2522 rpool 19.9G 8.43G 11.4G - 33% 42% 1.00x ONLINE -
2523 tank 61.5G 20.0G 41.5G - 48% 32% 1.00x ONLINE -
2524 zion - - - - - - - FAULTED -
2526 .It Sy Example 7 No Destroying a ZFS Storage Pool
2527 The following command destroys the pool
2529 and any datasets contained within.
2531 # zpool destroy -f tank
2533 .It Sy Example 8 No Exporting a ZFS Storage Pool
2534 The following command exports the devices in pool
2536 so that they can be relocated or later imported.
2540 .It Sy Example 9 No Importing a ZFS Storage Pool
2541 The following command displays available pools, and then imports the pool
2543 for use on the system.
2544 The results from this command are similar to the following:
2548 id: 15451357997522795478
2550 action: The pool can be imported using its name or numeric identifier.
2560 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
2561 The following command upgrades all ZFS Storage pools to the current version of
2565 This system is currently running ZFS version 2.
2567 .It Sy Example 11 No Managing Hot Spares
2568 The following command creates a new pool with an available hot spare:
2570 # zpool create tank mirror sda sdb spare sdc
2573 If one of the disks were to fail, the pool would be reduced to the degraded
2575 The failed device can be replaced using the following command:
2577 # zpool replace tank sda sdd
2580 Once the data has been resilvered, the spare is automatically removed and is
2581 made available for use should another device fail.
2582 The hot spare can be permanently removed from the pool using the following
2585 # zpool remove tank sdc
2587 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
2588 The following command creates a ZFS storage pool consisting of two, two-way
2589 mirrors and mirrored log devices:
2591 # zpool create pool mirror sda sdb mirror sdc sdd log mirror \\
2594 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
2595 The following command adds two disks for use as cache devices to a ZFS storage
2598 # zpool add pool cache sdc sdd
2601 Once added, the cache devices gradually fill with content from main memory.
2602 Depending on the size of your cache devices, it could take over an hour for
2604 Capacity and reads can be monitored using the
2608 # zpool iostat -v pool 5
2610 .It Sy Example 14 No Removing a Mirrored top-level (Log or Data) Device
2611 The following commands remove the mirrored log device
2613 and mirrored top-level data device
2616 Given this configuration:
2620 scrub: none requested
2623 NAME STATE READ WRITE CKSUM
2625 mirror-0 ONLINE 0 0 0
2628 mirror-1 ONLINE 0 0 0
2632 mirror-2 ONLINE 0 0 0
2637 The command to remove the mirrored log
2641 # zpool remove tank mirror-2
2644 The command to remove the mirrored data
2648 # zpool remove tank mirror-1
2650 .It Sy Example 15 No Displaying expanded space on a device
2651 The following command displays the detailed information for the pool
2653 This pool is comprised of a single raidz vdev where one of its devices
2654 increased its capacity by 10GB.
2655 In this example, the pool will not be able to utilize this extra capacity until
2656 all the devices under the raidz vdev have been expanded.
2658 # zpool list -v data
2659 NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2660 data 23.9G 14.6G 9.30G - 48% 61% 1.00x ONLINE -
2661 raidz1 23.9G 14.6G 9.30G - 48%
2666 .It Sy Example 16 No Adding output columns
2667 Additional columns can be added to the
2675 # zpool status -c vendor,model,size
2676 NAME STATE READ WRITE CKSUM vendor model size
2678 mirror-0 ONLINE 0 0 0
2679 U1 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2680 U10 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2681 U11 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2682 U12 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2683 U13 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2684 U14 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2686 # zpool iostat -vc slaves
2687 capacity operations bandwidth
2688 pool alloc free read write read write slaves
2689 ---------- ----- ----- ----- ----- ----- ----- ---------
2690 tank 20.4G 7.23T 26 152 20.7M 21.6M
2691 mirror 20.4G 7.23T 26 152 20.7M 21.6M
2692 U1 - - 0 31 1.46K 20.6M sdb sdff
2693 U10 - - 0 1 3.77K 13.3K sdas sdgw
2694 U11 - - 0 1 288K 13.3K sdat sdgx
2695 U12 - - 0 1 78.4K 13.3K sdau sdgy
2696 U13 - - 0 1 128K 13.3K sdav sdgz
2697 U14 - - 0 1 63.2K 13.3K sdfk sdg
2700 .Sh ENVIRONMENT VARIABLES
2701 .Bl -tag -width "ZFS_ABORT"
2705 to dump core on exit for the purposes of running
2708 .Bl -tag -width "ZPOOL_IMPORT_PATH"
2709 .It Ev ZPOOL_IMPORT_PATH
2710 The search path for devices or files to use with the pool. This is a colon-separated list of directories in which
2712 looks for device nodes and files.
2718 .Bl -tag -width "ZPOOL_VDEV_NAME_GUID"
2719 .It Ev ZPOOL_VDEV_NAME_GUID
2721 .Nm zpool subcommands to output vdev guids by default. This behavior
2724 command line option.
2726 .Bl -tag -width "ZPOOL_VDEV_NAME_FOLLOW_LINKS"
2727 .It Ev ZPOOL_VDEV_NAME_FOLLOW_LINKS
2730 subcommands to follow links for vdev names by default. This behavior is identical to the
2732 command line option.
2734 .Bl -tag -width "ZPOOL_VDEV_NAME_PATH"
2735 .It Ev ZPOOL_VDEV_NAME_PATH
2738 subcommands to output full vdev path names by default. This
2739 behavior is identical to the
2741 command line option.
2743 .Bl -tag -width "ZFS_VDEV_DEVID_OPT_OUT"
2744 .It Ev ZFS_VDEV_DEVID_OPT_OUT
2745 Older ZFS on Linux implementations had issues when attempting to display pool
2746 config VDEV names if a
2748 NVP value is present in the pool's config.
2750 For example, a pool that originated on illumos platform would have a devid
2751 value in the config and
2753 would fail when listing the config.
2754 This would also be true for future Linux based pools.
2756 A pool can be stripped of any
2758 values on import or prevented from adding
2764 .Sy ZFS_VDEV_DEVID_OPT_OUT .
2766 .Bl -tag -width "ZPOOL_SCRIPTS_AS_ROOT"
2767 .It Ev ZPOOL_SCRIPTS_AS_ROOT
2768 Allow a privileged user to run the
2769 .Nm zpool status/iostat
2772 option. Normally, only unprivileged users are allowed to run
2775 .Bl -tag -width "ZPOOL_SCRIPTS_PATH"
2776 .It Ev ZPOOL_SCRIPTS_PATH
2777 The search path for scripts when running
2778 .Nm zpool status/iostat
2781 option. This is a colon-separated list of directories and overrides the default
2784 .Pa /etc/zfs/zpool.d
2787 .Bl -tag -width "ZPOOL_SCRIPTS_ENABLED"
2788 .It Ev ZPOOL_SCRIPTS_ENABLED
2790 .Nm zpool status/iostat
2794 .Sy ZPOOL_SCRIPTS_ENABLED
2795 is not set, it is assumed that the user is allowed to run
2796 .Nm zpool status/iostat -c .
2798 .Sh INTERFACE STABILITY
2802 .Xr zfs-module-parameters 5 ,
2803 .Xr zpool-features 5 ,