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, 2017 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
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 ...
71 .Op Fl vHf Oo Ar pool Oc | Fl c
80 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
81 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
90 .Op Fl d Ar dir Ns | Ns device
95 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
96 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
98 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
103 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
104 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
106 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
109 .Ar pool Ns | Ns Ar id
110 .Op Ar newpool Oo Fl t Oc
113 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
114 .Op Fl T Sy u Ns | Ns Sy d
116 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
117 .Op Ar interval Op Ar count
125 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
126 .Op Fl T Sy u Ns | Ns Sy d
127 .Oo Ar pool Oc Ns ...
128 .Op Ar interval Op Ar count
133 .Ar pool Ar device Ns ...
137 .Ar pool Ar device Ns ...
148 .Ar pool Ar device Ns ...
156 .Oo Fl o Ar property Ns = Ns Ar value Oc
157 .Ar pool Ar device Op Ar new_device
164 .Ar property Ns = Ns Ar value
169 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
172 .Oo Ar device Oc Ns ...
175 .Oo Fl c Ar SCRIPT Oc
177 .Op Fl T Sy u Ns | Ns Sy d
178 .Oo Ar pool Oc Ns ...
179 .Op Ar interval Op Ar count
182 .Oo Ar pool Oc Ns ...
191 .Fl a Ns | Ns Ar pool Ns ...
195 command configures ZFS storage pools.
196 A storage pool is a collection of devices that provides physical storage and
197 data replication for ZFS datasets.
198 All datasets within a storage pool share the same space.
201 for information on managing datasets.
202 .Ss Virtual Devices (vdevs)
203 A "virtual device" describes a single device or a collection of devices
204 organized according to certain performance and fault characteristics.
205 The following virtual devices are supported:
208 A block device, typically located under
210 ZFS can use individual slices or partitions, though the recommended mode of
211 operation is to use whole disks.
212 A disk can be specified by a full path, or it can be a shorthand name
213 .Po the relative portion of the path under
216 A whole disk can be specified by omitting the slice or partition designation.
221 When given a whole disk, ZFS automatically labels the disk, if necessary.
224 The use of files as a backing store is strongly discouraged.
225 It is designed primarily for experimental purposes, as the fault tolerance of a
226 file is only as good as the file system of which it is a part.
227 A file must be specified by a full path.
229 A mirror of two or more devices.
230 Data is replicated in an identical fashion across all components of a mirror.
231 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
232 failing before data integrity is compromised.
233 .It Sy raidz , raidz1 , raidz2 , raidz3
234 A variation on RAID-5 that allows for better distribution of parity and
235 eliminates the RAID-5
237 .Pq in which data and parity become inconsistent after a power loss .
238 Data and parity is striped across all disks within a raidz group.
240 A raidz group can have single-, double-, or triple-parity, meaning that the
241 raidz group can sustain one, two, or three failures, respectively, without
245 vdev type specifies a single-parity raidz group; the
247 vdev type specifies a double-parity raidz group; and the
249 vdev type specifies a triple-parity raidz group.
252 vdev type is an alias for
255 A raidz group with N disks of size X with P parity disks can hold approximately
256 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
258 The minimum number of devices in a raidz group is one more than the number of
260 The recommended number is between 3 and 9 to help increase performance.
262 A special pseudo-vdev which keeps track of available hot spares for a pool.
263 For more information, see the
267 A separate intent log device.
268 If more than one log device is specified, then writes are load-balanced between
270 Log devices can be mirrored.
271 However, raidz vdev types are not supported for the intent log.
272 For more information, see the
276 A device used to cache storage pool data.
277 A cache device cannot be configured as a mirror or raidz group.
278 For more information, see the
283 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
284 contain files or disks.
286 .Pq or other combinations
289 A pool can have any number of virtual devices at the top of the configuration
293 Data is dynamically distributed across all top-level devices to balance data
295 As new virtual devices are added, ZFS automatically places data on the newly
298 Virtual devices are specified one at a time on the command line, separated by
304 are used to distinguish where a group ends and another begins.
305 For example, the following creates two root vdevs, each a mirror of two disks:
307 # zpool create mypool mirror sda sdb mirror sdc sdd
309 .Ss Device Failure and Recovery
310 ZFS supports a rich set of mechanisms for handling device failure and data
312 All metadata and data is checksummed, and ZFS automatically repairs bad data
313 from a good copy when corruption is detected.
315 In order to take advantage of these features, a pool must make use of some form
316 of redundancy, using either mirrored or raidz groups.
317 While ZFS supports running in a non-redundant configuration, where each root
318 vdev is simply a disk or file, this is strongly discouraged.
319 A single case of bit corruption can render some or all of your data unavailable.
321 A pool's health status is described by one of three states: online, degraded,
323 An online pool has all devices operating normally.
324 A degraded pool is one in which one or more devices have failed, but the data is
325 still available due to a redundant configuration.
326 A faulted pool has corrupted metadata, or one or more faulted devices, and
327 insufficient replicas to continue functioning.
329 The health of the top-level vdev, such as mirror or raidz device, is
330 potentially impacted by the state of its associated vdevs, or component
332 A top-level vdev or component device is in one of the following states:
333 .Bl -tag -width "DEGRADED"
335 One or more top-level vdevs is in the degraded state because one or more
336 component devices are offline.
337 Sufficient replicas exist to continue functioning.
339 One or more component devices is in the degraded or faulted state, but
340 sufficient replicas exist to continue functioning.
341 The underlying conditions are as follows:
344 The number of checksum errors exceeds acceptable levels and the device is
345 degraded as an indication that something may be wrong.
346 ZFS continues to use the device as necessary.
348 The number of I/O errors exceeds acceptable levels.
349 The device could not be marked as faulted because there are insufficient
350 replicas to continue functioning.
353 One or more top-level vdevs is in the faulted state because one or more
354 component devices are offline.
355 Insufficient replicas exist to continue functioning.
357 One or more component devices is in the faulted state, and insufficient
358 replicas exist to continue functioning.
359 The underlying conditions are as follows:
362 The device could be opened, but the contents did not match expected values.
364 The number of I/O errors exceeds acceptable levels and the device is faulted to
365 prevent further use of the device.
368 The device was explicitly taken offline by the
372 The device is online and functioning.
374 The device was physically removed while the system was running.
375 Device removal detection is hardware-dependent and may not be supported on all
378 The device could not be opened.
379 If a pool is imported when a device was unavailable, then the device will be
380 identified by a unique identifier instead of its path since the path was never
381 correct in the first place.
384 If a device is removed and later re-attached to the system, ZFS attempts
385 to put the device online automatically.
386 Device attach detection is hardware-dependent and might not be supported on all
389 ZFS allows devices to be associated with pools as
391 These devices are not actively used in the pool, but when an active device
392 fails, it is automatically replaced by a hot spare.
393 To create a pool with hot spares, specify a
395 vdev with any number of devices.
398 # zpool create pool mirror sda sdb spare sdc sdd
401 Spares can be shared across multiple pools, and can be added with the
403 command and removed with the
406 Once a spare replacement is initiated, a new
408 vdev is created within the configuration that will remain there until the
409 original device is replaced.
410 At this point, the hot spare becomes available again if another device fails.
412 If a pool has a shared spare that is currently being used, the pool can not be
413 exported since other pools may use this shared spare, which may lead to
414 potential data corruption.
416 An in-progress spare replacement can be cancelled by detaching the hot spare.
417 If the original faulted device is detached, then the hot spare assumes its
418 place in the configuration, and is removed from the spare list of all active
421 Spares cannot replace log devices.
423 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
425 For instance, databases often require their transactions to be on stable storage
426 devices when returning from a system call.
427 NFS and other applications can also use
429 to ensure data stability.
430 By default, the intent log is allocated from blocks within the main pool.
431 However, it might be possible to get better performance using separate intent
432 log devices such as NVRAM or a dedicated disk.
435 # zpool create pool sda sdb log sdc
438 Multiple log devices can also be specified, and they can be mirrored.
441 section for an example of mirroring multiple log devices.
443 Log devices can be added, replaced, attached, detached and removed. In
444 addition, log devices are imported and exported as part of the pool
446 Mirrored devices can be removed by specifying the top-level mirror vdev.
448 Devices can be added to a storage pool as
450 These devices provide an additional layer of caching between main memory and
452 For read-heavy workloads, where the working set size is much larger than what
453 can be cached in main memory, using cache devices allow much more of this
454 working set to be served from low latency media.
455 Using cache devices provides the greatest performance improvement for random
456 read-workloads of mostly static content.
458 To create a pool with cache devices, specify a
460 vdev with any number of devices.
463 # zpool create pool sda sdb cache sdc sdd
466 Cache devices cannot be mirrored or part of a raidz configuration.
467 If a read error is encountered on a cache device, that read I/O is reissued to
468 the original storage pool device, which might be part of a mirrored or raidz
471 The content of the cache devices is considered volatile, as is the case with
474 Each pool has several properties associated with it.
475 Some properties are read-only statistics while others are configurable and
476 change the behavior of the pool.
478 The following are read-only properties:
481 Amount of storage used within the pool.
483 Percentage of pool space used.
484 This property can also be referred to by its shortened column name,
487 Amount of uninitialized space within the pool or device that can be used to
488 increase the total capacity of the pool.
489 Uninitialized space consists of any space on an EFI labeled vdev which has not
492 .Nm zpool Cm online Fl e
494 This space occurs when a LUN is dynamically expanded.
496 The amount of fragmentation in the pool.
498 The amount of free space available in the pool.
500 After a file system or snapshot is destroyed, the space it was using is
501 returned to the pool asynchronously.
503 is the amount of space remaining to be reclaimed.
510 The current health of the pool.
512 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
514 A unique identifier for the pool.
516 Total size of the storage pool.
517 .It Sy unsupported@ Ns Em feature_guid
518 Information about unsupported features that are enabled on 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-parameters 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
811 .It Fl o Ar property Ns = Ns Ar value
812 Sets the given pool properties. See the
814 section for a list of valid properties that can be set. The only property
815 supported at the moment is ashift.
821 .Oo Fl o Ar property Ns = Ns Ar value Oc
822 .Ar pool device new_device
828 The existing device cannot be part of a raidz configuration.
831 is not currently part of a mirrored configuration,
833 automatically transforms into a two-way mirror of
839 is part of a two-way mirror, attaching
841 creates a three-way mirror, and so on.
844 begins to resilver immediately.
849 even if its appears to be in use.
850 Not all devices can be overridden in this manner.
851 .It Fl o Ar property Ns = Ns Ar value
852 Sets the given pool properties. See the
854 section for a list of valid properties that can be set. The only property
855 supported at the moment is ashift.
863 Clears device errors in a pool.
864 If no arguments are specified, all device errors within the pool are cleared.
865 If one or more devices is specified, only those errors associated with the
866 specified device or devices are cleared.
871 .Op Fl m Ar mountpoint
872 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
873 .Oo Fl o Ar feature@feature Ns = Ns Ar value Oc Ns ...
874 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
879 Creates a new storage pool containing the virtual devices specified on the
881 The pool name must begin with a letter, and can only contain
882 alphanumeric characters as well as underscore
898 are reserved, as are names beginning with
906 specification is described in the
910 The command verifies that each device specified is accessible and not currently
911 in use by another subsystem.
912 There are some uses, such as being currently mounted, or specified as the
913 dedicated dump device, that prevents a device from ever being used by ZFS.
914 Other uses, such as having a preexisting UFS file system, can be overridden with
919 The command also checks that the replication strategy for the pool is
921 An attempt to combine redundant and non-redundant storage in a single pool, or
922 to mix disks and files, results in an error unless
925 The use of differently sized devices within a single raidz or mirror group is
926 also flagged as an error unless
932 option is specified, the default mount point is
934 The mount point must not exist or must be empty, or else the root dataset
936 This can be overridden with the
940 By default all supported features are enabled on the new pool unless the
945 Do not enable any features on the new pool.
946 Individual features can be enabled by setting their corresponding properties to
953 for details about feature properties.
957 even if they appear in use or specify a conflicting replication level.
958 Not all devices can be overridden in this manner.
959 .It Fl m Ar mountpoint
960 Sets the mount point for the root dataset.
961 The default mount point is
968 The mount point must be an absolute path,
972 For more information on dataset mount points, see
975 Displays the configuration that would be used without actually creating the
977 The actual pool creation can still fail due to insufficient privileges or
979 .It Fl o Ar property Ns = Ns Ar value
980 Sets the given pool properties.
983 section for a list of valid properties that can be set.
984 .It Fl o Ar feature@feature Ns = Ns Ar value
985 Sets the given pool feature. See the
987 section for a list of valid features that can be set.
988 Value can be either disabled or enabled.
989 .It Fl O Ar file-system-property Ns = Ns Ar value
990 Sets the given file system properties in the root file system of the pool.
995 for a list of valid properties that can be set.
998 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
1000 Sets the in-core pool name to
1002 while the on-disk name will be the name specified as the pool name
1004 This will set the default cachefile property to none. This is intended
1005 to handle name space collisions when creating pools for other systems,
1006 such as virtual machines or physical machines whose pools live on network
1015 Destroys the given pool, freeing up any devices for other use.
1016 This command tries to unmount any active datasets before destroying the pool.
1019 Forces any active datasets contained within the pool to be unmounted.
1029 The operation is refused if there are no other valid replicas of the data.
1030 If device may be re-added to the pool later on then consider the
1036 .Op Fl vHf Oo Ar pool Oc | Fl c
1038 Lists all recent events generated by the ZFS kernel modules. These events
1041 and used to automate administrative tasks such as replacing a failed device
1042 with a hot spare. For more information about the subclasses and event payloads
1043 that can be generated see the
1048 Clear all previous events.
1052 Scripted mode. Do not display headers, and separate fields by a
1053 single tab instead of arbitrary space.
1055 Print the entire payload for each event.
1064 Exports the given pools from the system.
1065 All devices are marked as exported, but are still considered in use by other
1067 The devices can be moved between systems
1068 .Pq even those of different endianness
1069 and imported as long as a sufficient number of devices are present.
1071 Before exporting the pool, all datasets within the pool are unmounted.
1072 A pool can not be exported if it has a shared spare that is currently being
1075 For pools to be portable, you must give the
1077 command whole disks, not just partitions, so that ZFS can label the disks with
1078 portable EFI labels.
1079 Otherwise, disk drivers on platforms of different endianness will not recognize
1083 Exports all pools imported on the system.
1085 Forcefully unmount all datasets, using the
1089 This command will forcefully export the pool even if it has a shared spare that
1090 is currently being used.
1091 This may lead to potential data corruption.
1097 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1098 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1101 Retrieves the given list of properties
1103 or all properties if
1107 for the specified storage pool(s).
1108 These properties are displayed with the following fields:
1110 name Name of storage pool
1111 property Property name
1112 value Property value
1113 source Property source, either 'default' or 'local'.
1118 section for more information on the available pool properties.
1122 Do not display headers, and separate fields by a single tab instead of arbitrary
1125 A comma-separated list of columns to display.
1126 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
1127 is the default value.
1129 Display numbers in parsable (exact) values.
1135 .Oo Ar pool Oc Ns ...
1137 Displays the command history of the specified pool(s) or all pools if no pool is
1141 Displays internally logged ZFS events in addition to user initiated events.
1143 Displays log records in long format, which in addition to standard format
1144 includes, the user name, the hostname, and the zone in which the operation was
1151 .Op Fl d Ar dir Ns | Ns device
1153 Lists pools available to import.
1156 option is not specified, this command searches for devices in
1160 option can be specified multiple times, and all directories are searched.
1161 If the device appears to be part of an exported pool, this command displays a
1162 summary of the pool with the name of the pool, a numeric identifier, as well as
1163 the vdev layout and current health of the device for each device or file.
1164 Destroyed pools, pools that were previously destroyed with the
1165 .Nm zpool Cm destroy
1166 command, are not listed unless the
1168 option is specified.
1170 The numeric identifier is unique, and can be used instead of the pool name when
1171 multiple exported pools of the same name are available.
1173 .It Fl c Ar cachefile
1174 Reads configuration from the given
1176 that was created with the
1181 is used instead of searching for devices.
1182 .It Fl d Ar dir Ns | Ns Ar device
1185 or searches for devices or files in
1189 option can be specified multiple times.
1191 Lists destroyed pools only.
1198 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
1199 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
1201 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1205 Imports all pools found in the search directories.
1206 Identical to the previous command, except that all pools with a sufficient
1207 number of devices available are imported.
1208 Destroyed pools, pools that were previously destroyed with the
1209 .Nm zpool Cm destroy
1210 command, will not be imported unless the
1212 option is specified.
1215 Searches for and imports all pools found.
1216 .It Fl c Ar cachefile
1217 Reads configuration from the given
1219 that was created with the
1224 is used instead of searching for devices.
1225 .It Fl d Ar dir Ns | Ns Ar device
1228 or searches for devices or files in
1232 option can be specified multiple times.
1233 This option is incompatible with the
1237 Imports destroyed pools only.
1240 option is also required.
1242 Forces import, even if the pool appears to be potentially active.
1244 Recovery mode for a non-importable pool.
1245 Attempt to return the pool to an importable state by discarding the last few
1247 Not all damaged pools can be recovered by using this option.
1248 If successful, the data from the discarded transactions is irretrievably lost.
1249 This option is ignored if the pool is importable or already imported.
1251 Indicates that this command will request encryption keys for all encrypted
1252 datasets it attempts to mount as it is bringing the pool online. Note that if
1257 this command will block waiting for the keys to be entered. Without this flag
1258 encrypted datasets will be left unavailable until the keys are loaded.
1260 Allows a pool to import when there is a missing log device.
1261 Recent transactions can be lost because the log device will be discarded.
1266 Determines whether a non-importable pool can be made importable again, but does
1267 not actually perform the pool recovery.
1268 For more details about pool recovery mode, see the
1272 Import the pool without mounting any file systems.
1274 Comma-separated list of mount options to use when mounting datasets within the
1278 for a description of dataset properties and mount options.
1279 .It Fl o Ar property Ns = Ns Ar value
1280 Sets the specified property on the imported pool.
1283 section for more information on the available pool properties.
1294 Scan using the default search path, the libblkid cache will not be
1295 consulted. A custom search path may be specified by setting the
1296 ZPOOL_IMPORT_PATH environment variable.
1300 recovery option. Determines whether extreme
1301 measures to find a valid txg should take place. This allows the pool to
1302 be rolled back to a txg which is no longer guaranteed to be consistent.
1303 Pools imported at an inconsistent txg may contain uncorrectable
1304 checksum errors. For more details about pool recovery mode, see the
1306 option, above. WARNING: This option can be extremely hazardous to the
1307 health of your pool and should only be used as a last resort.
1309 Specify the txg to use for rollback. Implies
1312 about pool recovery mode, see the
1314 option, above. WARNING: This option can be extremely hazardous to the
1315 health of your pool and should only be used as a last resort.
1321 .Op Fl F Oo Fl n Oc Oo Fl t Oc Oo Fl T Oc Oo Fl X Oc
1322 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
1324 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1327 .Ar pool Ns | Ns Ar id
1330 Imports a specific pool.
1331 A pool can be identified by its name or the numeric identifier.
1334 is specified, the pool is imported using the name
1336 Otherwise, it is imported with the same name as its exported name.
1338 If a device is removed from a system without running
1340 first, the device appears as potentially active.
1341 It cannot be determined if this was a failed export, or whether the device is
1342 really in use from another host.
1343 To import a pool in this state, the
1347 .It Fl c Ar cachefile
1348 Reads configuration from the given
1350 that was created with the
1355 is used instead of searching for devices.
1356 .It Fl d Ar dir Ns | Ns Ar device
1359 or searches for devices or files in
1363 option can be specified multiple times.
1364 This option is incompatible with the
1368 Imports destroyed pool.
1371 option is also required.
1373 Forces import, even if the pool appears to be potentially active.
1375 Recovery mode for a non-importable pool.
1376 Attempt to return the pool to an importable state by discarding the last few
1378 Not all damaged pools can be recovered by using this option.
1379 If successful, the data from the discarded transactions is irretrievably lost.
1380 This option is ignored if the pool is importable or already imported.
1382 Indicates that this command will request encryption keys for all encrypted
1383 datasets it attempts to mount as it is bringing the pool online. Note that if
1388 this command will block waiting for the keys to be entered. Without this flag
1389 encrypted datasets will be left unavailable until the keys are loaded.
1391 Allows a pool to import when there is a missing log device.
1392 Recent transactions can be lost because the log device will be discarded.
1397 Determines whether a non-importable pool can be made importable again, but does
1398 not actually perform the pool recovery.
1399 For more details about pool recovery mode, see the
1403 Comma-separated list of mount options to use when mounting datasets within the
1407 for a description of dataset properties and mount options.
1408 .It Fl o Ar property Ns = Ns Ar value
1409 Sets the specified property on the imported pool.
1412 section for more information on the available pool properties.
1423 Scan using the default search path, the libblkid cache will not be
1424 consulted. A custom search path may be specified by setting the
1425 ZPOOL_IMPORT_PATH environment variable.
1429 recovery option. Determines whether extreme
1430 measures to find a valid txg should take place. This allows the pool to
1431 be rolled back to a txg which is no longer guaranteed to be consistent.
1432 Pools imported at an inconsistent txg may contain uncorrectable
1433 checksum errors. For more details about pool recovery mode, see the
1435 option, above. WARNING: This option can be extremely hazardous to the
1436 health of your pool and should only be used as a last resort.
1438 Specify the txg to use for rollback. Implies
1441 about pool recovery mode, see the
1443 option, above. WARNING: This option can be extremely hazardous to the
1444 health of your pool and should only be used as a last resort.
1450 is temporary. Temporary pool names last until export. Ensures that
1451 the original pool name will be used in all label updates and therefore
1452 is retained upon export.
1453 Will also set -o cachefile=none when not explicitly specified.
1458 .Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
1459 .Op Fl T Sy u Ns | Ns Sy d
1461 .Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
1462 .Op Ar interval Op Ar count
1464 Displays I/O statistics for the given pools/vdevs. You can pass in a
1465 list of pools, a pool and list of vdevs in that pool, or a list of any
1466 vdevs from any pool. If no items are specified, statistics for every
1467 pool in the system are shown.
1470 the statistics are printed every
1472 seconds until ^C is pressed. If count is specified, the command exits
1473 after count reports are printed. The first report printed is always
1474 the statistics since boot regardless of whether
1478 are passed. However, this behavior can be suppressed with the
1480 flag. Also note that the units of
1484 that are printed in the report are in base 1024. To get the raw
1489 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1490 Run a script (or scripts) on each vdev and include the output as a new column
1493 output. Users can run any script found in their
1495 directory or from the system
1496 .Pa /etc/zfs/zpool.d
1497 directory. Script names containing the slash (/) character are not allowed.
1498 The default search path can be overridden by setting the
1499 ZPOOL_SCRIPTS_PATH environment variable. A privileged user can run
1501 if they have the ZPOOL_SCRIPTS_AS_ROOT
1502 environment variable set. If a script requires the use of a privileged
1505 then it's recommended you allow the user access to it in
1507 or add the user to the
1508 .Pa /etc/sudoers.d/zfs
1513 is passed without a script name, it prints a list of all scripts.
1515 also sets verbose mode
1516 .No \&( Ns Fl v Ns No \&).
1518 Script output should be in the form of "name=value". The column name is
1519 set to "name" and the value is set to "value". Multiple lines can be
1520 used to output multiple columns. The first line of output not in the
1521 "name=value" format is displayed without a column title, and no more
1522 output after that is displayed. This can be useful for printing error
1523 messages. Blank or NULL values are printed as a '-' to make output
1526 The following environment variables are set before running each script:
1527 .Bl -tag -width "VDEV_PATH"
1529 Full path to the vdev
1531 .Bl -tag -width "VDEV_UPATH"
1533 Underlying path to the vdev (/dev/sd*). For use with device mapper,
1534 multipath, or partitioned vdevs.
1536 .Bl -tag -width "VDEV_ENC_SYSFS_PATH"
1537 .It Sy VDEV_ENC_SYSFS_PATH
1538 The sysfs path to the enclosure for the vdev (if any).
1540 .It Fl T Sy u Ns | Ns Sy d
1541 Display a time stamp.
1544 for a printed representation of the internal representation of time.
1549 for standard date format.
1553 Display vdev GUIDs instead of the normal device names. These GUIDs
1554 can be used in place of device names for the zpool
1555 detach/offline/remove/replace commands.
1557 Scripted mode. Do not display headers, and separate fields by a
1558 single tab instead of arbitrary space.
1560 Display real paths for vdevs resolving all symbolic links. This can
1561 be used to look up the current block device name regardless of the
1563 path used to open it.
1565 Display numbers in parsable (exact) values. Time values are in
1568 Display full paths for vdevs instead of only the last component of
1569 the path. This can be used in conjunction with the
1573 Print request size histograms for the leaf ZIOs. This includes
1574 histograms of individual ZIOs (
1576 and aggregate ZIOs (
1578 These stats can be useful for seeing how well the ZFS IO aggregator is
1579 working. Do not confuse these request size stats with the block layer
1580 requests; it's possible ZIOs can be broken up before being sent to the
1583 Verbose statistics Reports usage statistics for individual vdevs within the
1584 pool, in addition to the pool-wide statistics.
1586 Omit statistics since boot.
1587 Normally the first line of output reports the statistics since boot.
1588 This option suppresses that first line of output.
1590 Display latency histograms:
1593 Total IO time (queuing + disk IO time).
1595 Disk IO time (time reading/writing the disk).
1597 Amount of time IO spent in synchronous priority queues. Does not include
1600 Amount of time IO spent in asynchronous priority queues. Does not include
1603 Amount of time IO spent in scrub queue. Does not include disk time.
1605 Include average latency statistics:
1608 Average total IO time (queuing + disk IO time).
1610 Average disk IO time (time reading/writing the disk).
1612 Average amount of time IO spent in synchronous priority queues. Does
1613 not include disk time.
1615 Average amount of time IO spent in asynchronous priority queues.
1616 Does not include disk time.
1618 Average queuing time in scrub queue. Does not include disk time.
1620 Include active queue statistics. Each priority queue has both
1625 IOs. Pending IOs are waiting to
1626 be issued to the disk, and active IOs have been issued to disk and are
1627 waiting for completion. These stats are broken out by priority queue:
1629 .Ar syncq_read/write :
1630 Current number of entries in synchronous priority
1632 .Ar asyncq_read/write :
1633 Current number of entries in asynchronous priority queues.
1635 Current number of entries in scrub queue.
1637 All queue statistics are instantaneous measurements of the number of
1638 entries in the queues. If you specify an interval, the measurements
1639 will be sampled from the end of the interval.
1647 Removes ZFS label information from the specified
1651 must not be part of an active pool configuration.
1654 Treat exported or foreign devices as inactive.
1660 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1661 .Op Fl T Sy u Ns | Ns Sy d
1662 .Oo Ar pool Oc Ns ...
1663 .Op Ar interval Op Ar count
1665 Lists the given pools along with a health status and space usage.
1668 are specified, all pools in the system are listed.
1671 the information is printed every
1673 seconds until ^C is pressed.
1676 is specified, the command exits after
1678 reports are printed.
1681 Display vdev GUIDs instead of the normal device names. These GUIDs
1682 can be used in place of device names for the zpool
1683 detach/offline/remove/replace commands.
1686 Do not display headers, and separate fields by a single tab instead of arbitrary
1688 .It Fl o Ar property
1689 Comma-separated list of properties to display.
1692 section for a list of valid properties.
1694 .Cm name , size , allocated , free , expandsize , fragmentation , capacity ,
1695 .Cm dedupratio , health , altroot .
1697 Display real paths for vdevs resolving all symbolic links. This can
1698 be used to look up the current block device name regardless of the
1699 /dev/disk/ path used to open it.
1701 Display numbers in parsable
1705 Display full paths for vdevs instead of only the last component of
1706 the path. This can be used in conjunction with the
1709 .It Fl T Sy u Ns | Ns Sy d
1710 Display a time stamp.
1713 for a printed representation of the internal representation of time.
1718 for standard date format.
1723 Reports usage statistics for individual vdevs within the pool, in addition to
1724 the pool-wise statistics.
1731 .Ar pool Ar device Ns ...
1733 Takes the specified physical device offline.
1736 is offline, no attempt is made to read or write to the device.
1737 This command is not applicable to spares.
1740 Force fault. Instead of offlining the disk, put it into a faulted
1741 state. The fault will persist across imports unless the
1746 Upon reboot, the specified physical device reverts to its previous state.
1752 .Ar pool Ar device Ns ...
1754 Brings the specified physical device online.
1755 This command is not applicable to spares.
1758 Expand the device to use all available space.
1759 If the device is part of a mirror or raidz then all devices must be expanded
1760 before the new space will become available to the pool.
1767 Generates a new unique identifier for the pool.
1768 You must ensure that all devices in this pool are online and healthy before
1769 performing this action.
1776 Reopen all the vdevs associated with the pool.
1779 Do not restart an in-progress scrub operation. This is not recommended and can
1780 result in partially resilvered devices unless a second scrub is performed.
1786 .Ar pool Ar device Ns ...
1788 Removes the specified device from the pool.
1789 This command currently only supports removing hot spares, cache, log
1790 devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
1792 Removing a top-level vdev reduces the total amount of space in the storage pool.
1793 The specified device will be evacuated by copying all allocated space from it to
1794 the other devices in the pool.
1797 command initiates the removal and returns, while the evacuation continues in
1799 The removal progress can be monitored with
1800 .Nm zpool Cm status.
1801 This feature must be enabled to be used, see
1802 .Xr zpool-features 5
1804 A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
1806 Non-log devices or data devices that are part of a mirrored configuration can be removed using
1812 Do not actually perform the removal ("no-op").
1813 Instead, print the estimated amount of memory that will be used by the
1814 mapping table after the removal completes.
1815 This is nonzero only for top-level vdevs.
1819 Used in conjunction with the
1821 flag, displays numbers as parsable (exact) values.
1829 Stops and cancels an in-progress removal of a top-level vdev.
1834 .Op Fl o Ar property Ns = Ns Ar value
1835 .Ar pool Ar device Op Ar new_device
1841 This is equivalent to attaching
1843 waiting for it to resilver, and then detaching
1848 must be greater than or equal to the minimum size of all the devices in a mirror
1849 or raidz configuration.
1852 is required if the pool is not redundant.
1855 is not specified, it defaults to
1857 This form of replacement is useful after an existing disk has failed and has
1858 been physically replaced.
1859 In this case, the new disk may have the same
1861 path as the old device, even though it is actually a different disk.
1862 ZFS recognizes this.
1867 even if its appears to be in use.
1868 Not all devices can be overridden in this manner.
1869 .It Fl o Ar property Ns = Ns Ar value
1870 Sets the given pool properties. See the
1872 section for a list of valid properties that can be set.
1873 The only property supported at the moment is
1882 Begins a scrub or resumes a paused scrub.
1883 The scrub examines all data in the specified pools to verify that it checksums
1887 devices, ZFS automatically repairs any damage discovered during the scrub.
1890 command reports the progress of the scrub and summarizes the results of the
1891 scrub upon completion.
1893 Scrubbing and resilvering are very similar operations.
1894 The difference is that resilvering only examines data that ZFS knows to be out
1897 for example, when attaching a new device to a mirror or replacing an existing
1900 whereas scrubbing examines all data to discover silent errors due to hardware
1901 faults or disk failure.
1903 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1905 If a scrub is paused, the
1908 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1917 Scrub pause state and progress are periodically synced to disk.
1918 If the system is restarted or pool is exported during a paused scrub,
1919 even after import, scrub will remain paused until it is resumed.
1920 Once resumed the scrub will pick up from the place where it was last
1921 checkpointed to disk.
1922 To resume a paused scrub issue
1929 .Ar property Ns = Ns Ar value
1932 Sets the given property on the specified pool.
1935 section for more information on what properties can be set and acceptable
1941 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1952 must be mirrors and the pool must not be in the process of resilvering.
1953 At the time of the split,
1955 will be a replica of
1958 last device in each mirror is split from
1963 The optional device specification causes the specified device(s) to be
1966 and, should any devices remain unspecified,
1967 the last device in each mirror is used as would be by default.
1970 Display vdev GUIDs instead of the normal device names. These GUIDs
1971 can be used in place of device names for the zpool
1972 detach/offline/remove/replace commands.
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
1977 path used to open it.
1979 Indicates that this command will request encryption keys for all encrypted
1980 datasets it attempts to mount as it is bringing the new pool online. Note that
1981 if any datasets have a
1985 this command will block waiting for the keys to be entered. Without this flag
1986 encrypted datasets will be left unavailable until the keys are loaded.
1988 Do dry run, do not actually perform the split.
1989 Print out the expected configuration of
1992 Display full paths for vdevs instead of only the last component of
1993 the path. This can be used in conjunction with the
1996 .It Fl o Ar property Ns = Ns Ar value
1997 Sets the specified property for
2001 section for more information on the available pool properties.
2009 and automatically import it.
2014 .Op Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
2016 .Op Fl T Sy u Ns | Ns Sy d
2017 .Oo Ar pool Oc Ns ...
2018 .Op Ar interval Op Ar count
2020 Displays the detailed health status for the given pools.
2023 is specified, then the status of each pool in the system is displayed.
2024 For more information on pool and device health, see the
2025 .Sx Device Failure and Recovery
2028 If a scrub or resilver is in progress, this command reports the percentage done
2029 and the estimated time to completion.
2030 Both of these are only approximate, because the amount of data in the pool and
2031 the other workloads on the system can change.
2033 .It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
2034 Run a script (or scripts) on each vdev and include the output as a new column
2041 for complete details.
2043 Display vdev GUIDs instead of the normal device names. These GUIDs
2044 can be used in place of device names for the zpool
2045 detach/offline/remove/replace commands.
2047 Display real paths for vdevs resolving all symbolic links. This can
2048 be used to look up the current block device name regardless of the
2050 path used to open it.
2052 Display full paths for vdevs instead of only the last component of
2053 the path. This can be used in conjunction with the
2057 Display a histogram of deduplication statistics, showing the allocated
2058 .Pq physically present on disk
2060 .Pq logically referenced in the pool
2061 block counts and sizes by reference count.
2062 .It Fl T Sy u Ns | Ns Sy d
2063 Display a time stamp.
2066 for a printed representation of the internal representation of time.
2071 for standard date format.
2075 Displays verbose data error information, printing out a complete list of all
2076 data errors since the last complete pool scrub.
2078 Only display status for pools that are exhibiting errors or are otherwise
2080 Warnings about pools not using the latest on-disk format will not be included.
2087 This command forces all in-core dirty data to be written to the primary
2088 pool storage and not the ZIL. It will also update administrative
2089 information including quota reporting. Without arguments,
2091 will sync all pools on the system. Otherwise, it will sync only the
2097 Displays pools which do not have all supported features enabled and pools
2098 formatted using a legacy ZFS version number.
2099 These pools can continue to be used, but some features may not be available.
2101 .Nm zpool Cm upgrade Fl a
2102 to enable all features on all pools.
2108 Displays legacy ZFS versions supported by the current software.
2110 .Xr zpool-features 5
2111 for a description of feature flags features supported by the current software.
2116 .Fl a Ns | Ns Ar pool Ns ...
2118 Enables all supported features on the given pool.
2119 Once this is done, the pool will no longer be accessible on systems that do not
2120 support feature flags.
2123 for details on compatibility with systems that support feature flags, but do not
2124 support all features enabled on the pool.
2127 Enables all supported features on all pools.
2129 Upgrade to the specified legacy version.
2132 flag is specified, no features will be enabled on the pool.
2133 This option can only be used to increase the version number up to the last
2134 supported legacy version number.
2138 The following exit values are returned:
2141 Successful completion.
2145 Invalid command line options were specified.
2149 .It Sy Example 1 No Creating a RAID-Z Storage Pool
2150 The following command creates a pool with a single raidz root vdev that
2151 consists of six disks.
2153 # zpool create tank raidz sda sdb sdc sdd sde sdf
2155 .It Sy Example 2 No Creating a Mirrored Storage Pool
2156 The following command creates a pool with two mirrors, where each mirror
2159 # zpool create tank mirror sda sdb mirror sdc sdd
2161 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Partitions
2162 The following command creates an unmirrored pool using two disk partitions.
2164 # zpool create tank sda1 sdb2
2166 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
2167 The following command creates an unmirrored pool using files.
2168 While not recommended, a pool based on files can be useful for experimental
2171 # zpool create tank /path/to/file/a /path/to/file/b
2173 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
2174 The following command adds two mirrored disks to the pool
2176 assuming the pool is already made up of two-way mirrors.
2177 The additional space is immediately available to any datasets within the pool.
2179 # zpool add tank mirror sda sdb
2181 .It Sy Example 6 No Listing Available ZFS Storage Pools
2182 The following command lists all available pools on the system.
2183 In this case, the pool
2185 is faulted due to a missing device.
2186 The results from this command are similar to the following:
2189 NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2190 rpool 19.9G 8.43G 11.4G - 33% 42% 1.00x ONLINE -
2191 tank 61.5G 20.0G 41.5G - 48% 32% 1.00x ONLINE -
2192 zion - - - - - - - FAULTED -
2194 .It Sy Example 7 No Destroying a ZFS Storage Pool
2195 The following command destroys the pool
2197 and any datasets contained within.
2199 # zpool destroy -f tank
2201 .It Sy Example 8 No Exporting a ZFS Storage Pool
2202 The following command exports the devices in pool
2204 so that they can be relocated or later imported.
2208 .It Sy Example 9 No Importing a ZFS Storage Pool
2209 The following command displays available pools, and then imports the pool
2211 for use on the system.
2212 The results from this command are similar to the following:
2216 id: 15451357997522795478
2218 action: The pool can be imported using its name or numeric identifier.
2228 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
2229 The following command upgrades all ZFS Storage pools to the current version of
2233 This system is currently running ZFS version 2.
2235 .It Sy Example 11 No Managing Hot Spares
2236 The following command creates a new pool with an available hot spare:
2238 # zpool create tank mirror sda sdb spare sdc
2241 If one of the disks were to fail, the pool would be reduced to the degraded
2243 The failed device can be replaced using the following command:
2245 # zpool replace tank sda sdd
2248 Once the data has been resilvered, the spare is automatically removed and is
2249 made available for use should another device fail.
2250 The hot spare can be permanently removed from the pool using the following
2253 # zpool remove tank sdc
2255 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
2256 The following command creates a ZFS storage pool consisting of two, two-way
2257 mirrors and mirrored log devices:
2259 # zpool create pool mirror sda sdb mirror sdc sdd log mirror \\
2262 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
2263 The following command adds two disks for use as cache devices to a ZFS storage
2266 # zpool add pool cache sdc sdd
2269 Once added, the cache devices gradually fill with content from main memory.
2270 Depending on the size of your cache devices, it could take over an hour for
2272 Capacity and reads can be monitored using the
2276 # zpool iostat -v pool 5
2278 .It Sy Example 14 No Removing a Mirrored top-level (Log or Data) Device
2279 The following commands remove the mirrored log device
2281 and mirrored top-level data device
2284 Given this configuration:
2288 scrub: none requested
2291 NAME STATE READ WRITE CKSUM
2293 mirror-0 ONLINE 0 0 0
2296 mirror-1 ONLINE 0 0 0
2300 mirror-2 ONLINE 0 0 0
2305 The command to remove the mirrored log
2309 # zpool remove tank mirror-2
2312 The command to remove the mirrored data
2316 # zpool remove tank mirror-1
2318 .It Sy Example 15 No Displaying expanded space on a device
2319 The following command displays the detailed information for the pool
2321 This pool is comprised of a single raidz vdev where one of its devices
2322 increased its capacity by 10GB.
2323 In this example, the pool will not be able to utilize this extra capacity until
2324 all the devices under the raidz vdev have been expanded.
2326 # zpool list -v data
2327 NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2328 data 23.9G 14.6G 9.30G - 48% 61% 1.00x ONLINE -
2329 raidz1 23.9G 14.6G 9.30G - 48%
2334 .It Sy Example 16 No Adding output columns
2335 Additional columns can be added to the
2343 # zpool status -c vendor,model,size
2344 NAME STATE READ WRITE CKSUM vendor model size
2346 mirror-0 ONLINE 0 0 0
2347 U1 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2348 U10 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2349 U11 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2350 U12 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2351 U13 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2352 U14 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2354 # zpool iostat -vc slaves
2355 capacity operations bandwidth
2356 pool alloc free read write read write slaves
2357 ---------- ----- ----- ----- ----- ----- ----- ---------
2358 tank 20.4G 7.23T 26 152 20.7M 21.6M
2359 mirror 20.4G 7.23T 26 152 20.7M 21.6M
2360 U1 - - 0 31 1.46K 20.6M sdb sdff
2361 U10 - - 0 1 3.77K 13.3K sdas sdgw
2362 U11 - - 0 1 288K 13.3K sdat sdgx
2363 U12 - - 0 1 78.4K 13.3K sdau sdgy
2364 U13 - - 0 1 128K 13.3K sdav sdgz
2365 U14 - - 0 1 63.2K 13.3K sdfk sdg
2368 .Sh ENVIRONMENT VARIABLES
2369 .Bl -tag -width "ZFS_ABORT"
2373 to dump core on exit for the purposes of running
2376 .Bl -tag -width "ZPOOL_IMPORT_PATH"
2377 .It Ev ZPOOL_IMPORT_PATH
2378 The search path for devices or files to use with the pool. This is a colon-separated list of directories in which
2380 looks for device nodes and files.
2386 .Bl -tag -width "ZPOOL_VDEV_NAME_GUID"
2387 .It Ev ZPOOL_VDEV_NAME_GUID
2389 .Nm zpool subcommands to output vdev guids by default. This behavior
2392 command line option.
2394 .Bl -tag -width "ZPOOL_VDEV_NAME_FOLLOW_LINKS"
2395 .It Ev ZPOOL_VDEV_NAME_FOLLOW_LINKS
2398 subcommands to follow links for vdev names by default. This behavior is identical to the
2400 command line option.
2402 .Bl -tag -width "ZPOOL_VDEV_NAME_PATH"
2403 .It Ev ZPOOL_VDEV_NAME_PATH
2406 subcommands to output full vdev path names by default. This
2407 behavior is identical to the
2409 command line option.
2411 .Bl -tag -width "ZFS_VDEV_DEVID_OPT_OUT"
2412 .It Ev ZFS_VDEV_DEVID_OPT_OUT
2413 Older ZFS on Linux implementations had issues when attempting to display pool
2414 config VDEV names if a
2416 NVP value is present in the pool's config.
2418 For example, a pool that originated on illumos platform would have a devid
2419 value in the config and
2421 would fail when listing the config.
2422 This would also be true for future Linux based pools.
2424 A pool can be stripped of any
2426 values on import or prevented from adding
2432 .Sy ZFS_VDEV_DEVID_OPT_OUT .
2434 .Bl -tag -width "ZPOOL_SCRIPTS_AS_ROOT"
2435 .It Ev ZPOOL_SCRIPTS_AS_ROOT
2436 Allow a privileged user to run the
2437 .Nm zpool status/iostat
2440 option. Normally, only unprivileged users are allowed to run
2443 .Bl -tag -width "ZPOOL_SCRIPTS_PATH"
2444 .It Ev ZPOOL_SCRIPTS_PATH
2445 The search path for scripts when running
2446 .Nm zpool status/iostat
2449 option. This is a colon-separated list of directories and overrides the default
2452 .Pa /etc/zfs/zpool.d
2455 .Bl -tag -width "ZPOOL_SCRIPTS_ENABLED"
2456 .It Ev ZPOOL_SCRIPTS_ENABLED
2458 .Nm zpool status/iostat
2462 .Sy ZPOOL_SCRIPTS_ENABLED
2463 is not set, it is assumed that the user is allowed to run
2464 .Nm zpool status/iostat -c .
2466 .Sh INTERFACE STABILITY
2470 .Xr zfs-module-parameters 5 ,
2471 .Xr zpool-features 5 ,