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 ...
218 command configures ZFS storage pools.
219 A storage pool is a collection of devices that provides physical storage and
220 data replication for ZFS datasets.
221 All datasets within a storage pool share the same space.
224 for information on managing datasets.
225 .Ss Virtual Devices (vdevs)
226 A "virtual device" describes a single device or a collection of devices
227 organized according to certain performance and fault characteristics.
228 The following virtual devices are supported:
231 A block device, typically located under
233 ZFS can use individual slices or partitions, though the recommended mode of
234 operation is to use whole disks.
235 A disk can be specified by a full path, or it can be a shorthand name
236 .Po the relative portion of the path under
239 A whole disk can be specified by omitting the slice or partition designation.
244 When given a whole disk, ZFS automatically labels the disk, if necessary.
247 The use of files as a backing store is strongly discouraged.
248 It is designed primarily for experimental purposes, as the fault tolerance of a
249 file is only as good as the file system of which it is a part.
250 A file must be specified by a full path.
252 A mirror of two or more devices.
253 Data is replicated in an identical fashion across all components of a mirror.
254 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
255 failing before data integrity is compromised.
256 .It Sy raidz , raidz1 , raidz2 , raidz3
257 A variation on RAID-5 that allows for better distribution of parity and
258 eliminates the RAID-5
260 .Pq in which data and parity become inconsistent after a power loss .
261 Data and parity is striped across all disks within a raidz group.
263 A raidz group can have single-, double-, or triple-parity, meaning that the
264 raidz group can sustain one, two, or three failures, respectively, without
268 vdev type specifies a single-parity raidz group; the
270 vdev type specifies a double-parity raidz group; and the
272 vdev type specifies a triple-parity raidz group.
275 vdev type is an alias for
278 A raidz group with N disks of size X with P parity disks can hold approximately
279 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
281 The minimum number of devices in a raidz group is one more than the number of
283 The recommended number is between 3 and 9 to help increase performance.
285 A pseudo-vdev which keeps track of available hot spares for a pool.
286 For more information, see the
290 A separate intent log device.
291 If more than one log device is specified, then writes are load-balanced between
293 Log devices can be mirrored.
294 However, raidz vdev types are not supported for the intent log.
295 For more information, see the
299 A device dedicated solely for deduplication tables.
300 The redundancy of this device should match the redundancy of the other normal
301 devices in the pool. If more than one dedup device is specified, then
302 allocations are load-balanced between those devices.
304 A device dedicated solely for allocating various kinds of internal metadata,
305 and optionally small file blocks.
306 The redundancy of this device should match the redundancy of the other normal
307 devices in the pool. If more than one special device is specified, then
308 allocations are load-balanced between those devices.
310 For more information on special allocations, see the
311 .Sx Special Allocation Class
314 A device used to cache storage pool data.
315 A cache device cannot be configured as a mirror or raidz group.
316 For more information, see the
321 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
322 contain files or disks.
324 .Pq or other combinations
327 A pool can have any number of virtual devices at the top of the configuration
331 Data is dynamically distributed across all top-level devices to balance data
333 As new virtual devices are added, ZFS automatically places data on the newly
336 Virtual devices are specified one at a time on the command line, separated by
342 are used to distinguish where a group ends and another begins.
343 For example, the following creates two root vdevs, each a mirror of two disks:
345 # zpool create mypool mirror sda sdb mirror sdc sdd
347 .Ss Device Failure and Recovery
348 ZFS supports a rich set of mechanisms for handling device failure and data
350 All metadata and data is checksummed, and ZFS automatically repairs bad data
351 from a good copy when corruption is detected.
353 In order to take advantage of these features, a pool must make use of some form
354 of redundancy, using either mirrored or raidz groups.
355 While ZFS supports running in a non-redundant configuration, where each root
356 vdev is simply a disk or file, this is strongly discouraged.
357 A single case of bit corruption can render some or all of your data unavailable.
359 A pool's health status is described by one of three states: online, degraded,
361 An online pool has all devices operating normally.
362 A degraded pool is one in which one or more devices have failed, but the data is
363 still available due to a redundant configuration.
364 A faulted pool has corrupted metadata, or one or more faulted devices, and
365 insufficient replicas to continue functioning.
367 The health of the top-level vdev, such as mirror or raidz device, is
368 potentially impacted by the state of its associated vdevs, or component
370 A top-level vdev or component device is in one of the following states:
371 .Bl -tag -width "DEGRADED"
373 One or more top-level vdevs is in the degraded state because one or more
374 component devices are offline.
375 Sufficient replicas exist to continue functioning.
377 One or more component devices is in the degraded or faulted state, but
378 sufficient replicas exist to continue functioning.
379 The underlying conditions are as follows:
382 The number of checksum errors exceeds acceptable levels and the device is
383 degraded as an indication that something may be wrong.
384 ZFS continues to use the device as necessary.
386 The number of I/O errors exceeds acceptable levels.
387 The device could not be marked as faulted because there are insufficient
388 replicas to continue functioning.
391 One or more top-level vdevs is in the faulted state because one or more
392 component devices are offline.
393 Insufficient replicas exist to continue functioning.
395 One or more component devices is in the faulted state, and insufficient
396 replicas exist to continue functioning.
397 The underlying conditions are as follows:
400 The device could be opened, but the contents did not match expected values.
402 The number of I/O errors exceeds acceptable levels and the device is faulted to
403 prevent further use of the device.
406 The device was explicitly taken offline by the
410 The device is online and functioning.
412 The device was physically removed while the system was running.
413 Device removal detection is hardware-dependent and may not be supported on all
416 The device could not be opened.
417 If a pool is imported when a device was unavailable, then the device will be
418 identified by a unique identifier instead of its path since the path was never
419 correct in the first place.
422 If a device is removed and later re-attached to the system, ZFS attempts
423 to put the device online automatically.
424 Device attach detection is hardware-dependent and might not be supported on all
427 ZFS allows devices to be associated with pools as
429 These devices are not actively used in the pool, but when an active device
430 fails, it is automatically replaced by a hot spare.
431 To create a pool with hot spares, specify a
433 vdev with any number of devices.
436 # zpool create pool mirror sda sdb spare sdc sdd
439 Spares can be shared across multiple pools, and can be added with the
441 command and removed with the
444 Once a spare replacement is initiated, a new
446 vdev is created within the configuration that will remain there until the
447 original device is replaced.
448 At this point, the hot spare becomes available again if another device fails.
450 If a pool has a shared spare that is currently being used, the pool can not be
451 exported since other pools may use this shared spare, which may lead to
452 potential data corruption.
454 Shared spares add some risk. If the pools are imported on different hosts, and
455 both pools suffer a device failure at the same time, both could attempt to use
456 the spare at the same time. This may not be detected, resulting in data
459 An in-progress spare replacement can be cancelled by detaching the hot spare.
460 If the original faulted device is detached, then the hot spare assumes its
461 place in the configuration, and is removed from the spare list of all active
464 Spares cannot replace log devices.
466 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
468 For instance, databases often require their transactions to be on stable storage
469 devices when returning from a system call.
470 NFS and other applications can also use
472 to ensure data stability.
473 By default, the intent log is allocated from blocks within the main pool.
474 However, it might be possible to get better performance using separate intent
475 log devices such as NVRAM or a dedicated disk.
478 # zpool create pool sda sdb log sdc
481 Multiple log devices can also be specified, and they can be mirrored.
484 section for an example of mirroring multiple log devices.
486 Log devices can be added, replaced, attached, detached and removed. In
487 addition, log devices are imported and exported as part of the pool
489 Mirrored devices can be removed by specifying the top-level mirror vdev.
491 Devices can be added to a storage pool as
493 These devices provide an additional layer of caching between main memory and
495 For read-heavy workloads, where the working set size is much larger than what
496 can be cached in main memory, using cache devices allow much more of this
497 working set to be served from low latency media.
498 Using cache devices provides the greatest performance improvement for random
499 read-workloads of mostly static content.
501 To create a pool with cache devices, specify a
503 vdev with any number of devices.
506 # zpool create pool sda sdb cache sdc sdd
509 Cache devices cannot be mirrored or part of a raidz configuration.
510 If a read error is encountered on a cache device, that read I/O is reissued to
511 the original storage pool device, which might be part of a mirrored or raidz
514 The content of the cache devices is considered volatile, as is the case with
517 Before starting critical procedures that include destructive actions (e.g
519 ), an administrator can checkpoint the pool's state and in the case of a
520 mistake or failure, rewind the entire pool back to the checkpoint.
521 Otherwise, the checkpoint can be discarded when the procedure has completed
524 A pool checkpoint can be thought of as a pool-wide snapshot and should be used
525 with care as it contains every part of the pool's state, from properties to vdev
527 Thus, while a pool has a checkpoint certain operations are not allowed.
528 Specifically, vdev removal/attach/detach, mirror splitting, and
529 changing the pool's guid.
530 Adding a new vdev is supported but in the case of a rewind it will have to be
532 Finally, users of this feature should keep in mind that scrubs in a pool that
533 has a checkpoint do not repair checkpointed data.
535 To create a checkpoint for a pool:
537 # zpool checkpoint pool
540 To later rewind to its checkpointed state, you need to first export it and
541 then rewind it during import:
544 # zpool import --rewind-to-checkpoint pool
547 To discard the checkpoint from a pool:
549 # zpool checkpoint -d pool
552 Dataset reservations (controlled by the
556 zfs properties) may be unenforceable while a checkpoint exists, because the
557 checkpoint is allowed to consume the dataset's reservation.
558 Finally, data that is part of the checkpoint but has been freed in the
559 current state of the pool won't be scanned during a scrub.
560 .Ss Special Allocation Class
561 The allocations in the special class are dedicated to specific block types.
562 By default this includes all metadata, the indirect blocks of user data, and
563 any deduplication tables. The class can also be provisioned to accept
566 A pool must always have at least one normal (non-dedup/special) vdev before
567 other devices can be assigned to the special class. If the special class
568 becomes full, then allocations intended for it will spill back into the
571 Deduplication tables can be excluded from the special class by setting the
572 .Sy zfs_ddt_data_is_special
573 zfs module parameter to false (0).
575 Inclusion of small file blocks in the special class is opt-in. Each dataset
576 can control the size of small file blocks allowed in the special class by
578 .Sy special_small_blocks
579 dataset property. It defaults to zero, so you must opt-in by setting it to a
582 for more info on setting this property.
584 Each pool has several properties associated with it.
585 Some properties are read-only statistics while others are configurable and
586 change the behavior of the pool.
588 The following are read-only properties:
591 Amount of storage used within the pool.
596 for more information.
598 Percentage of pool space used.
599 This property can also be referred to by its shortened column name,
602 Amount of uninitialized space within the pool or device that can be used to
603 increase the total capacity of the pool.
604 Uninitialized space consists of any space on an EFI labeled vdev which has not
607 .Nm zpool Cm online Fl e
609 This space occurs when a LUN is dynamically expanded.
611 The amount of fragmentation in the pool. As the amount of space
613 increases, it becomes more difficult to locate
615 space. This may result in lower write performance compared to pools with more
616 unfragmented free space.
618 The amount of free space available in the pool.
622 property describes how much new data can be written to ZFS filesystems/volumes.
625 property is not generally useful for this purpose, and can be substantially more than the zfs
627 space. This discrepancy is due to several factors, including raidz party; zfs
628 reservation, quota, refreservation, and refquota properties; and space set aside by
631 .Xr zfs-module-parameters 5
632 for more information).
634 After a file system or snapshot is destroyed, the space it was using is
635 returned to the pool asynchronously.
637 is the amount of space remaining to be reclaimed.
644 The current health of the pool.
646 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
648 A unique identifier for the pool.
650 A unique identifier for the pool.
653 property, this identifier is generated every time we load the pool (e.g. does
654 not persist across imports/exports) and never changes while the pool is loaded
657 operation takes place).
659 Total size of the storage pool.
660 .It Sy unsupported@ Ns Em feature_guid
661 Information about unsupported features that are enabled on the pool.
667 The space usage properties report actual physical space available to the
669 The physical space can be different from the total amount of space that any
670 contained datasets can actually use.
671 The amount of space used in a raidz configuration depends on the characteristics
672 of the data being written.
673 In addition, ZFS reserves some space for internal accounting that the
675 command takes into account, but the
678 For non-full pools of a reasonable size, these effects should be invisible.
679 For small pools, or pools that are close to being completely full, these
680 discrepancies may become more noticeable.
682 The following property can be set at creation time and import time:
685 Alternate root directory.
686 If set, this directory is prepended to any mount points within the pool.
687 This can be used when examining an unknown pool where the mount points cannot be
688 trusted, or in an alternate boot environment, where the typical paths are not
691 is not a persistent property.
692 It is valid only while the system is up.
696 .Sy cachefile Ns = Ns Sy none ,
697 though this may be overridden using an explicit setting.
700 The following property can be set only at import time:
702 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
705 the pool will be imported in read-only mode.
706 This property can also be referred to by its shortened column name,
710 The following properties can be set at creation time and import time, and later
715 .It Sy ashift Ns = Ns Sy ashift
716 Pool sector size exponent, to the power of
718 (internally referred to as
720 ). Values from 9 to 16, inclusive, are valid; also, the
721 value 0 (the default) means to auto-detect using the kernel's block
722 layer and a ZFS internal exception list. I/O operations will be aligned
723 to the specified size boundaries. Additionally, the minimum (disk)
724 write size will be set to the specified size, so this represents a
725 space vs. performance trade-off. For optimal performance, the pool
726 sector size should be greater than or equal to the sector size of the
727 underlying disks. The typical case for setting this property is when
728 performance is important and the underlying disks use 4KiB sectors but
729 report 512B sectors to the OS (for compatibility reasons); in that
732 (which is 1<<12 = 4096). When set, this property is
733 used as the default hint value in subsequent vdev operations (add,
734 attach and replace). Changing this value will not modify any existing
735 vdev, not even on disk replacement; however it can be used, for
736 instance, to replace a dying 512B sectors disk with a newer 4KiB
737 sectors device: this will probably result in bad performance but at the
738 same time could prevent loss of data.
739 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
740 Controls automatic pool expansion when the underlying LUN is grown.
743 the pool will be resized according to the size of the expanded device.
744 If the device is part of a mirror or raidz then all devices within that
745 mirror/raidz group must be expanded before the new space is made available to
747 The default behavior is
749 This property can also be referred to by its shortened column name,
751 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
752 Controls automatic device replacement.
755 device replacement must be initiated by the administrator by using the
760 any new device, found in the same physical location as a device that previously
761 belonged to the pool, is automatically formatted and replaced.
762 The default behavior is
764 This property can also be referred to by its shortened column name,
766 Autoreplace can also be used with virtual disks (like device
767 mapper) provided that you use the /dev/disk/by-vdev paths setup by
768 vdev_id.conf. See the
770 man page for more details.
771 Autoreplace and autoonline require the ZFS Event Daemon be configured and
774 man page for more details.
775 .It Sy bootfs Ns = Ns Sy (unset) Ns | Ns Ar pool Ns / Ns Ar dataset
776 Identifies the default bootable dataset for the root pool. This property is
777 expected to be set mainly by the installation and upgrade programs.
778 Not all Linux distribution boot processes use the bootfs property.
779 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
780 Controls the location of where the pool configuration is cached.
781 Discovering all pools on system startup requires a cached copy of the
782 configuration data that is stored on the root file system.
783 All pools in this cache are automatically imported when the system boots.
784 Some environments, such as install and clustering, need to cache this
785 information in a different location so that pools are not automatically
787 Setting this property caches the pool configuration in a different location that
788 can later be imported with
789 .Nm zpool Cm import Fl c .
790 Setting it to the value
792 creates a temporary pool that is never cached, and the
795 uses the default location.
797 Multiple pools can share the same cache file.
798 Because the kernel destroys and recreates this file when pools are added and
799 removed, care should be taken when attempting to access this file.
800 When the last pool using a
802 is exported or destroyed, the file will be empty.
803 .It Sy comment Ns = Ns Ar text
804 A text string consisting of printable ASCII characters that will be stored
805 such that it is available even if the pool becomes faulted.
806 An administrator can provide additional information about a pool using this
808 .It Sy dedupditto Ns = Ns Ar number
809 This property is deprecated. In a future release, it will no longer have any
812 Threshold for the number of block ditto copies.
813 If the reference count for a deduplicated block increases above this number, a
814 new ditto copy of this block is automatically stored.
815 The default setting is
817 which causes no ditto copies to be created for deduplicated blocks.
818 The minimum legal nonzero setting is
820 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
821 Controls whether a non-privileged user is granted access based on the dataset
822 permissions defined on the dataset.
825 for more information on ZFS delegated administration.
826 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
827 Controls the system behavior in the event of catastrophic pool failure.
828 This condition is typically a result of a loss of connectivity to the underlying
829 storage device(s) or a failure of all devices within the pool.
830 The behavior of such an event is determined as follows:
831 .Bl -tag -width "continue"
833 Blocks all I/O access until the device connectivity is recovered and the errors
835 This is the default behavior.
839 to any new write I/O requests but allows reads to any of the remaining healthy
841 Any write requests that have yet to be committed to disk would be blocked.
843 Prints out a message to the console and generates a system crash dump.
845 .It Sy autotrim Ns = Ns Sy on Ns | Ns Sy off
848 space which has been recently freed, and is no longer allocated by the pool,
849 will be periodically trimmed. This allows block device vdevs which support
850 BLKDISCARD, such as SSDs, or file vdevs on which the underlying file system
851 supports hole-punching, to reclaim unused blocks. The default setting for
855 Automatic TRIM does not immediately reclaim blocks after a free. Instead,
856 it will optimistically delay allowing smaller ranges to be aggregated in to
857 a few larger ones. These can then be issued more efficiently to the storage.
859 Be aware that automatic trimming of recently freed data blocks can put
860 significant stress on the underlying storage devices. This will vary
861 depending of how well the specific device handles these commands. For
862 lower end devices it is often possible to achieve most of the benefits
863 of automatic trimming by running an on-demand (manual) TRIM periodically
867 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
868 The value of this property is the current state of
870 The only valid value when setting this property is
874 to the enabled state.
877 for details on feature states.
878 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
879 Controls whether information about snapshots associated with this pool is
887 This property can also be referred to by its shortened name,
889 .It Sy multihost Ns = Ns Sy on Ns | Ns Sy off
890 Controls whether a pool activity check should be performed during
891 .Nm zpool Cm import .
892 When a pool is determined to be active it cannot be imported, even with the
894 option. This property is intended to be used in failover configurations
895 where multiple hosts have access to a pool on shared storage.
897 Multihost provides protection on import only. It does not protect against an
898 individual device being used in multiple pools, regardless of the type of vdev.
899 See the discussion under
902 When this property is on, periodic writes to storage occur to show the pool is
904 .Sy zfs_multihost_interval
906 .Xr zfs-module-parameters 5
907 man page. In order to enable this property each host must set a unique hostid.
911 .Xr spl-module-parameters 5
912 for additional details. The default value is
914 .It Sy version Ns = Ns Ar version
915 The current on-disk version of the pool.
916 This can be increased, but never decreased.
917 The preferred method of updating pools is with the
919 command, though this property can be used when a specific version is needed for
920 backwards compatibility.
921 Once feature flags are enabled on a pool this property will no longer have a
925 All subcommands that modify state are logged persistently to the pool in their
930 command provides subcommands to create and destroy storage pools, add capacity
931 to storage pools, and provide information about the storage pools.
932 The following subcommands are supported:
938 Displays a help message.
950 .Oo Fl o Ar property Ns = Ns Ar value Oc
953 Adds the specified virtual devices to the given pool.
956 specification is described in the
961 option, and the device checks performed are described in the
968 even if they appear in use or specify a conflicting replication level.
969 Not all devices can be overridden in this manner.
973 GUIDs instead of the normal device names. These GUIDs can be used in place of
974 device names for the zpool detach/offline/remove/replace commands.
976 Display real paths for
978 resolving all symbolic links. This can be used to look up the current block
979 device name regardless of the /dev/disk/ path used to open it.
981 Displays the configuration that would be used without actually adding the
983 The actual pool creation can still fail due to insufficient privileges or
986 Display real paths for
988 instead of only the last component of the path. This can be used in
992 .It Fl o Ar property Ns = Ns Ar value
993 Sets the given pool properties. See the
995 section for a list of valid properties that can be set. The only property
996 supported at the moment is ashift.
1002 .Oo Fl o Ar property Ns = Ns Ar value Oc
1003 .Ar pool device new_device
1009 The existing device cannot be part of a raidz configuration.
1012 is not currently part of a mirrored configuration,
1014 automatically transforms into a two-way mirror of
1020 is part of a two-way mirror, attaching
1022 creates a three-way mirror, and so on.
1025 begins to resilver immediately.
1030 even if it appears to be in use.
1031 Not all devices can be overridden in this manner.
1032 .It Fl o Ar property Ns = Ns Ar value
1033 Sets the given pool properties. See the
1035 section for a list of valid properties that can be set. The only property
1036 supported at the moment is ashift.
1044 Checkpoints the current state of
1046 , which can be later restored by
1047 .Nm zpool Cm import --rewind-to-checkpoint .
1048 The existence of a checkpoint in a pool prohibits the following
1057 In addition, it may break reservation boundaries if the pool lacks free
1061 command indicates the existence of a checkpoint or the progress of discarding a
1062 checkpoint from a pool.
1065 command reports how much space the checkpoint takes from the pool.
1068 Discards an existing checkpoint from
1077 Clears device errors in a pool.
1078 If no arguments are specified, all device errors within the pool are cleared.
1079 If one or more devices is specified, only those errors associated with the
1080 specified device or devices are cleared.
1081 If multihost is enabled, and the pool has been suspended, this will not
1082 resume I/O. While the pool was suspended, it may have been imported on
1083 another host, and resuming I/O could result in pool damage.
1088 .Op Fl m Ar mountpoint
1089 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1090 .Oo Fl o Ar feature@feature Ns = Ns Ar value Oc Ns ...
1091 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
1094 .Ar pool vdev Ns ...
1096 Creates a new storage pool containing the virtual devices specified on the
1098 The pool name must begin with a letter, and can only contain
1099 alphanumeric characters as well as underscore
1115 are reserved, as are names beginning with
1123 specification is described in the
1127 The command attempts to verify that each device specified is accessible and not
1128 currently in use by another subsystem. However this check is not robust enough
1129 to detect simultaneous attempts to use a new device in different pools, even if
1134 administrator must ensure that simultaneous invocations of any combination of
1139 .Sy zpool labelclear ,
1140 do not refer to the same device. Using the same device in two pools will
1141 result in pool corruption.
1143 There are some uses, such as being currently mounted, or specified as the
1144 dedicated dump device, that prevents a device from ever being used by ZFS.
1145 Other uses, such as having a preexisting UFS file system, can be overridden with
1150 The command also checks that the replication strategy for the pool is
1152 An attempt to combine redundant and non-redundant storage in a single pool, or
1153 to mix disks and files, results in an error unless
1156 The use of differently sized devices within a single raidz or mirror group is
1157 also flagged as an error unless
1163 option is specified, the default mount point is
1165 The mount point must not exist or must be empty, or else the root dataset
1167 This can be overridden with the
1171 By default all supported features are enabled on the new pool unless the
1173 option is specified.
1176 Do not enable any features on the new pool.
1177 Individual features can be enabled by setting their corresponding properties to
1183 .Xr zpool-features 5
1184 for details about feature properties.
1188 even if they appear in use or specify a conflicting replication level.
1189 Not all devices can be overridden in this manner.
1190 .It Fl m Ar mountpoint
1191 Sets the mount point for the root dataset.
1192 The default mount point is
1199 The mount point must be an absolute path,
1203 For more information on dataset mount points, see
1206 Displays the configuration that would be used without actually creating the
1208 The actual pool creation can still fail due to insufficient privileges or
1210 .It Fl o Ar property Ns = Ns Ar value
1211 Sets the given pool properties.
1214 section for a list of valid properties that can be set.
1215 .It Fl o Ar feature@feature Ns = Ns Ar value
1216 Sets the given pool feature. See the
1217 .Xr zpool-features 5
1218 section for a list of valid features that can be set.
1219 Value can be either disabled or enabled.
1220 .It Fl O Ar file-system-property Ns = Ns Ar value
1221 Sets the given file system properties in the root file system of the pool.
1226 for a list of valid properties that can be set.
1229 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
1231 Sets the in-core pool name to
1233 while the on-disk name will be the name specified as the pool name
1235 This will set the default cachefile property to none. This is intended
1236 to handle name space collisions when creating pools for other systems,
1237 such as virtual machines or physical machines whose pools live on network
1246 Destroys the given pool, freeing up any devices for other use.
1247 This command tries to unmount any active datasets before destroying the pool.
1250 Forces any active datasets contained within the pool to be unmounted.
1260 The operation is refused if there are no other valid replicas of the data.
1261 If device may be re-added to the pool later on then consider the
1267 .Op Fl vHf Oo Ar pool Oc | Fl c
1269 Lists all recent events generated by the ZFS kernel modules. These events
1272 and used to automate administrative tasks such as replacing a failed device
1273 with a hot spare. For more information about the subclasses and event payloads
1274 that can be generated see the
1279 Clear all previous events.
1283 Scripted mode. Do not display headers, and separate fields by a
1284 single tab instead of arbitrary space.
1286 Print the entire payload for each event.
1295 Exports the given pools from the system.
1296 All devices are marked as exported, but are still considered in use by other
1298 The devices can be moved between systems
1299 .Pq even those of different endianness
1300 and imported as long as a sufficient number of devices are present.
1302 Before exporting the pool, all datasets within the pool are unmounted.
1303 A pool can not be exported if it has a shared spare that is currently being
1306 For pools to be portable, you must give the
1308 command whole disks, not just partitions, so that ZFS can label the disks with
1309 portable EFI labels.
1310 Otherwise, disk drivers on platforms of different endianness will not recognize
1314 Exports all pools imported on the system.
1316 Forcefully unmount all datasets, using the
1320 This command will forcefully export the pool even if it has a shared spare that
1321 is currently being used.
1322 This may lead to potential data corruption.
1328 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1329 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1330 .Oo Ar pool Oc Ns ...
1332 Retrieves the given list of properties
1334 or all properties if
1338 for the specified storage pool(s).
1339 These properties are displayed with the following fields:
1341 name Name of storage pool
1342 property Property name
1343 value Property value
1344 source Property source, either 'default' or 'local'.
1349 section for more information on the available pool properties.
1353 Do not display headers, and separate fields by a single tab instead of arbitrary
1356 A comma-separated list of columns to display.
1357 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
1358 is the default value.
1360 Display numbers in parsable (exact) values.
1366 .Oo Ar pool Oc Ns ...
1368 Displays the command history of the specified pool(s) or all pools if no pool is
1372 Displays internally logged ZFS events in addition to user initiated events.
1374 Displays log records in long format, which in addition to standard format
1375 includes, the user name, the hostname, and the zone in which the operation was
1382 .Op Fl d Ar dir Ns | Ns device
1384 Lists pools available to import.
1387 option is not specified, this command searches for devices in
1391 option can be specified multiple times, and all directories are searched.
1392 If the device appears to be part of an exported pool, this command displays a
1393 summary of the pool with the name of the pool, a numeric identifier, as well as
1394 the vdev layout and current health of the device for each device or file.
1395 Destroyed pools, pools that were previously destroyed with the
1396 .Nm zpool Cm destroy
1397 command, are not listed unless the
1399 option is specified.
1401 The numeric identifier is unique, and can be used instead of the pool name when
1402 multiple exported pools of the same name are available.
1404 .It Fl c Ar cachefile
1405 Reads configuration from the given
1407 that was created with the
1412 is used instead of searching for devices.
1413 .It Fl d Ar dir Ns | Ns Ar device
1416 or searches for devices or files in
1420 option can be specified multiple times.
1422 Lists destroyed pools only.
1429 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
1430 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
1432 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1436 Imports all pools found in the search directories.
1437 Identical to the previous command, except that all pools with a sufficient
1438 number of devices available are imported.
1439 Destroyed pools, pools that were previously destroyed with the
1440 .Nm zpool Cm destroy
1441 command, will not be imported unless the
1443 option is specified.
1446 Searches for and imports all pools found.
1447 .It Fl c Ar cachefile
1448 Reads configuration from the given
1450 that was created with the
1455 is used instead of searching for devices.
1456 .It Fl d Ar dir Ns | Ns Ar device
1459 or searches for devices or files in
1463 option can be specified multiple times.
1464 This option is incompatible with the
1468 Imports destroyed pools only.
1471 option is also required.
1473 Forces import, even if the pool appears to be potentially active.
1475 Recovery mode for a non-importable pool.
1476 Attempt to return the pool to an importable state by discarding the last few
1478 Not all damaged pools can be recovered by using this option.
1479 If successful, the data from the discarded transactions is irretrievably lost.
1480 This option is ignored if the pool is importable or already imported.
1482 Indicates that this command will request encryption keys for all encrypted
1483 datasets it attempts to mount as it is bringing the pool online. Note that if
1488 this command will block waiting for the keys to be entered. Without this flag
1489 encrypted datasets will be left unavailable until the keys are loaded.
1491 Allows a pool to import when there is a missing log device.
1492 Recent transactions can be lost because the log device will be discarded.
1497 Determines whether a non-importable pool can be made importable again, but does
1498 not actually perform the pool recovery.
1499 For more details about pool recovery mode, see the
1503 Import the pool without mounting any file systems.
1505 Comma-separated list of mount options to use when mounting datasets within the
1509 for a description of dataset properties and mount options.
1510 .It Fl o Ar property Ns = Ns Ar value
1511 Sets the specified property on the imported pool.
1514 section for more information on the available pool properties.
1524 .It Fl -rewind-to-checkpoint
1525 Rewinds pool to the checkpointed state.
1526 Once the pool is imported with this flag there is no way to undo the rewind.
1527 All changes and data that were written after the checkpoint are lost!
1528 The only exception is when the
1530 mounting option is enabled.
1531 In this case, the checkpointed state of the pool is opened and an
1532 administrator can see how the pool would look like if they were
1535 Scan using the default search path, the libblkid cache will not be
1536 consulted. A custom search path may be specified by setting the
1537 ZPOOL_IMPORT_PATH environment variable.
1541 recovery option. Determines whether extreme
1542 measures to find a valid txg should take place. This allows the pool to
1543 be rolled back to a txg which is no longer guaranteed to be consistent.
1544 Pools imported at an inconsistent txg may contain uncorrectable
1545 checksum errors. For more details about pool recovery mode, see the
1547 option, above. WARNING: This option can be extremely hazardous to the
1548 health of your pool and should only be used as a last resort.
1550 Specify the txg to use for rollback. Implies
1553 about pool recovery mode, see the
1555 option, above. WARNING: This option can be extremely hazardous to the
1556 health of your pool and should only be used as a last resort.
1562 .Op Fl F Oo Fl n Oc Oo Fl t Oc Oo Fl T Oc Oo Fl X Oc
1563 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
1565 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1568 .Ar pool Ns | Ns Ar id
1571 Imports a specific pool.
1572 A pool can be identified by its name or the numeric identifier.
1575 is specified, the pool is imported using the name
1577 Otherwise, it is imported with the same name as its exported name.
1579 If a device is removed from a system without running
1581 first, the device appears as potentially active.
1582 It cannot be determined if this was a failed export, or whether the device is
1583 really in use from another host.
1584 To import a pool in this state, the
1588 .It Fl c Ar cachefile
1589 Reads configuration from the given
1591 that was created with the
1596 is used instead of searching for devices.
1597 .It Fl d Ar dir Ns | Ns Ar device
1600 or searches for devices or files in
1604 option can be specified multiple times.
1605 This option is incompatible with the
1609 Imports destroyed pool.
1612 option is also required.
1614 Forces import, even if the pool appears to be potentially active.
1616 Recovery mode for a non-importable pool.
1617 Attempt to return the pool to an importable state by discarding the last few
1619 Not all damaged pools can be recovered by using this option.
1620 If successful, the data from the discarded transactions is irretrievably lost.
1621 This option is ignored if the pool is importable or already imported.
1623 Indicates that this command will request encryption keys for all encrypted
1624 datasets it attempts to mount as it is bringing the pool online. Note that if
1629 this command will block waiting for the keys to be entered. Without this flag
1630 encrypted datasets will be left unavailable until the keys are loaded.
1632 Allows a pool to import when there is a missing log device.
1633 Recent transactions can be lost because the log device will be discarded.
1638 Determines whether a non-importable pool can be made importable again, but does
1639 not actually perform the pool recovery.
1640 For more details about pool recovery mode, see the
1644 Comma-separated list of mount options to use when mounting datasets within the
1648 for a description of dataset properties and mount options.
1649 .It Fl o Ar property Ns = Ns Ar value
1650 Sets the specified property on the imported pool.
1653 section for more information on the available pool properties.
1664 Scan using the default search path, the libblkid cache will not be
1665 consulted. A custom search path may be specified by setting the
1666 ZPOOL_IMPORT_PATH environment variable.
1670 recovery option. Determines whether extreme
1671 measures to find a valid txg should take place. This allows the pool to
1672 be rolled back to a txg which is no longer guaranteed to be consistent.
1673 Pools imported at an inconsistent txg may contain uncorrectable
1674 checksum errors. For more details about pool recovery mode, see the
1676 option, above. WARNING: This option can be extremely hazardous to the
1677 health of your pool and should only be used as a last resort.
1679 Specify the txg to use for rollback. Implies
1682 about pool recovery mode, see the
1684 option, above. WARNING: This option can be extremely hazardous to the
1685 health of your pool and should only be used as a last resort.
1691 is temporary. Temporary pool names last until export. Ensures that
1692 the original pool name will be used in all label updates and therefore
1693 is retained upon export.
1694 Will also set -o cachefile=none when not explicitly specified.
1701 .Op Ar device Ns ...
1703 Begins initializing by writing to all unallocated regions on the specified
1704 devices, or all eligible devices in the pool if no individual devices are
1706 Only leaf data or log devices may be initialized.
1709 Cancel initializing on the specified devices, or all eligible devices if none
1711 If one or more target devices are invalid or are not currently being
1712 initialized, the command will fail and no cancellation will occur on any device.
1714 Suspend initializing on the specified devices, or all eligible devices if none
1716 If one or more target devices are invalid or are not currently being
1717 initialized, the command will fail and no suspension will occur on any device.
1718 Initializing can then be resumed by running
1719 .Nm zpool Cm initialize
1720 with no flags on the relevant target devices.
1725 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
1726 .Op Fl T Sy u Ns | Ns Sy d
1728 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
1729 .Op Ar interval Op Ar count
1731 Displays logical I/O statistics for the given pools/vdevs. Physical I/Os may
1734 If writes are located nearby, they may be merged into a single
1735 larger operation. Additional I/O may be generated depending on the level of
1737 To filter output, you may pass in a list of pools, a pool and list of vdevs
1738 in that pool, or a list of any vdevs from any pool. If no items are specified,
1739 statistics for every pool in the system are shown.
1742 the statistics are printed every
1744 seconds until ^C is pressed. If
1746 flag is specified the headers are displayed only once, otherwise they are
1747 displayed periodically. If count is specified, the command exits
1748 after count reports are printed. The first report printed is always
1749 the statistics since boot regardless of whether
1753 are passed. However, this behavior can be suppressed with the
1755 flag. Also note that the units of
1759 that are printed in the report are in base 1024. To get the raw
1764 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1765 Run a script (or scripts) on each vdev and include the output as a new column
1768 output. Users can run any script found in their
1770 directory or from the system
1771 .Pa /etc/zfs/zpool.d
1772 directory. Script names containing the slash (/) character are not allowed.
1773 The default search path can be overridden by setting the
1774 ZPOOL_SCRIPTS_PATH environment variable. A privileged user can run
1776 if they have the ZPOOL_SCRIPTS_AS_ROOT
1777 environment variable set. If a script requires the use of a privileged
1780 then it's recommended you allow the user access to it in
1782 or add the user to the
1783 .Pa /etc/sudoers.d/zfs
1788 is passed without a script name, it prints a list of all scripts.
1790 also sets verbose mode
1791 .No \&( Ns Fl v Ns No \&).
1793 Script output should be in the form of "name=value". The column name is
1794 set to "name" and the value is set to "value". Multiple lines can be
1795 used to output multiple columns. The first line of output not in the
1796 "name=value" format is displayed without a column title, and no more
1797 output after that is displayed. This can be useful for printing error
1798 messages. Blank or NULL values are printed as a '-' to make output
1801 The following environment variables are set before running each script:
1802 .Bl -tag -width "VDEV_PATH"
1804 Full path to the vdev
1806 .Bl -tag -width "VDEV_UPATH"
1808 Underlying path to the vdev (/dev/sd*). For use with device mapper,
1809 multipath, or partitioned vdevs.
1811 .Bl -tag -width "VDEV_ENC_SYSFS_PATH"
1812 .It Sy VDEV_ENC_SYSFS_PATH
1813 The sysfs path to the enclosure for the vdev (if any).
1815 .It Fl T Sy u Ns | Ns Sy d
1816 Display a time stamp.
1819 for a printed representation of the internal representation of time.
1824 for standard date format.
1828 Display vdev GUIDs instead of the normal device names. These GUIDs
1829 can be used in place of device names for the zpool
1830 detach/offline/remove/replace commands.
1832 Scripted mode. Do not display headers, and separate fields by a
1833 single tab instead of arbitrary space.
1835 Display real paths for vdevs resolving all symbolic links. This can
1836 be used to look up the current block device name regardless of the
1838 path used to open it.
1840 Print headers only once when passed
1842 Display numbers in parsable (exact) values. Time values are in
1845 Display full paths for vdevs instead of only the last component of
1846 the path. This can be used in conjunction with the
1850 Print request size histograms for the leaf vdev's IO. This includes
1851 histograms of individual IOs (ind) and aggregate IOs (agg). These stats
1852 can be useful for observing how well IO aggregation is working. Note
1853 that TRIM IOs may exceed 16M, but will be counted as 16M.
1855 Verbose statistics Reports usage statistics for individual vdevs within the
1856 pool, in addition to the pool-wide statistics.
1858 Omit statistics since boot.
1859 Normally the first line of output reports the statistics since boot.
1860 This option suppresses that first line of output.
1863 Display latency histograms:
1866 Total IO time (queuing + disk IO time).
1868 Disk IO time (time reading/writing the disk).
1870 Amount of time IO spent in synchronous priority queues. Does not include
1873 Amount of time IO spent in asynchronous priority queues. Does not include
1876 Amount of time IO spent in scrub queue. Does not include disk time.
1878 Include average latency statistics:
1881 Average total IO time (queuing + disk IO time).
1883 Average disk IO time (time reading/writing the disk).
1885 Average amount of time IO spent in synchronous priority queues. Does
1886 not include disk time.
1888 Average amount of time IO spent in asynchronous priority queues.
1889 Does not include disk time.
1891 Average queuing time in scrub queue. Does not include disk time.
1893 Average queuing time in trim queue. Does not include disk time.
1895 Include active queue statistics. Each priority queue has both
1900 IOs. Pending IOs are waiting to
1901 be issued to the disk, and active IOs have been issued to disk and are
1902 waiting for completion. These stats are broken out by priority queue:
1904 .Ar syncq_read/write :
1905 Current number of entries in synchronous priority
1907 .Ar asyncq_read/write :
1908 Current number of entries in asynchronous priority queues.
1910 Current number of entries in scrub queue.
1912 Current number of entries in trim queue.
1914 All queue statistics are instantaneous measurements of the number of
1915 entries in the queues. If you specify an interval, the measurements
1916 will be sampled from the end of the interval.
1924 Removes ZFS label information from the specified
1928 must not be part of an active pool configuration.
1931 Treat exported or foreign devices as inactive.
1937 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1938 .Op Fl T Sy u Ns | Ns Sy d
1939 .Oo Ar pool Oc Ns ...
1940 .Op Ar interval Op Ar count
1942 Lists the given pools along with a health status and space usage.
1945 are specified, all pools in the system are listed.
1948 the information is printed every
1950 seconds until ^C is pressed.
1953 is specified, the command exits after
1955 reports are printed.
1958 Display vdev GUIDs instead of the normal device names. These GUIDs
1959 can be used in place of device names for the zpool
1960 detach/offline/remove/replace commands.
1963 Do not display headers, and separate fields by a single tab instead of arbitrary
1965 .It Fl o Ar property
1966 Comma-separated list of properties to display.
1969 section for a list of valid properties.
1971 .Cm name , size , allocated , free , checkpoint, expandsize , fragmentation ,
1972 .Cm capacity , dedupratio , health , altroot .
1974 Display real paths for vdevs resolving all symbolic links. This can
1975 be used to look up the current block device name regardless of the
1976 /dev/disk/ path used to open it.
1978 Display numbers in parsable
1982 Display full paths for vdevs instead of only the last component of
1983 the path. This can be used in conjunction with the
1986 .It Fl T Sy u Ns | Ns Sy d
1987 Display a time stamp.
1990 for a printed representation of the internal representation of time.
1995 for standard date format.
2000 Reports usage statistics for individual vdevs within the pool, in addition to
2001 the pool-wise statistics.
2008 .Ar pool Ar device Ns ...
2010 Takes the specified physical device offline.
2013 is offline, no attempt is made to read or write to the device.
2014 This command is not applicable to spares.
2017 Force fault. Instead of offlining the disk, put it into a faulted
2018 state. The fault will persist across imports unless the
2023 Upon reboot, the specified physical device reverts to its previous state.
2029 .Ar pool Ar device Ns ...
2031 Brings the specified physical device online.
2032 This command is not applicable to spares.
2035 Expand the device to use all available space.
2036 If the device is part of a mirror or raidz then all devices must be expanded
2037 before the new space will become available to the pool.
2044 Generates a new unique identifier for the pool.
2045 You must ensure that all devices in this pool are online and healthy before
2046 performing this action.
2053 Reopen all the vdevs associated with the pool.
2056 Do not restart an in-progress scrub operation. This is not recommended and can
2057 result in partially resilvered devices unless a second scrub is performed.
2063 .Ar pool Ar device Ns ...
2065 Removes the specified device from the pool.
2066 This command supports removing hot spare, cache, log, and both mirrored and
2067 non-redundant primary top-level vdevs, including dedup and special vdevs.
2068 When the primary pool storage includes a top-level raidz vdev only hot spare,
2069 cache, and log devices can be removed.
2071 Removing a top-level vdev reduces the total amount of space in the storage pool.
2072 The specified device will be evacuated by copying all allocated space from it to
2073 the other devices in the pool.
2076 command initiates the removal and returns, while the evacuation continues in
2078 The removal progress can be monitored with
2079 .Nm zpool Cm status .
2080 If an IO error is encountered during the removal process it will be
2083 feature flag must be enabled to remove a top-level vdev, see
2084 .Xr zpool-features 5 .
2086 A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
2088 Non-log devices or data devices that are part of a mirrored configuration can be removed using
2094 Do not actually perform the removal ("no-op").
2095 Instead, print the estimated amount of memory that will be used by the
2096 mapping table after the removal completes.
2097 This is nonzero only for top-level vdevs.
2101 Used in conjunction with the
2103 flag, displays numbers as parsable (exact) values.
2111 Stops and cancels an in-progress removal of a top-level vdev.
2116 .Op Fl o Ar property Ns = Ns Ar value
2117 .Ar pool Ar device Op Ar new_device
2123 This is equivalent to attaching
2125 waiting for it to resilver, and then detaching
2130 must be greater than or equal to the minimum size of all the devices in a mirror
2131 or raidz configuration.
2134 is required if the pool is not redundant.
2137 is not specified, it defaults to
2139 This form of replacement is useful after an existing disk has failed and has
2140 been physically replaced.
2141 In this case, the new disk may have the same
2143 path as the old device, even though it is actually a different disk.
2144 ZFS recognizes this.
2149 even if it appears to be in use.
2150 Not all devices can be overridden in this manner.
2151 .It Fl o Ar property Ns = Ns Ar value
2152 Sets the given pool properties. See the
2154 section for a list of valid properties that can be set.
2155 The only property supported at the moment is
2164 Begins a scrub or resumes a paused scrub.
2165 The scrub examines all data in the specified pools to verify that it checksums
2169 devices, ZFS automatically repairs any damage discovered during the scrub.
2172 command reports the progress of the scrub and summarizes the results of the
2173 scrub upon completion.
2175 Scrubbing and resilvering are very similar operations.
2176 The difference is that resilvering only examines data that ZFS knows to be out
2179 for example, when attaching a new device to a mirror or replacing an existing
2182 whereas scrubbing examines all data to discover silent errors due to hardware
2183 faults or disk failure.
2185 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
2187 If a scrub is paused, the
2190 If a resilver is in progress, ZFS does not allow a scrub to be started until the
2193 Note that, due to changes in pool data on a live system, it is possible for
2194 scrubs to progress slightly beyond 100% completion. During this period, no
2195 completion time estimate will be provided.
2203 Scrub pause state and progress are periodically synced to disk.
2204 If the system is restarted or pool is exported during a paused scrub,
2205 even after import, scrub will remain paused until it is resumed.
2206 Once resumed the scrub will pick up from the place where it was last
2207 checkpointed to disk.
2208 To resume a paused scrub issue
2217 Starts a resilver. If an existing resilver is already running it will be
2218 restarted from the beginning. Any drives that were scheduled for a deferred
2219 resilver will be added to the new one. This requires the
2228 .Op Ar device Ns ...
2230 Initiates an immediate on-demand TRIM operation for all of the free space in
2231 a pool. This operation informs the underlying storage devices of all blocks
2232 in the pool which are no longer allocated and allows thinly provisioned
2233 devices to reclaim the space.
2235 A manual on-demand TRIM operation can be initiated irrespective of the
2237 pool property setting. See the documentation for the
2239 property above for the types of vdev devices which can be trimmed.
2242 Causes a secure TRIM to be initiated. When performing a secure TRIM, the
2243 device guarantees that data stored on the trimmed blocks has been erased.
2244 This requires support from the device and is not supported by all SSDs.
2245 .It Fl r -rate Ar rate
2246 Controls the rate at which the TRIM operation progresses. Without this
2247 option TRIM is executed as quickly as possible. The rate, expressed in bytes
2248 per second, is applied on a per-vdev basis and may be set differently for
2251 Cancel trimming on the specified devices, or all eligible devices if none
2253 If one or more target devices are invalid or are not currently being
2254 trimmed, the command will fail and no cancellation will occur on any device.
2256 Suspend trimming on the specified devices, or all eligible devices if none
2258 If one or more target devices are invalid or are not currently being
2259 trimmed, the command will fail and no suspension will occur on any device.
2260 Trimming can then be resumed by running
2262 with no flags on the relevant target devices.
2267 .Ar property Ns = Ns Ar value
2270 Sets the given property on the specified pool.
2273 section for more information on what properties can be set and acceptable
2279 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2290 must be mirrors and the pool must not be in the process of resilvering.
2291 At the time of the split,
2293 will be a replica of
2296 last device in each mirror is split from
2301 The optional device specification causes the specified device(s) to be
2304 and, should any devices remain unspecified,
2305 the last device in each mirror is used as would be by default.
2308 Display vdev GUIDs instead of the normal device names. These GUIDs
2309 can be used in place of device names for the zpool
2310 detach/offline/remove/replace commands.
2312 Display real paths for vdevs resolving all symbolic links. This can
2313 be used to look up the current block device name regardless of the
2315 path used to open it.
2317 Indicates that this command will request encryption keys for all encrypted
2318 datasets it attempts to mount as it is bringing the new pool online. Note that
2319 if any datasets have a
2323 this command will block waiting for the keys to be entered. Without this flag
2324 encrypted datasets will be left unavailable until the keys are loaded.
2326 Do dry run, do not actually perform the split.
2327 Print out the expected configuration of
2330 Display full paths for vdevs instead of only the last component of
2331 the path. This can be used in conjunction with the
2334 .It Fl o Ar property Ns = Ns Ar value
2335 Sets the specified property for
2339 section for more information on the available pool properties.
2347 and automatically import it.
2352 .Op Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
2354 .Op Fl T Sy u Ns | Ns Sy d
2355 .Oo Ar pool Oc Ns ...
2356 .Op Ar interval Op Ar count
2358 Displays the detailed health status for the given pools.
2361 is specified, then the status of each pool in the system is displayed.
2362 For more information on pool and device health, see the
2363 .Sx Device Failure and Recovery
2366 If a scrub or resilver is in progress, this command reports the percentage done
2367 and the estimated time to completion.
2368 Both of these are only approximate, because the amount of data in the pool and
2369 the other workloads on the system can change.
2371 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
2372 Run a script (or scripts) on each vdev and include the output as a new column
2379 for complete details.
2381 Display vdev initialization status.
2383 Display vdev GUIDs instead of the normal device names. These GUIDs
2384 can be used in place of device names for the zpool
2385 detach/offline/remove/replace commands.
2387 Display real paths for vdevs resolving all symbolic links. This can
2388 be used to look up the current block device name regardless of the
2390 path used to open it.
2392 Display numbers in parsable (exact) values.
2394 Display full paths for vdevs instead of only the last component of
2395 the path. This can be used in conjunction with the
2399 Display a histogram of deduplication statistics, showing the allocated
2400 .Pq physically present on disk
2402 .Pq logically referenced in the pool
2403 block counts and sizes by reference count.
2405 Display the number of leaf VDEV slow IOs. This is the number of IOs that
2406 didn't complete in \fBzio_slow_io_ms\fR milliseconds (default 30 seconds).
2407 This does not necessarily mean the IOs failed to complete, just took an
2408 unreasonably long amount of time. This may indicate a problem with the
2411 Display vdev TRIM status.
2412 .It Fl T Sy u Ns | Ns Sy d
2413 Display a time stamp.
2416 for a printed representation of the internal representation of time.
2421 for standard date format.
2425 Displays verbose data error information, printing out a complete list of all
2426 data errors since the last complete pool scrub.
2428 Only display status for pools that are exhibiting errors or are otherwise
2430 Warnings about pools not using the latest on-disk format will not be included.
2437 This command forces all in-core dirty data to be written to the primary
2438 pool storage and not the ZIL. It will also update administrative
2439 information including quota reporting. Without arguments,
2441 will sync all pools on the system. Otherwise, it will sync only the
2447 Displays pools which do not have all supported features enabled and pools
2448 formatted using a legacy ZFS version number.
2449 These pools can continue to be used, but some features may not be available.
2451 .Nm zpool Cm upgrade Fl a
2452 to enable all features on all pools.
2458 Displays legacy ZFS versions supported by the current software.
2460 .Xr zpool-features 5
2461 for a description of feature flags features supported by the current software.
2466 .Fl a Ns | Ns Ar pool Ns ...
2468 Enables all supported features on the given pool.
2469 Once this is done, the pool will no longer be accessible on systems that do not
2470 support feature flags.
2472 .Xr zpool-features 5
2473 for details on compatibility with systems that support feature flags, but do not
2474 support all features enabled on the pool.
2477 Enables all supported features on all pools.
2479 Upgrade to the specified legacy version.
2482 flag is specified, no features will be enabled on the pool.
2483 This option can only be used to increase the version number up to the last
2484 supported legacy version number.
2490 Displays the software version of the
2492 userland utility and the zfs kernel module.
2495 The following exit values are returned:
2498 Successful completion.
2502 Invalid command line options were specified.
2506 .It Sy Example 1 No Creating a RAID-Z Storage Pool
2507 The following command creates a pool with a single raidz root vdev that
2508 consists of six disks.
2510 # zpool create tank raidz sda sdb sdc sdd sde sdf
2512 .It Sy Example 2 No Creating a Mirrored Storage Pool
2513 The following command creates a pool with two mirrors, where each mirror
2516 # zpool create tank mirror sda sdb mirror sdc sdd
2518 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Partitions
2519 The following command creates an unmirrored pool using two disk partitions.
2521 # zpool create tank sda1 sdb2
2523 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
2524 The following command creates an unmirrored pool using files.
2525 While not recommended, a pool based on files can be useful for experimental
2528 # zpool create tank /path/to/file/a /path/to/file/b
2530 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
2531 The following command adds two mirrored disks to the pool
2533 assuming the pool is already made up of two-way mirrors.
2534 The additional space is immediately available to any datasets within the pool.
2536 # zpool add tank mirror sda sdb
2538 .It Sy Example 6 No Listing Available ZFS Storage Pools
2539 The following command lists all available pools on the system.
2540 In this case, the pool
2542 is faulted due to a missing device.
2543 The results from this command are similar to the following:
2546 NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2547 rpool 19.9G 8.43G 11.4G - 33% 42% 1.00x ONLINE -
2548 tank 61.5G 20.0G 41.5G - 48% 32% 1.00x ONLINE -
2549 zion - - - - - - - FAULTED -
2551 .It Sy Example 7 No Destroying a ZFS Storage Pool
2552 The following command destroys the pool
2554 and any datasets contained within.
2556 # zpool destroy -f tank
2558 .It Sy Example 8 No Exporting a ZFS Storage Pool
2559 The following command exports the devices in pool
2561 so that they can be relocated or later imported.
2565 .It Sy Example 9 No Importing a ZFS Storage Pool
2566 The following command displays available pools, and then imports the pool
2568 for use on the system.
2569 The results from this command are similar to the following:
2573 id: 15451357997522795478
2575 action: The pool can be imported using its name or numeric identifier.
2585 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
2586 The following command upgrades all ZFS Storage pools to the current version of
2590 This system is currently running ZFS version 2.
2592 .It Sy Example 11 No Managing Hot Spares
2593 The following command creates a new pool with an available hot spare:
2595 # zpool create tank mirror sda sdb spare sdc
2598 If one of the disks were to fail, the pool would be reduced to the degraded
2600 The failed device can be replaced using the following command:
2602 # zpool replace tank sda sdd
2605 Once the data has been resilvered, the spare is automatically removed and is
2606 made available for use should another device fail.
2607 The hot spare can be permanently removed from the pool using the following
2610 # zpool remove tank sdc
2612 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
2613 The following command creates a ZFS storage pool consisting of two, two-way
2614 mirrors and mirrored log devices:
2616 # zpool create pool mirror sda sdb mirror sdc sdd log mirror \\
2619 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
2620 The following command adds two disks for use as cache devices to a ZFS storage
2623 # zpool add pool cache sdc sdd
2626 Once added, the cache devices gradually fill with content from main memory.
2627 Depending on the size of your cache devices, it could take over an hour for
2629 Capacity and reads can be monitored using the
2633 # zpool iostat -v pool 5
2635 .It Sy Example 14 No Removing a Mirrored top-level (Log or Data) Device
2636 The following commands remove the mirrored log device
2638 and mirrored top-level data device
2641 Given this configuration:
2645 scrub: none requested
2648 NAME STATE READ WRITE CKSUM
2650 mirror-0 ONLINE 0 0 0
2653 mirror-1 ONLINE 0 0 0
2657 mirror-2 ONLINE 0 0 0
2662 The command to remove the mirrored log
2666 # zpool remove tank mirror-2
2669 The command to remove the mirrored data
2673 # zpool remove tank mirror-1
2675 .It Sy Example 15 No Displaying expanded space on a device
2676 The following command displays the detailed information for the pool
2678 This pool is comprised of a single raidz vdev where one of its devices
2679 increased its capacity by 10GB.
2680 In this example, the pool will not be able to utilize this extra capacity until
2681 all the devices under the raidz vdev have been expanded.
2683 # zpool list -v data
2684 NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2685 data 23.9G 14.6G 9.30G - 48% 61% 1.00x ONLINE -
2686 raidz1 23.9G 14.6G 9.30G - 48%
2691 .It Sy Example 16 No Adding output columns
2692 Additional columns can be added to the
2700 # zpool status -c vendor,model,size
2701 NAME STATE READ WRITE CKSUM vendor model size
2703 mirror-0 ONLINE 0 0 0
2704 U1 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2705 U10 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2706 U11 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2707 U12 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2708 U13 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2709 U14 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2711 # zpool iostat -vc slaves
2712 capacity operations bandwidth
2713 pool alloc free read write read write slaves
2714 ---------- ----- ----- ----- ----- ----- ----- ---------
2715 tank 20.4G 7.23T 26 152 20.7M 21.6M
2716 mirror 20.4G 7.23T 26 152 20.7M 21.6M
2717 U1 - - 0 31 1.46K 20.6M sdb sdff
2718 U10 - - 0 1 3.77K 13.3K sdas sdgw
2719 U11 - - 0 1 288K 13.3K sdat sdgx
2720 U12 - - 0 1 78.4K 13.3K sdau sdgy
2721 U13 - - 0 1 128K 13.3K sdav sdgz
2722 U14 - - 0 1 63.2K 13.3K sdfk sdg
2725 .Sh ENVIRONMENT VARIABLES
2726 .Bl -tag -width "ZFS_ABORT"
2730 to dump core on exit for the purposes of running
2733 .Bl -tag -width "ZPOOL_IMPORT_PATH"
2734 .It Ev ZPOOL_IMPORT_PATH
2735 The search path for devices or files to use with the pool. This is a colon-separated list of directories in which
2737 looks for device nodes and files.
2743 .Bl -tag -width "ZPOOL_VDEV_NAME_GUID"
2744 .It Ev ZPOOL_VDEV_NAME_GUID
2747 subcommands to output vdev guids by default. This behavior is identical to the
2749 command line option.
2751 .Bl -tag -width "ZPOOL_VDEV_NAME_FOLLOW_LINKS"
2752 .It Ev ZPOOL_VDEV_NAME_FOLLOW_LINKS
2755 subcommands to follow links for vdev names by default. This behavior is identical to the
2757 command line option.
2759 .Bl -tag -width "ZPOOL_VDEV_NAME_PATH"
2760 .It Ev ZPOOL_VDEV_NAME_PATH
2763 subcommands to output full vdev path names by default. This
2764 behavior is identical to the
2766 command line option.
2768 .Bl -tag -width "ZFS_VDEV_DEVID_OPT_OUT"
2769 .It Ev ZFS_VDEV_DEVID_OPT_OUT
2770 Older ZFS on Linux implementations had issues when attempting to display pool
2771 config VDEV names if a
2773 NVP value is present in the pool's config.
2775 For example, a pool that originated on illumos platform would have a devid
2776 value in the config and
2778 would fail when listing the config.
2779 This would also be true for future Linux based pools.
2781 A pool can be stripped of any
2783 values on import or prevented from adding
2789 .Sy ZFS_VDEV_DEVID_OPT_OUT .
2791 .Bl -tag -width "ZPOOL_SCRIPTS_AS_ROOT"
2792 .It Ev ZPOOL_SCRIPTS_AS_ROOT
2793 Allow a privileged user to run the
2794 .Nm zpool status/iostat
2797 option. Normally, only unprivileged users are allowed to run
2800 .Bl -tag -width "ZPOOL_SCRIPTS_PATH"
2801 .It Ev ZPOOL_SCRIPTS_PATH
2802 The search path for scripts when running
2803 .Nm zpool status/iostat
2806 option. This is a colon-separated list of directories and overrides the default
2809 .Pa /etc/zfs/zpool.d
2812 .Bl -tag -width "ZPOOL_SCRIPTS_ENABLED"
2813 .It Ev ZPOOL_SCRIPTS_ENABLED
2815 .Nm zpool status/iostat
2819 .Sy ZPOOL_SCRIPTS_ENABLED
2820 is not set, it is assumed that the user is allowed to run
2821 .Nm zpool status/iostat -c .
2823 .Sh INTERFACE STABILITY
2827 .Xr zfs-module-parameters 5 ,
2828 .Xr zpool-features 5 ,