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) 2013 by Delphix. All rights reserved.
24 .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
25 .\" Copyright (c) 2017 Datto Inc.
26 .\" Copyright (c) 2017 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
56 .Op Fl m Ar mountpoint
57 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
58 .Oo Fl o Ar feature@feature Ns = Ns Ar value Oc
59 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
81 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
82 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
96 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
97 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
99 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
104 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
105 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
107 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
110 .Ar pool Ns | Ns Ar id
111 .Op Ar newpool Oo Fl t Oc
114 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
115 .Op Fl T Sy u Ns | Ns Sy d
117 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
118 .Op Ar interval Op Ar count
126 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
127 .Op Fl T Sy u Ns | Ns Sy d
128 .Oo Ar pool Oc Ns ...
129 .Op Ar interval Op Ar count
134 .Ar pool Ar device Ns ...
138 .Ar pool Ar device Ns ...
148 .Ar pool Ar device Ns ...
152 .Oo Fl o Ar property Ns = Ns Ar value Oc
153 .Ar pool Ar device Op Ar new_device
160 .Ar property Ns = Ns Ar value
165 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
168 .Oo Ar device Oc Ns ...
171 .Oo Fl c Ar SCRIPT Oc
173 .Op Fl T Sy u Ns | Ns Sy d
174 .Oo Ar pool Oc Ns ...
175 .Op Ar interval Op Ar count
178 .Oo Ar pool Oc Ns ...
187 .Fl a Ns | Ns Ar pool Ns ...
191 command configures ZFS storage pools.
192 A storage pool is a collection of devices that provides physical storage and
193 data replication for ZFS datasets.
194 All datasets within a storage pool share the same space.
197 for information on managing datasets.
198 .Ss Virtual Devices (vdevs)
199 A "virtual device" describes a single device or a collection of devices
200 organized according to certain performance and fault characteristics.
201 The following virtual devices are supported:
204 A block device, typically located under
206 ZFS can use individual slices or partitions, though the recommended mode of
207 operation is to use whole disks.
208 A disk can be specified by a full path, or it can be a shorthand name
209 .Po the relative portion of the path under
212 A whole disk can be specified by omitting the slice or partition designation.
217 When given a whole disk, ZFS automatically labels the disk, if necessary.
220 The use of files as a backing store is strongly discouraged.
221 It is designed primarily for experimental purposes, as the fault tolerance of a
222 file is only as good as the file system of which it is a part.
223 A file must be specified by a full path.
225 A mirror of two or more devices.
226 Data is replicated in an identical fashion across all components of a mirror.
227 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
228 failing before data integrity is compromised.
229 .It Sy raidz , raidz1 , raidz2 , raidz3
230 A variation on RAID-5 that allows for better distribution of parity and
231 eliminates the RAID-5
233 .Pq in which data and parity become inconsistent after a power loss .
234 Data and parity is striped across all disks within a raidz group.
236 A raidz group can have single-, double-, or triple-parity, meaning that the
237 raidz group can sustain one, two, or three failures, respectively, without
241 vdev type specifies a single-parity raidz group; the
243 vdev type specifies a double-parity raidz group; and the
245 vdev type specifies a triple-parity raidz group.
248 vdev type is an alias for
251 A raidz group with N disks of size X with P parity disks can hold approximately
252 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
254 The minimum number of devices in a raidz group is one more than the number of
256 The recommended number is between 3 and 9 to help increase performance.
258 A special pseudo-vdev which keeps track of available hot spares for a pool.
259 For more information, see the
263 A separate intent log device.
264 If more than one log device is specified, then writes are load-balanced between
266 Log devices can be mirrored.
267 However, raidz vdev types are not supported for the intent log.
268 For more information, see the
272 A device used to cache storage pool data.
273 A cache device cannot be configured as a mirror or raidz group.
274 For more information, see the
279 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
280 contain files or disks.
282 .Pq or other combinations
285 A pool can have any number of virtual devices at the top of the configuration
289 Data is dynamically distributed across all top-level devices to balance data
291 As new virtual devices are added, ZFS automatically places data on the newly
294 Virtual devices are specified one at a time on the command line, separated by
300 are used to distinguish where a group ends and another begins.
301 For example, the following creates two root vdevs, each a mirror of two disks:
303 # zpool create mypool mirror sda sdb mirror sdc sdd
305 .Ss Device Failure and Recovery
306 ZFS supports a rich set of mechanisms for handling device failure and data
308 All metadata and data is checksummed, and ZFS automatically repairs bad data
309 from a good copy when corruption is detected.
311 In order to take advantage of these features, a pool must make use of some form
312 of redundancy, using either mirrored or raidz groups.
313 While ZFS supports running in a non-redundant configuration, where each root
314 vdev is simply a disk or file, this is strongly discouraged.
315 A single case of bit corruption can render some or all of your data unavailable.
317 A pool's health status is described by one of three states: online, degraded,
319 An online pool has all devices operating normally.
320 A degraded pool is one in which one or more devices have failed, but the data is
321 still available due to a redundant configuration.
322 A faulted pool has corrupted metadata, or one or more faulted devices, and
323 insufficient replicas to continue functioning.
325 The health of the top-level vdev, such as mirror or raidz device, is
326 potentially impacted by the state of its associated vdevs, or component
328 A top-level vdev or component device is in one of the following states:
329 .Bl -tag -width "DEGRADED"
331 One or more top-level vdevs is in the degraded state because one or more
332 component devices are offline.
333 Sufficient replicas exist to continue functioning.
335 One or more component devices is in the degraded or faulted state, but
336 sufficient replicas exist to continue functioning.
337 The underlying conditions are as follows:
340 The number of checksum errors exceeds acceptable levels and the device is
341 degraded as an indication that something may be wrong.
342 ZFS continues to use the device as necessary.
344 The number of I/O errors exceeds acceptable levels.
345 The device could not be marked as faulted because there are insufficient
346 replicas to continue functioning.
349 One or more top-level vdevs is in the faulted state because one or more
350 component devices are offline.
351 Insufficient replicas exist to continue functioning.
353 One or more component devices is in the faulted state, and insufficient
354 replicas exist to continue functioning.
355 The underlying conditions are as follows:
358 The device could be opened, but the contents did not match expected values.
360 The number of I/O errors exceeds acceptable levels and the device is faulted to
361 prevent further use of the device.
364 The device was explicitly taken offline by the
368 The device is online and functioning.
370 The device was physically removed while the system was running.
371 Device removal detection is hardware-dependent and may not be supported on all
374 The device could not be opened.
375 If a pool is imported when a device was unavailable, then the device will be
376 identified by a unique identifier instead of its path since the path was never
377 correct in the first place.
380 If a device is removed and later re-attached to the system, ZFS attempts
381 to put the device online automatically.
382 Device attach detection is hardware-dependent and might not be supported on all
385 ZFS allows devices to be associated with pools as
387 These devices are not actively used in the pool, but when an active device
388 fails, it is automatically replaced by a hot spare.
389 To create a pool with hot spares, specify a
391 vdev with any number of devices.
394 # zpool create pool mirror sda sdb spare sdc sdd
397 Spares can be shared across multiple pools, and can be added with the
399 command and removed with the
402 Once a spare replacement is initiated, a new
404 vdev is created within the configuration that will remain there until the
405 original device is replaced.
406 At this point, the hot spare becomes available again if another device fails.
408 If a pool has a shared spare that is currently being used, the pool can not be
409 exported since other pools may use this shared spare, which may lead to
410 potential data corruption.
412 An in-progress spare replacement can be cancelled by detaching the hot spare.
413 If the original faulted device is detached, then the hot spare assumes its
414 place in the configuration, and is removed from the spare list of all active
417 Spares cannot replace log devices.
419 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
421 For instance, databases often require their transactions to be on stable storage
422 devices when returning from a system call.
423 NFS and other applications can also use
425 to ensure data stability.
426 By default, the intent log is allocated from blocks within the main pool.
427 However, it might be possible to get better performance using separate intent
428 log devices such as NVRAM or a dedicated disk.
431 # zpool create pool sda sdb log sdc
434 Multiple log devices can also be specified, and they can be mirrored.
437 section for an example of mirroring multiple log devices.
439 Log devices can be added, replaced, attached, detached, and imported and
440 exported as part of the larger pool.
441 Mirrored log devices can be removed by specifying the top-level mirror for the
444 Devices can be added to a storage pool as
446 These devices provide an additional layer of caching between main memory and
448 For read-heavy workloads, where the working set size is much larger than what
449 can be cached in main memory, using cache devices allow much more of this
450 working set to be served from low latency media.
451 Using cache devices provides the greatest performance improvement for random
452 read-workloads of mostly static content.
454 To create a pool with cache devices, specify a
456 vdev with any number of devices.
459 # zpool create pool sda sdb cache sdc sdd
462 Cache devices cannot be mirrored or part of a raidz configuration.
463 If a read error is encountered on a cache device, that read I/O is reissued to
464 the original storage pool device, which might be part of a mirrored or raidz
467 The content of the cache devices is considered volatile, as is the case with
470 Each pool has several properties associated with it.
471 Some properties are read-only statistics while others are configurable and
472 change the behavior of the pool.
474 The following are read-only properties:
477 Amount of storage available within the pool.
478 This property can also be referred to by its shortened column name,
481 Percentage of pool space used.
482 This property can also be referred to by its shortened column name,
485 Amount of uninitialized space within the pool or device that can be used to
486 increase the total capacity of the pool.
487 Uninitialized space consists of any space on an EFI labeled vdev which has not
490 .Nm zpool Cm online Fl e
492 This space occurs when a LUN is dynamically expanded.
494 The amount of fragmentation in the pool.
496 The amount of free space available in the pool.
498 After a file system or snapshot is destroyed, the space it was using is
499 returned to the pool asynchronously.
501 is the amount of space remaining to be reclaimed.
508 The current health of the pool.
510 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
512 A unique identifier for the pool.
514 Total size of the storage pool.
515 .It Sy unsupported@ Ns Em feature_guid
516 Information about unsupported features that are enabled on the pool.
521 Amount of storage space used within the pool.
524 The space usage properties report actual physical space available to the
526 The physical space can be different from the total amount of space that any
527 contained datasets can actually use.
528 The amount of space used in a raidz configuration depends on the characteristics
529 of the data being written.
530 In addition, ZFS reserves some space for internal accounting that the
532 command takes into account, but the
535 For non-full pools of a reasonable size, these effects should be invisible.
536 For small pools, or pools that are close to being completely full, these
537 discrepancies may become more noticeable.
539 The following property can be set at creation time and import time:
542 Alternate root directory.
543 If set, this directory is prepended to any mount points within the pool.
544 This can be used when examining an unknown pool where the mount points cannot be
545 trusted, or in an alternate boot environment, where the typical paths are not
548 is not a persistent property.
549 It is valid only while the system is up.
553 .Sy cachefile Ns = Ns Sy none ,
554 though this may be overridden using an explicit setting.
557 The following property can be set only at import time:
559 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
562 the pool will be imported in read-only mode.
563 This property can also be referred to by its shortened column name,
567 The following properties can be set at creation time and import time, and later
572 .It Sy ashift Ns = Ns Sy ashift
573 Pool sector size exponent, to the power of
575 (internally referred to as
577 ). Values from 9 to 16, inclusive, are valid; also, the special
578 value 0 (the default) means to auto-detect using the kernel's block
579 layer and a ZFS internal exception list. I/O operations will be aligned
580 to the specified size boundaries. Additionally, the minimum (disk)
581 write size will be set to the specified size, so this represents a
582 space vs. performance trade-off. For optimal performance, the pool
583 sector size should be greater than or equal to the sector size of the
584 underlying disks. The typical case for setting this property is when
585 performance is important and the underlying disks use 4KiB sectors but
586 report 512B sectors to the OS (for compatibility reasons); in that
589 (which is 1<<12 = 4096). When set, this property is
590 used as the default hint value in subsequent vdev operations (add,
591 attach and replace). Changing this value will not modify any existing
592 vdev, not even on disk replacement; however it can be used, for
593 instance, to replace a dying 512B sectors disk with a newer 4KiB
594 sectors device: this will probably result in bad performance but at the
595 same time could prevent loss of data.
596 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
597 Controls automatic pool expansion when the underlying LUN is grown.
600 the pool will be resized according to the size of the expanded device.
601 If the device is part of a mirror or raidz then all devices within that
602 mirror/raidz group must be expanded before the new space is made available to
604 The default behavior is
606 This property can also be referred to by its shortened column name,
608 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
609 Controls automatic device replacement.
612 device replacement must be initiated by the administrator by using the
617 any new device, found in the same physical location as a device that previously
618 belonged to the pool, is automatically formatted and replaced.
619 The default behavior is
621 This property can also be referred to by its shortened column name,
623 Autoreplace can also be used with virtual disks (like device
624 mapper) provided that you use the /dev/disk/by-vdev paths setup by
625 vdev_id.conf. See the
627 man page for more details.
628 Autoreplace and autoonline require the ZFS Event Daemon be configured and
631 man page for more details.
632 .It Sy bootfs Ns = Ns Sy (unset) Ns | Ns Ar pool Ns / Ns Ar dataset
633 Identifies the default bootable dataset for the root pool. This property is
634 expected to be set mainly by the installation and upgrade programs.
635 Not all Linux distribution boot processes use the bootfs property.
636 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
637 Controls the location of where the pool configuration is cached.
638 Discovering all pools on system startup requires a cached copy of the
639 configuration data that is stored on the root file system.
640 All pools in this cache are automatically imported when the system boots.
641 Some environments, such as install and clustering, need to cache this
642 information in a different location so that pools are not automatically
644 Setting this property caches the pool configuration in a different location that
645 can later be imported with
646 .Nm zpool Cm import Fl c .
647 Setting it to the special value
649 creates a temporary pool that is never cached, and the special value
652 uses the default location.
654 Multiple pools can share the same cache file.
655 Because the kernel destroys and recreates this file when pools are added and
656 removed, care should be taken when attempting to access this file.
657 When the last pool using a
659 is exported or destroyed, the file will be empty.
660 .It Sy comment Ns = Ns Ar text
661 A text string consisting of printable ASCII characters that will be stored
662 such that it is available even if the pool becomes faulted.
663 An administrator can provide additional information about a pool using this
665 .It Sy dedupditto Ns = Ns Ar number
666 Threshold for the number of block ditto copies.
667 If the reference count for a deduplicated block increases above this number, a
668 new ditto copy of this block is automatically stored.
669 The default setting is
671 which causes no ditto copies to be created for deduplicated blocks.
672 The minimum legal nonzero setting is
674 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
675 Controls whether a non-privileged user is granted access based on the dataset
676 permissions defined on the dataset.
679 for more information on ZFS delegated administration.
680 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
681 Controls the system behavior in the event of catastrophic pool failure.
682 This condition is typically a result of a loss of connectivity to the underlying
683 storage device(s) or a failure of all devices within the pool.
684 The behavior of such an event is determined as follows:
685 .Bl -tag -width "continue"
687 Blocks all I/O access until the device connectivity is recovered and the errors
689 This is the default behavior.
693 to any new write I/O requests but allows reads to any of the remaining healthy
695 Any write requests that have yet to be committed to disk would be blocked.
697 Prints out a message to the console and generates a system crash dump.
699 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
700 The value of this property is the current state of
702 The only valid value when setting this property is
706 to the enabled state.
709 for details on feature states.
710 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
711 Controls whether information about snapshots associated with this pool is
719 This property can also be referred to by its shortened name,
721 .It Sy multihost Ns = Ns Sy on Ns | Ns Sy off
722 Controls whether a pool activity check should be performed during
723 .Nm zpool Cm import .
724 When a pool is determined to be active it cannot be imported, even with the
726 option. This property is intended to be used in failover configurations
727 where multiple hosts have access to a pool on shared storage. When this
728 property is on, periodic writes to storage occur to show the pool is in use.
730 .Sy zfs_multihost_interval
732 .Xr zfs-module-parameters 5
733 man page. In order to enable this property each host must set a unique hostid.
737 .Xr spl-module-paramters 5
738 for additional details. The default value is
740 .It Sy version Ns = Ns Ar version
741 The current on-disk version of the pool.
742 This can be increased, but never decreased.
743 The preferred method of updating pools is with the
745 command, though this property can be used when a specific version is needed for
746 backwards compatibility.
747 Once feature flags are enabled on a pool this property will no longer have a
751 All subcommands that modify state are logged persistently to the pool in their
756 command provides subcommands to create and destroy storage pools, add capacity
757 to storage pools, and provide information about the storage pools.
758 The following subcommands are supported:
764 Displays a help message.
769 .Oo Fl o Ar property Ns = Ns Ar value Oc
772 Adds the specified virtual devices to the given pool.
775 specification is described in the
780 option, and the device checks performed are described in the
787 even if they appear in use or specify a conflicting replication level.
788 Not all devices can be overridden in this manner.
792 GUIDs instead of the normal device names. These GUIDs can be used in place of
793 device names for the zpool detach/offline/remove/replace commands.
795 Display real paths for
797 resolving all symbolic links. This can be used to look up the current block
798 device name regardless of the /dev/disk/ path used to open it.
800 Displays the configuration that would be used without actually adding the
802 The actual pool creation can still fail due to insufficient privileges or
805 Display real paths for
807 instead of only the last component of the path. This can be used in
808 conjunction with the -L flag.
809 .It Fl o Ar property Ns = Ns Ar value
810 Sets the given pool properties. See the
812 section for a list of valid properties that can be set. The only property
813 supported at the moment is ashift.
819 .Oo Fl o Ar property Ns = Ns Ar value Oc
820 .Ar pool device new_device
826 The existing device cannot be part of a raidz configuration.
829 is not currently part of a mirrored configuration,
831 automatically transforms into a two-way mirror of
837 is part of a two-way mirror, attaching
839 creates a three-way mirror, and so on.
842 begins to resilver immediately.
847 even if its appears to be in use.
848 Not all devices can be overridden in this manner.
849 .It Fl o Ar property Ns = Ns Ar value
850 Sets the given pool properties. See the
852 section for a list of valid properties that can be set. The only property
853 supported at the moment is ashift.
861 Clears device errors in a pool.
862 If no arguments are specified, all device errors within the pool are cleared.
863 If one or more devices is specified, only those errors associated with the
864 specified device or devices are cleared.
869 .Op Fl m Ar mountpoint
870 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
871 .Oo Fl o Ar feature@feature Ns = Ns Ar value Oc Ns ...
872 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
877 Creates a new storage pool containing the virtual devices specified on the
879 The pool name must begin with a letter, and can only contain
880 alphanumeric characters as well as underscore
896 are reserved, as are names beginning with the pattern
900 specification is described in the
904 The command verifies that each device specified is accessible and not currently
905 in use by another subsystem.
906 There are some uses, such as being currently mounted, or specified as the
907 dedicated dump device, that prevents a device from ever being used by ZFS.
908 Other uses, such as having a preexisting UFS file system, can be overridden with
913 The command also checks that the replication strategy for the pool is
915 An attempt to combine redundant and non-redundant storage in a single pool, or
916 to mix disks and files, results in an error unless
919 The use of differently sized devices within a single raidz or mirror group is
920 also flagged as an error unless
926 option is specified, the default mount point is
928 The mount point must not exist or must be empty, or else the root dataset
930 This can be overridden with the
934 By default all supported features are enabled on the new pool unless the
939 Do not enable any features on the new pool.
940 Individual features can be enabled by setting their corresponding properties to
947 for details about feature properties.
951 even if they appear in use or specify a conflicting replication level.
952 Not all devices can be overridden in this manner.
953 .It Fl m Ar mountpoint
954 Sets the mount point for the root dataset.
955 The default mount point is
962 The mount point must be an absolute path,
966 For more information on dataset mount points, see
969 Displays the configuration that would be used without actually creating the
971 The actual pool creation can still fail due to insufficient privileges or
973 .It Fl o Ar property Ns = Ns Ar value
974 Sets the given pool properties.
977 section for a list of valid properties that can be set.
978 .It Fl o Ar feature@feature Ns = Ns Ar value
979 Sets the given pool feature. See the
981 section for a list of valid features that can be set.
982 Value can be either disabled or enabled.
983 .It Fl O Ar file-system-property Ns = Ns Ar value
984 Sets the given file system properties in the root file system of the pool.
989 for a list of valid properties that can be set.
992 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
994 Sets the in-core pool name to
996 while the on-disk name will be the name specified as the pool name
998 This will set the default cachefile property to none. This is intended
999 to handle name space collisions when creating pools for other systems,
1000 such as virtual machines or physical machines whose pools live on network
1009 Destroys the given pool, freeing up any devices for other use.
1010 This command tries to unmount any active datasets before destroying the pool.
1013 Forces any active datasets contained within the pool to be unmounted.
1023 The operation is refused if there are no other valid replicas of the data.
1024 If device may be re-added to the pool later on then consider the
1033 Lists all recent events generated by the ZFS kernel modules. These events
1036 and used to automate administrative tasks such as replacing a failed device
1037 with a hot spare. For more information about the subclasses and event payloads
1038 that can be generated see the
1043 Clear all previous events.
1047 Scripted mode. Do not display headers, and separate fields by a
1048 single tab instead of arbitrary space.
1050 Print the entire payload for each event.
1059 Exports the given pools from the system.
1060 All devices are marked as exported, but are still considered in use by other
1062 The devices can be moved between systems
1063 .Pq even those of different endianness
1064 and imported as long as a sufficient number of devices are present.
1066 Before exporting the pool, all datasets within the pool are unmounted.
1067 A pool can not be exported if it has a shared spare that is currently being
1070 For pools to be portable, you must give the
1072 command whole disks, not just partitions, so that ZFS can label the disks with
1073 portable EFI labels.
1074 Otherwise, disk drivers on platforms of different endianness will not recognize
1078 Exports all pools imported on the system.
1080 Forcefully unmount all datasets, using the
1084 This command will forcefully export the pool even if it has a shared spare that
1085 is currently being used.
1086 This may lead to potential data corruption.
1092 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1093 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1096 Retrieves the given list of properties
1098 or all properties if
1102 for the specified storage pool(s).
1103 These properties are displayed with the following fields:
1105 name Name of storage pool
1106 property Property name
1107 value Property value
1108 source Property source, either 'default' or 'local'.
1113 section for more information on the available pool properties.
1117 Do not display headers, and separate fields by a single tab instead of arbitrary
1120 A comma-separated list of columns to display.
1121 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
1122 is the default value.
1124 Display numbers in parsable (exact) values.
1130 .Oo Ar pool Oc Ns ...
1132 Displays the command history of the specified pool(s) or all pools if no pool is
1136 Displays internally logged ZFS events in addition to user initiated events.
1138 Displays log records in long format, which in addition to standard format
1139 includes, the user name, the hostname, and the zone in which the operation was
1148 Lists pools available to import.
1151 option is not specified, this command searches for devices in
1155 option can be specified multiple times, and all directories are searched.
1156 If the device appears to be part of an exported pool, this command displays a
1157 summary of the pool with the name of the pool, a numeric identifier, as well as
1158 the vdev layout and current health of the device for each device or file.
1159 Destroyed pools, pools that were previously destroyed with the
1160 .Nm zpool Cm destroy
1161 command, are not listed unless the
1163 option is specified.
1165 The numeric identifier is unique, and can be used instead of the pool name when
1166 multiple exported pools of the same name are available.
1168 .It Fl c Ar cachefile
1169 Reads configuration from the given
1171 that was created with the
1176 is used instead of searching for devices.
1178 Searches for devices or files in
1182 option can be specified multiple times.
1184 Lists destroyed pools only.
1191 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
1192 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1194 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1198 Imports all pools found in the search directories.
1199 Identical to the previous command, except that all pools with a sufficient
1200 number of devices available are imported.
1201 Destroyed pools, pools that were previously destroyed with the
1202 .Nm zpool Cm destroy
1203 command, will not be imported unless the
1205 option is specified.
1208 Searches for and imports all pools found.
1209 .It Fl c Ar cachefile
1210 Reads configuration from the given
1212 that was created with the
1217 is used instead of searching for devices.
1219 Searches for devices or files in
1223 option can be specified multiple times.
1224 This option is incompatible with the
1228 Imports destroyed pools only.
1231 option is also required.
1233 Forces import, even if the pool appears to be potentially active.
1235 Recovery mode for a non-importable pool.
1236 Attempt to return the pool to an importable state by discarding the last few
1238 Not all damaged pools can be recovered by using this option.
1239 If successful, the data from the discarded transactions is irretrievably lost.
1240 This option is ignored if the pool is importable or already imported.
1242 Indicates that this command will request encryption keys for all encrypted
1243 datasets it attempts to mount as it is bringing the pool online. Note that if
1248 this command will block waiting for the keys to be entered. Without this flag
1249 encrypted datasets will be left unavailable until the keys are loaded.
1251 Allows a pool to import when there is a missing log device.
1252 Recent transactions can be lost because the log device will be discarded.
1257 Determines whether a non-importable pool can be made importable again, but does
1258 not actually perform the pool recovery.
1259 For more details about pool recovery mode, see the
1263 Import the pool without mounting any file systems.
1265 Comma-separated list of mount options to use when mounting datasets within the
1269 for a description of dataset properties and mount options.
1270 .It Fl o Ar property Ns = Ns Ar value
1271 Sets the specified property on the imported pool.
1274 section for more information on the available pool properties.
1285 Scan using the default search path, the libblkid cache will not be
1286 consulted. A custom search path may be specified by setting the
1287 ZPOOL_IMPORT_PATH environment variable.
1291 recovery option. Determines whether extreme
1292 measures to find a valid txg should take place. This allows the pool to
1293 be rolled back to a txg which is no longer guaranteed to be consistent.
1294 Pools imported at an inconsistent txg may contain uncorrectable
1295 checksum errors. For more details about pool recovery mode, see the
1297 option, above. WARNING: This option can be extremely hazardous to the
1298 health of your pool and should only be used as a last resort.
1300 Specify the txg to use for rollback. Implies
1303 about pool recovery mode, see the
1305 option, above. WARNING: This option can be extremely hazardous to the
1306 health of your pool and should only be used as a last resort.
1312 .Op Fl F Oo Fl n Oc Oo Fl t Oc Oo Fl T Oc Oo Fl X Oc
1313 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1315 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1318 .Ar pool Ns | Ns Ar id
1321 Imports a specific pool.
1322 A pool can be identified by its name or the numeric identifier.
1325 is specified, the pool is imported using the name
1327 Otherwise, it is imported with the same name as its exported name.
1329 If a device is removed from a system without running
1331 first, the device appears as potentially active.
1332 It cannot be determined if this was a failed export, or whether the device is
1333 really in use from another host.
1334 To import a pool in this state, the
1338 .It Fl c Ar cachefile
1339 Reads configuration from the given
1341 that was created with the
1346 is used instead of searching for devices.
1348 Searches for devices or files in
1352 option can be specified multiple times.
1353 This option is incompatible with the
1357 Imports destroyed pool.
1360 option is also required.
1362 Forces import, even if the pool appears to be potentially active.
1364 Recovery mode for a non-importable pool.
1365 Attempt to return the pool to an importable state by discarding the last few
1367 Not all damaged pools can be recovered by using this option.
1368 If successful, the data from the discarded transactions is irretrievably lost.
1369 This option is ignored if the pool is importable or already imported.
1371 Indicates that this command will request encryption keys for all encrypted
1372 datasets it attempts to mount as it is bringing the pool online. Note that if
1377 this command will block waiting for the keys to be entered. Without this flag
1378 encrypted datasets will be left unavailable until the keys are loaded.
1380 Allows a pool to import when there is a missing log device.
1381 Recent transactions can be lost because the log device will be discarded.
1386 Determines whether a non-importable pool can be made importable again, but does
1387 not actually perform the pool recovery.
1388 For more details about pool recovery mode, see the
1392 Comma-separated list of mount options to use when mounting datasets within the
1396 for a description of dataset properties and mount options.
1397 .It Fl o Ar property Ns = Ns Ar value
1398 Sets the specified property on the imported pool.
1401 section for more information on the available pool properties.
1412 Scan using the default search path, the libblkid cache will not be
1413 consulted. A custom search path may be specified by setting the
1414 ZPOOL_IMPORT_PATH environment variable.
1418 recovery option. Determines whether extreme
1419 measures to find a valid txg should take place. This allows the pool to
1420 be rolled back to a txg which is no longer guaranteed to be consistent.
1421 Pools imported at an inconsistent txg may contain uncorrectable
1422 checksum errors. For more details about pool recovery mode, see the
1424 option, above. WARNING: This option can be extremely hazardous to the
1425 health of your pool and should only be used as a last resort.
1427 Specify the txg to use for rollback. Implies
1430 about pool recovery mode, see the
1432 option, above. WARNING: This option can be extremely hazardous to the
1433 health of your pool and should only be used as a last resort.
1439 is temporary. Temporary pool names last until export. Ensures that
1440 the original pool name will be used in all label updates and therefore
1441 is retained upon export.
1442 Will also set -o cachefile=none when not explicitly specified.
1447 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
1448 .Op Fl T Sy u Ns | Ns Sy d
1450 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
1451 .Op Ar interval Op Ar count
1453 Displays I/O statistics for the given pools/vdevs. You can pass in a
1454 list of pools, a pool and list of vdevs in that pool, or a list of any
1455 vdevs from any pool. If no items are specified, statistics for every
1456 pool in the system are shown.
1459 the statistics are printed every
1461 seconds until ^C is pressed. If count is specified, the command exits
1462 after count reports are printed. The first report printed is always
1463 the statistics since boot regardless of whether
1467 are passed. However, this behavior can be suppressed with the
1469 flag. Also note that the units of
1473 that are printed in the report are in base 1024. To get the raw
1478 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1479 Run a script (or scripts) on each vdev and include the output as a new column
1482 output. Users can run any script found in their
1484 directory or from the system
1485 .Pa /etc/zfs/zpool.d
1486 directory. Script names containing the slash (/) character are not allowed.
1487 The default search path can be overridden by setting the
1488 ZPOOL_SCRIPTS_PATH environment variable. A privileged user can run
1490 if they have the ZPOOL_SCRIPTS_AS_ROOT
1491 environment variable set. If a script requires the use of a privileged
1494 then it's recommended you allow the user access to it in
1496 or add the user to the
1497 .Pa /etc/sudoers.d/zfs
1502 is passed without a script name, it prints a list of all scripts.
1504 also sets verbose mode
1505 .No \&( Ns Fl v Ns No \&).
1507 Script output should be in the form of "name=value". The column name is
1508 set to "name" and the value is set to "value". Multiple lines can be
1509 used to output multiple columns. The first line of output not in the
1510 "name=value" format is displayed without a column title, and no more
1511 output after that is displayed. This can be useful for printing error
1512 messages. Blank or NULL values are printed as a '-' to make output
1515 The following environment variables are set before running each script:
1516 .Bl -tag -width "VDEV_PATH"
1518 Full path to the vdev
1520 .Bl -tag -width "VDEV_UPATH"
1522 Underlying path to the vdev (/dev/sd*). For use with device mapper,
1523 multipath, or partitioned vdevs.
1525 .Bl -tag -width "VDEV_ENC_SYSFS_PATH"
1526 .It Sy VDEV_ENC_SYSFS_PATH
1527 The sysfs path to the enclosure for the vdev (if any).
1529 .It Fl T Sy u Ns | Ns Sy d
1530 Display a time stamp.
1533 for a printed representation of the internal representation of time.
1538 for standard date format.
1542 Display vdev GUIDs instead of the normal device names. These GUIDs
1543 can be used in place of device names for the zpool
1544 detach/offline/remove/replace commands.
1546 Scripted mode. Do not display headers, and separate fields by a
1547 single tab instead of arbitrary space.
1549 Display real paths for vdevs resolving all symbolic links. This can
1550 be used to look up the current block device name regardless of the
1552 path used to open it.
1554 Display numbers in parsable (exact) values. Time values are in
1557 Display full paths for vdevs instead of only the last component of
1558 the path. This can be used in conjunction with the
1562 Print request size histograms for the leaf ZIOs. This includes
1563 histograms of individual ZIOs (
1565 and aggregate ZIOs (
1567 These stats can be useful for seeing how well the ZFS IO aggregator is
1568 working. Do not confuse these request size stats with the block layer
1569 requests; it's possible ZIOs can be broken up before being sent to the
1572 Verbose statistics Reports usage statistics for individual vdevs within the
1573 pool, in addition to the pool-wide statistics.
1577 Include average latency statistics:
1580 Average total IO time (queuing + disk IO time).
1582 Average disk IO time (time reading/writing the disk).
1584 Average amount of time IO spent in synchronous priority queues. Does
1585 not include disk time.
1587 Average amount of time IO spent in asynchronous priority queues.
1588 Does not include disk time.
1590 Average queuing time in scrub queue. Does not include disk time.
1592 Include active queue statistics. Each priority queue has both
1597 IOs. Pending IOs are waiting to
1598 be issued to the disk, and active IOs have been issued to disk and are
1599 waiting for completion. These stats are broken out by priority queue:
1601 .Ar syncq_read/write :
1602 Current number of entries in synchronous priority
1604 .Ar asyncq_read/write :
1605 Current number of entries in asynchronous priority queues.
1607 Current number of entries in scrub queue.
1609 All queue statistics are instantaneous measurements of the number of
1610 entries in the queues. If you specify an interval, the measurements
1611 will be sampled from the end of the interval.
1619 Removes ZFS label information from the specified
1623 must not be part of an active pool configuration.
1626 Treat exported or foreign devices as inactive.
1632 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1633 .Op Fl T Sy u Ns | Ns Sy d
1634 .Oo Ar pool Oc Ns ...
1635 .Op Ar interval Op Ar count
1637 Lists the given pools along with a health status and space usage.
1640 are specified, all pools in the system are listed.
1643 the information is printed every
1645 seconds until ^C is pressed.
1648 is specified, the command exits after
1650 reports are printed.
1653 Display vdev GUIDs instead of the normal device names. These GUIDs
1654 can be used in place of device names for the zpool
1655 detach/offline/remove/replace commands.
1658 Do not display headers, and separate fields by a single tab instead of arbitrary
1660 .It Fl o Ar property
1661 Comma-separated list of properties to display.
1664 section for a list of valid properties.
1666 .Sy name, size, alloc, free, fragmentation, expandsize, capacity,
1667 .Sy dedupratio, health, altroot .
1669 Display real paths for vdevs resolving all symbolic links. This can
1670 be used to look up the current block device name regardless of the
1671 /dev/disk/ path used to open it.
1673 Display numbers in parsable
1677 Display full paths for vdevs instead of only the last component of
1678 the path. This can be used in conjunction with the
1680 .It Fl T Sy u Ns | Ns Sy d
1681 Display a time stamp.
1684 for a printed representation of the internal representation of time.
1689 for standard date format.
1694 Reports usage statistics for individual vdevs within the pool, in addition to
1695 the pool-wise statistics.
1702 .Ar pool Ar device Ns ...
1704 Takes the specified physical device offline.
1707 is offline, no attempt is made to read or write to the device.
1708 This command is not applicable to spares.
1711 Force fault. Instead of offlining the disk, put it into a faulted
1712 state. The fault will persist across imports unless the
1717 Upon reboot, the specified physical device reverts to its previous state.
1723 .Ar pool Ar device Ns ...
1725 Brings the specified physical device online.
1726 This command is not applicable to spares.
1729 Expand the device to use all available space.
1730 If the device is part of a mirror or raidz then all devices must be expanded
1731 before the new space will become available to the pool.
1738 Generates a new unique identifier for the pool.
1739 You must ensure that all devices in this pool are online and healthy before
1740 performing this action.
1747 Reopen all the vdevs associated with the pool.
1750 Do not restart an in-progress scrub operation. This is not recommended and can
1751 result in partially resilvered devices unless a second scrub is performed.
1755 .Ar pool Ar device Ns ...
1757 Removes the specified device from the pool.
1758 This command currently only supports removing hot spares, cache, and log
1760 A mirrored log device can be removed by specifying the top-level mirror for the
1762 Non-log devices that are part of a mirrored configuration can be removed using
1766 Non-redundant and raidz devices cannot be removed from a pool.
1771 .Op Fl o Ar property Ns = Ns Ar value
1772 .Ar pool Ar device Op Ar new_device
1778 This is equivalent to attaching
1780 waiting for it to resilver, and then detaching
1785 must be greater than or equal to the minimum size of all the devices in a mirror
1786 or raidz configuration.
1789 is required if the pool is not redundant.
1792 is not specified, it defaults to
1794 This form of replacement is useful after an existing disk has failed and has
1795 been physically replaced.
1796 In this case, the new disk may have the same
1798 path as the old device, even though it is actually a different disk.
1799 ZFS recognizes this.
1804 even if its appears to be in use.
1805 Not all devices can be overridden in this manner.
1806 .It Fl o Ar property Ns = Ns Ar value
1807 Sets the given pool properties. See the
1809 section for a list of valid properties that can be set.
1810 The only property supported at the moment is
1819 Begins a scrub or resumes a paused scrub.
1820 The scrub examines all data in the specified pools to verify that it checksums
1824 devices, ZFS automatically repairs any damage discovered during the scrub.
1827 command reports the progress of the scrub and summarizes the results of the
1828 scrub upon completion.
1830 Scrubbing and resilvering are very similar operations.
1831 The difference is that resilvering only examines data that ZFS knows to be out
1834 for example, when attaching a new device to a mirror or replacing an existing
1837 whereas scrubbing examines all data to discover silent errors due to hardware
1838 faults or disk failure.
1840 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1842 If a scrub is paused, the
1845 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1854 Scrub pause state and progress are periodically synced to disk.
1855 If the system is restarted or pool is exported during a paused scrub,
1856 even after import, scrub will remain paused until it is resumed.
1857 Once resumed the scrub will pick up from the place where it was last
1858 checkpointed to disk.
1859 To resume a paused scrub issue
1866 .Ar property Ns = Ns Ar value
1869 Sets the given property on the specified pool.
1872 section for more information on what properties can be set and acceptable
1878 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1889 must be mirrors and the pool must not be in the process of resilvering.
1890 At the time of the split,
1892 will be a replica of
1895 last device in each mirror is split from
1900 The optional device specification causes the specified device(s) to be
1903 and, should any devices remain unspecified,
1904 the last device in each mirror is used as would be by default.
1907 Display vdev GUIDs instead of the normal device names. These GUIDs
1908 can be used in place of device names for the zpool
1909 detach/offline/remove/replace commands.
1911 Display real paths for vdevs resolving all symbolic links. This can
1912 be used to look up the current block device name regardless of the
1914 path used to open it.
1916 Indicates that this command will request encryption keys for all encrypted
1917 datasets it attempts to mount as it is bringing the new pool online. Note that
1918 if any datasets have a
1922 this command will block waiting for the keys to be entered. Without this flag
1923 encrypted datasets will be left unavailable until the keys are loaded.
1925 Do dry run, do not actually perform the split.
1926 Print out the expected configuration of
1929 Display full paths for vdevs instead of only the last component of
1930 the path. This can be used in conjunction with the
1932 .It Fl o Ar property Ns = Ns Ar value
1933 Sets the specified property for
1937 section for more information on the available pool properties.
1945 and automatically import it.
1950 .Op Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1952 .Op Fl T Sy u Ns | Ns Sy d
1953 .Oo Ar pool Oc Ns ...
1954 .Op Ar interval Op Ar count
1956 Displays the detailed health status for the given pools.
1959 is specified, then the status of each pool in the system is displayed.
1960 For more information on pool and device health, see the
1961 .Sx Device Failure and Recovery
1964 If a scrub or resilver is in progress, this command reports the percentage done
1965 and the estimated time to completion.
1966 Both of these are only approximate, because the amount of data in the pool and
1967 the other workloads on the system can change.
1969 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1970 Run a script (or scripts) on each vdev and include the output as a new column
1977 for complete details.
1979 Display vdev GUIDs instead of the normal device names. These GUIDs
1980 can be used in place of device names for the zpool
1981 detach/offline/remove/replace commands.
1983 Display real paths for vdevs resolving all symbolic links. This can
1984 be used to look up the current block device name regardless of the
1986 path used to open it.
1988 Display numbers in parsable (exact) values. Time values are in
1991 Display a histogram of deduplication statistics, showing the allocated
1992 .Pq physically present on disk
1994 .Pq logically referenced in the pool
1995 block counts and sizes by reference count.
1996 .It Fl T Sy u Ns | Ns Sy d
1997 Display a time stamp.
2000 for a printed representation of the internal representation of time.
2005 for standard date format.
2009 Displays verbose data error information, printing out a complete list of all
2010 data errors since the last complete pool scrub.
2012 Only display status for pools that are exhibiting errors or are otherwise
2014 Warnings about pools not using the latest on-disk format will not be included.
2021 This command forces all in-core dirty data to be written to the primary
2022 pool storage and not the ZIL. It will also update administrative
2023 information including quota reporting. Without arguments,
2025 will sync all pools on the system. Otherwise, it will sync only the
2031 Displays pools which do not have all supported features enabled and pools
2032 formatted using a legacy ZFS version number.
2033 These pools can continue to be used, but some features may not be available.
2035 .Nm zpool Cm upgrade Fl a
2036 to enable all features on all pools.
2042 Displays legacy ZFS versions supported by the current software.
2044 .Xr zpool-features 5
2045 for a description of feature flags features supported by the current software.
2050 .Fl a Ns | Ns Ar pool Ns ...
2052 Enables all supported features on the given pool.
2053 Once this is done, the pool will no longer be accessible on systems that do not
2054 support feature flags.
2057 for details on compatibility with systems that support feature flags, but do not
2058 support all features enabled on the pool.
2061 Enables all supported features on all pools.
2063 Upgrade to the specified legacy version.
2066 flag is specified, no features will be enabled on the pool.
2067 This option can only be used to increase the version number up to the last
2068 supported legacy version number.
2072 The following exit values are returned:
2075 Successful completion.
2079 Invalid command line options were specified.
2083 .It Sy Example 1 No Creating a RAID-Z Storage Pool
2084 The following command creates a pool with a single raidz root vdev that
2085 consists of six disks.
2087 # zpool create tank raidz sda sdb sdc sdd sde sdf
2089 .It Sy Example 2 No Creating a Mirrored Storage Pool
2090 The following command creates a pool with two mirrors, where each mirror
2093 # zpool create tank mirror sda sdb mirror sdc sdd
2095 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Partitions
2096 The following command creates an unmirrored pool using two disk partitions.
2098 # zpool create tank sda1 sdb2
2100 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
2101 The following command creates an unmirrored pool using files.
2102 While not recommended, a pool based on files can be useful for experimental
2105 # zpool create tank /path/to/file/a /path/to/file/b
2107 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
2108 The following command adds two mirrored disks to the pool
2110 assuming the pool is already made up of two-way mirrors.
2111 The additional space is immediately available to any datasets within the pool.
2113 # zpool add tank mirror sda sdb
2115 .It Sy Example 6 No Listing Available ZFS Storage Pools
2116 The following command lists all available pools on the system.
2117 In this case, the pool
2119 is faulted due to a missing device.
2120 The results from this command are similar to the following:
2123 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2124 rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE -
2125 tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE -
2126 zion - - - - - - - FAULTED -
2128 .It Sy Example 7 No Destroying a ZFS Storage Pool
2129 The following command destroys the pool
2131 and any datasets contained within.
2133 # zpool destroy -f tank
2135 .It Sy Example 8 No Exporting a ZFS Storage Pool
2136 The following command exports the devices in pool
2138 so that they can be relocated or later imported.
2142 .It Sy Example 9 No Importing a ZFS Storage Pool
2143 The following command displays available pools, and then imports the pool
2145 for use on the system.
2146 The results from this command are similar to the following:
2150 id: 15451357997522795478
2152 action: The pool can be imported using its name or numeric identifier.
2162 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
2163 The following command upgrades all ZFS Storage pools to the current version of
2167 This system is currently running ZFS version 2.
2169 .It Sy Example 11 No Managing Hot Spares
2170 The following command creates a new pool with an available hot spare:
2172 # zpool create tank mirror sda sdb spare sdc
2175 If one of the disks were to fail, the pool would be reduced to the degraded
2177 The failed device can be replaced using the following command:
2179 # zpool replace tank sda sdd
2182 Once the data has been resilvered, the spare is automatically removed and is
2183 made available for use should another device fail.
2184 The hot spare can be permanently removed from the pool using the following
2187 # zpool remove tank sdc
2189 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
2190 The following command creates a ZFS storage pool consisting of two, two-way
2191 mirrors and mirrored log devices:
2193 # zpool create pool mirror sda sdb mirror sdc sdd log mirror \\
2196 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
2197 The following command adds two disks for use as cache devices to a ZFS storage
2200 # zpool add pool cache sdc sdd
2203 Once added, the cache devices gradually fill with content from main memory.
2204 Depending on the size of your cache devices, it could take over an hour for
2206 Capacity and reads can be monitored using the
2210 # zpool iostat -v pool 5
2212 .It Sy Example 14 No Removing a Mirrored Log Device
2213 The following command removes the mirrored log device
2215 Given this configuration:
2219 scrub: none requested
2222 NAME STATE READ WRITE CKSUM
2224 mirror-0 ONLINE 0 0 0
2227 mirror-1 ONLINE 0 0 0
2231 mirror-2 ONLINE 0 0 0
2236 The command to remove the mirrored log
2240 # zpool remove tank mirror-2
2242 .It Sy Example 15 No Displaying expanded space on a device
2243 The following command displays the detailed information for the pool
2245 This pool is comprised of a single raidz vdev where one of its devices
2246 increased its capacity by 10GB.
2247 In this example, the pool will not be able to utilize this extra capacity until
2248 all the devices under the raidz vdev have been expanded.
2250 # zpool list -v data
2251 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2252 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
2253 raidz1 23.9G 14.6G 9.30G 48% -
2258 .It Sy Example 16 No Adding output columns
2259 Additional columns can be added to the
2267 # zpool status -c vendor,model,size
2268 NAME STATE READ WRITE CKSUM vendor model size
2270 mirror-0 ONLINE 0 0 0
2271 U1 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2272 U10 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2273 U11 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2274 U12 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2275 U13 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2276 U14 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2278 # zpool iostat -vc slaves
2279 capacity operations bandwidth
2280 pool alloc free read write read write slaves
2281 ---------- ----- ----- ----- ----- ----- ----- ---------
2282 tank 20.4G 7.23T 26 152 20.7M 21.6M
2283 mirror 20.4G 7.23T 26 152 20.7M 21.6M
2284 U1 - - 0 31 1.46K 20.6M sdb sdff
2285 U10 - - 0 1 3.77K 13.3K sdas sdgw
2286 U11 - - 0 1 288K 13.3K sdat sdgx
2287 U12 - - 0 1 78.4K 13.3K sdau sdgy
2288 U13 - - 0 1 128K 13.3K sdav sdgz
2289 U14 - - 0 1 63.2K 13.3K sdfk sdg
2292 .Sh ENVIRONMENT VARIABLES
2293 .Bl -tag -width "ZFS_ABORT"
2297 to dump core on exit for the purposes of running
2300 .Bl -tag -width "ZPOOL_IMPORT_PATH"
2301 .It Ev ZPOOL_IMPORT_PATH
2302 The search path for devices or files to use with the pool. This is a colon-separated list of directories in which
2304 looks for device nodes and files.
2310 .Bl -tag -width "ZPOOL_VDEV_NAME_GUID"
2311 .It Ev ZPOOL_VDEV_NAME_GUID
2313 .Nm zpool subcommands to output vdev guids by default. This behavior
2316 command line option.
2318 .Bl -tag -width "ZPOOL_VDEV_NAME_FOLLOW_LINKS"
2319 .It Ev ZPOOL_VDEV_NAME_FOLLOW_LINKS
2322 subcommands to follow links for vdev names by default. This behavior is identical to the
2324 command line option.
2326 .Bl -tag -width "ZPOOL_VDEV_NAME_PATH"
2327 .It Ev ZPOOL_VDEV_NAME_PATH
2330 subcommands to output full vdev path names by default. This
2331 behavior is identical to the
2333 command line option.
2335 .Bl -tag -width "ZFS_VDEV_DEVID_OPT_OUT"
2336 .It Ev ZFS_VDEV_DEVID_OPT_OUT
2337 Older ZFS on Linux implementations had issues when attempting to display pool
2338 config VDEV names if a
2340 NVP value is present in the pool's config.
2342 For example, a pool that originated on illumos platform would have a devid
2343 value in the config and
2345 would fail when listing the config.
2346 This would also be true for future Linux based pools.
2348 A pool can be stripped of any
2350 values on import or prevented from adding
2356 .Sy ZFS_VDEV_DEVID_OPT_OUT .
2358 .Bl -tag -width "ZPOOL_SCRIPTS_AS_ROOT"
2359 .It Ev ZPOOL_SCRIPTS_AS_ROOT
2360 Allow a privileged user to run the
2361 .Nm zpool status/iostat
2364 option. Normally, only unprivileged users are allowed to run
2367 .Bl -tag -width "ZPOOL_SCRIPTS_PATH"
2368 .It Ev ZPOOL_SCRIPTS_PATH
2369 The search path for scripts when running
2370 .Nm zpool status/iostat
2373 option. This is a colon-separated list of directories and overrides the default
2376 .Pa /etc/zfs/zpool.d
2379 .Bl -tag -width "ZPOOL_SCRIPTS_ENABLED"
2380 .It Ev ZPOOL_SCRIPTS_ENABLED
2382 .Nm zpool status/iostat
2386 .Sy ZPOOL_SCRIPTS_ENABLED
2387 is not set, it is assumed that the user is allowed to run
2388 .Nm zpool status/iostat -c .
2390 .Sh INTERFACE STABILITY
2394 .Xr zfs-module-parameters 5 ,
2395 .Xr zpool-features 5 ,