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 2017 Nexenta Systems, Inc.
25 .\" Copyright (c) 2017 Datto Inc.
26 .\" Copyright (c) 2017 George Melikov. All Rights Reserved.
33 .Nd configure ZFS storage pools
44 .Ar pool device new_device
57 .Op Fl m Ar mountpoint
58 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
59 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
77 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
78 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
93 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
95 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
101 .Op Fl -rewind-to-checkpoint
102 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
104 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
106 .Ar pool Ns | Ns Ar id
116 .Op Fl T Sy u Ns | Ns Sy d
117 .Oo Ar pool Oc Ns ...
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
133 .Ar pool Ar device Ns ...
137 .Ar pool Ar device Ns ...
147 .Ar pool Ar device Ns ...
155 .Ar pool Ar device Op Ar new_device
162 .Ar property Ns = Ns Ar value
167 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
173 .Op Fl T Sy u Ns | Ns Sy d
174 .Oo Ar pool Oc Ns ...
175 .Op Ar interval Op Ar count
184 .Fl a Ns | Ns Ar pool Ns ...
188 command configures ZFS storage pools.
189 A storage pool is a collection of devices that provides physical storage and
190 data replication for ZFS datasets.
191 All datasets within a storage pool share the same space.
194 for information on managing datasets.
195 .Ss Virtual Devices (vdevs)
196 A "virtual device" describes a single device or a collection of devices
197 organized according to certain performance and fault characteristics.
198 The following virtual devices are supported:
201 A block device, typically located under
203 ZFS can use individual slices or partitions, though the recommended mode of
204 operation is to use whole disks.
205 A disk can be specified by a full path, or it can be a shorthand name
206 .Po the relative portion of the path under
209 A whole disk can be specified by omitting the slice or partition designation.
213 .Pa /dev/dsk/c0t0d0s2 .
214 When given a whole disk, ZFS automatically labels the disk, if necessary.
217 The use of files as a backing store is strongly discouraged.
218 It is designed primarily for experimental purposes, as the fault tolerance of a
219 file is only as good as the file system of which it is a part.
220 A file must be specified by a full path.
222 A mirror of two or more devices.
223 Data is replicated in an identical fashion across all components of a mirror.
224 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
225 failing before data integrity is compromised.
226 .It Sy raidz , raidz1 , raidz2 , raidz3
227 A variation on RAID-5 that allows for better distribution of parity and
228 eliminates the RAID-5
230 .Pq in which data and parity become inconsistent after a power loss .
231 Data and parity is striped across all disks within a raidz group.
233 A raidz group can have single-, double-, or triple-parity, meaning that the
234 raidz group can sustain one, two, or three failures, respectively, without
238 vdev type specifies a single-parity raidz group; the
240 vdev type specifies a double-parity raidz group; and the
242 vdev type specifies a triple-parity raidz group.
245 vdev type is an alias for
248 A raidz group with N disks of size X with P parity disks can hold approximately
249 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
251 The minimum number of devices in a raidz group is one more than the number of
253 The recommended number is between 3 and 9 to help increase performance.
255 A special pseudo-vdev which keeps track of available hot spares for a pool.
256 For more information, see the
260 A separate intent log device.
261 If more than one log device is specified, then writes are load-balanced between
263 Log devices can be mirrored.
264 However, raidz vdev types are not supported for the intent log.
265 For more information, see the
269 A device used to cache storage pool data.
270 A cache device cannot be configured as a mirror or raidz group.
271 For more information, see the
276 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
277 contain files or disks.
279 .Pq or other combinations
282 A pool can have any number of virtual devices at the top of the configuration
286 Data is dynamically distributed across all top-level devices to balance data
288 As new virtual devices are added, ZFS automatically places data on the newly
291 Virtual devices are specified one at a time on the command line, separated by
297 are used to distinguish where a group ends and another begins.
298 For example, the following creates two root vdevs, each a mirror of two disks:
300 # zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0
302 .Ss Device Failure and Recovery
303 ZFS supports a rich set of mechanisms for handling device failure and data
305 All metadata and data is checksummed, and ZFS automatically repairs bad data
306 from a good copy when corruption is detected.
308 In order to take advantage of these features, a pool must make use of some form
309 of redundancy, using either mirrored or raidz groups.
310 While ZFS supports running in a non-redundant configuration, where each root
311 vdev is simply a disk or file, this is strongly discouraged.
312 A single case of bit corruption can render some or all of your data unavailable.
314 A pool's health status is described by one of three states: online, degraded,
316 An online pool has all devices operating normally.
317 A degraded pool is one in which one or more devices have failed, but the data is
318 still available due to a redundant configuration.
319 A faulted pool has corrupted metadata, or one or more faulted devices, and
320 insufficient replicas to continue functioning.
322 The health of the top-level vdev, such as mirror or raidz device, is
323 potentially impacted by the state of its associated vdevs, or component
325 A top-level vdev or component device is in one of the following states:
326 .Bl -tag -width "DEGRADED"
328 One or more top-level vdevs is in the degraded state because one or more
329 component devices are offline.
330 Sufficient replicas exist to continue functioning.
332 One or more component devices is in the degraded or faulted state, but
333 sufficient replicas exist to continue functioning.
334 The underlying conditions are as follows:
337 The number of checksum errors exceeds acceptable levels and the device is
338 degraded as an indication that something may be wrong.
339 ZFS continues to use the device as necessary.
341 The number of I/O errors exceeds acceptable levels.
342 The device could not be marked as faulted because there are insufficient
343 replicas to continue functioning.
346 One or more top-level vdevs is in the faulted state because one or more
347 component devices are offline.
348 Insufficient replicas exist to continue functioning.
350 One or more component devices is in the faulted state, and insufficient
351 replicas exist to continue functioning.
352 The underlying conditions are as follows:
355 The device could be opened, but the contents did not match expected values.
357 The number of I/O errors exceeds acceptable levels and the device is faulted to
358 prevent further use of the device.
361 The device was explicitly taken offline by the
365 The device is online and functioning.
367 The device was physically removed while the system was running.
368 Device removal detection is hardware-dependent and may not be supported on all
371 The device could not be opened.
372 If a pool is imported when a device was unavailable, then the device will be
373 identified by a unique identifier instead of its path since the path was never
374 correct in the first place.
377 If a device is removed and later re-attached to the system, ZFS attempts
378 to put the device online automatically.
379 Device attach detection is hardware-dependent and might not be supported on all
382 ZFS allows devices to be associated with pools as
384 These devices are not actively used in the pool, but when an active device
385 fails, it is automatically replaced by a hot spare.
386 To create a pool with hot spares, specify a
388 vdev with any number of devices.
391 # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
394 Spares can be shared across multiple pools, and can be added with the
396 command and removed with the
399 Once a spare replacement is initiated, a new
401 vdev is created within the configuration that will remain there until the
402 original device is replaced.
403 At this point, the hot spare becomes available again if another device fails.
405 If a pool has a shared spare that is currently being used, the pool can not be
406 exported since other pools may use this shared spare, which may lead to
407 potential data corruption.
409 An in-progress spare replacement can be cancelled by detaching the hot spare.
410 If the original faulted device is detached, then the hot spare assumes its
411 place in the configuration, and is removed from the spare list of all active
414 Spares cannot replace log devices.
416 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
418 For instance, databases often require their transactions to be on stable storage
419 devices when returning from a system call.
420 NFS and other applications can also use
422 to ensure data stability.
423 By default, the intent log is allocated from blocks within the main pool.
424 However, it might be possible to get better performance using separate intent
425 log devices such as NVRAM or a dedicated disk.
428 # zpool create pool c0d0 c1d0 log c2d0
431 Multiple log devices can also be specified, and they can be mirrored.
434 section for an example of mirroring multiple log devices.
436 Log devices can be added, replaced, attached, detached, and imported and
437 exported as part of the larger pool.
438 Mirrored devices can be removed by specifying the top-level mirror vdev.
440 Devices can be added to a storage pool as
442 These devices provide an additional layer of caching between main memory and
444 For read-heavy workloads, where the working set size is much larger than what
445 can be cached in main memory, using cache devices allow much more of this
446 working set to be served from low latency media.
447 Using cache devices provides the greatest performance improvement for random
448 read-workloads of mostly static content.
450 To create a pool with cache devices, specify a
452 vdev with any number of devices.
455 # zpool create pool c0d0 c1d0 cache c2d0 c3d0
458 Cache devices cannot be mirrored or part of a raidz configuration.
459 If a read error is encountered on a cache device, that read I/O is reissued to
460 the original storage pool device, which might be part of a mirrored or raidz
463 The content of the cache devices is considered volatile, as is the case with
466 Before starting critical procedures that include destructive actions (e.g
468 ), an administrator can checkpoint the pool's state and in the case of a
469 mistake or failure, rewind the entire pool back to the checkpoint.
470 Otherwise, the checkpoint can be discarded when the procedure has completed
473 A pool checkpoint can be thought of as a pool-wide snapshot and should be used
474 with care as it contains every part of the pool's state, from properties to vdev
476 Thus, while a pool has a checkpoint certain operations are not allowed.
477 Specifically, vdev removal/attach/detach, mirror splitting, and
478 changing the pool's guid.
479 Adding a new vdev is supported but in the case of a rewind it will have to be
481 Finally, users of this feature should keep in mind that scrubs in a pool that
482 has a checkpoint do not repair checkpointed data.
484 To create a checkpoint for a pool:
486 # zpool checkpoint pool
489 To later rewind to its checkpointed state, you need to first export it and
490 then rewind it during import:
493 # zpool import --rewind-to-checkpoint pool
496 To discard the checkpoint from a pool:
498 # zpool checkpoint -d pool
501 Dataset reservations (controlled by the
505 zfs properties) may be unenforceable while a checkpoint exists, because the
506 checkpoint is allowed to consume the dataset's reservation.
507 Finally, data that is part of the checkpoint but has been freed in the
508 current state of the pool won't be scanned during a scrub.
510 Each pool has several properties associated with it.
511 Some properties are read-only statistics while others are configurable and
512 change the behavior of the pool.
514 The following are read-only properties:
517 Amount of storage space used within the pool.
519 The size of the system boot partition.
520 This property can only be set at pool creation time and is read-only once pool
522 Setting this property implies using the
526 Percentage of pool space used.
527 This property can also be referred to by its shortened column name,
530 Amount of uninitialized space within the pool or device that can be used to
531 increase the total capacity of the pool.
532 Uninitialized space consists of any space on an EFI labeled vdev which has not
535 .Nm zpool Cm online Fl e
537 This space occurs when a LUN is dynamically expanded.
539 The amount of fragmentation in the pool.
541 The amount of free space available in the pool.
543 After a file system or snapshot is destroyed, the space it was using is
544 returned to the pool asynchronously.
546 is the amount of space remaining to be reclaimed.
553 The current health of the pool.
555 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
557 A unique identifier for the pool.
559 Total size of the storage pool.
560 .It Sy unsupported@ Ns Em feature_guid
561 Information about unsupported features that are enabled on the pool.
567 The space usage properties report actual physical space available to the
569 The physical space can be different from the total amount of space that any
570 contained datasets can actually use.
571 The amount of space used in a raidz configuration depends on the characteristics
572 of the data being written.
573 In addition, ZFS reserves some space for internal accounting that the
575 command takes into account, but the
578 For non-full pools of a reasonable size, these effects should be invisible.
579 For small pools, or pools that are close to being completely full, these
580 discrepancies may become more noticeable.
582 The following property can be set at creation time and import time:
585 Alternate root directory.
586 If set, this directory is prepended to any mount points within the pool.
587 This can be used when examining an unknown pool where the mount points cannot be
588 trusted, or in an alternate boot environment, where the typical paths are not
591 is not a persistent property.
592 It is valid only while the system is up.
596 .Sy cachefile Ns = Ns Sy none ,
597 though this may be overridden using an explicit setting.
600 The following property can be set only at import time:
602 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
605 the pool will be imported in read-only mode.
606 This property can also be referred to by its shortened column name,
610 The following properties can be set at creation time and import time, and later
615 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
616 Controls automatic pool expansion when the underlying LUN is grown.
619 the pool will be resized according to the size of the expanded device.
620 If the device is part of a mirror or raidz then all devices within that
621 mirror/raidz group must be expanded before the new space is made available to
623 The default behavior is
625 This property can also be referred to by its shortened column name,
627 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
628 Controls automatic device replacement.
631 device replacement must be initiated by the administrator by using the
636 any new device, found in the same physical location as a device that previously
637 belonged to the pool, is automatically formatted and replaced.
638 The default behavior is
640 This property can also be referred to by its shortened column name,
642 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
643 Identifies the default bootable dataset for the root pool.
644 This property is expected to be set mainly by the installation and upgrade
646 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
647 Controls the location of where the pool configuration is cached.
648 Discovering all pools on system startup requires a cached copy of the
649 configuration data that is stored on the root file system.
650 All pools in this cache are automatically imported when the system boots.
651 Some environments, such as install and clustering, need to cache this
652 information in a different location so that pools are not automatically
654 Setting this property caches the pool configuration in a different location that
655 can later be imported with
656 .Nm zpool Cm import Fl c .
657 Setting it to the special value
659 creates a temporary pool that is never cached, and the special value
662 uses the default location.
664 Multiple pools can share the same cache file.
665 Because the kernel destroys and recreates this file when pools are added and
666 removed, care should be taken when attempting to access this file.
667 When the last pool using a
669 is exported or destroyed, the file is removed.
670 .It Sy comment Ns = Ns Ar text
671 A text string consisting of printable ASCII characters that will be stored
672 such that it is available even if the pool becomes faulted.
673 An administrator can provide additional information about a pool using this
675 .It Sy dedupditto Ns = Ns Ar number
676 Threshold for the number of block ditto copies.
677 If the reference count for a deduplicated block increases above this number, a
678 new ditto copy of this block is automatically stored.
679 The default setting is
681 which causes no ditto copies to be created for deduplicated blocks.
682 The minimum legal nonzero setting is
684 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
685 Controls whether a non-privileged user is granted access based on the dataset
686 permissions defined on the dataset.
689 for more information on ZFS delegated administration.
690 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
691 Controls the system behavior in the event of catastrophic pool failure.
692 This condition is typically a result of a loss of connectivity to the underlying
693 storage device(s) or a failure of all devices within the pool.
694 The behavior of such an event is determined as follows:
695 .Bl -tag -width "continue"
697 Blocks all I/O access until the device connectivity is recovered and the errors
699 This is the default behavior.
703 to any new write I/O requests but allows reads to any of the remaining healthy
705 Any write requests that have yet to be committed to disk would be blocked.
707 Prints out a message to the console and generates a system crash dump.
709 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
710 The value of this property is the current state of
712 The only valid value when setting this property is
716 to the enabled state.
719 for details on feature states.
720 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
721 Controls whether information about snapshots associated with this pool is
729 This property can also be referred to by its shortened name,
731 .It Sy version Ns = Ns Ar version
732 The current on-disk version of the pool.
733 This can be increased, but never decreased.
734 The preferred method of updating pools is with the
736 command, though this property can be used when a specific version is needed for
737 backwards compatibility.
738 Once feature flags are enabled on a pool this property will no longer have a
742 All subcommands that modify state are logged persistently to the pool in their
747 command provides subcommands to create and destroy storage pools, add capacity
748 to storage pools, and provide information about the storage pools.
749 The following subcommands are supported:
755 Displays a help message.
762 Adds the specified virtual devices to the given pool.
765 specification is described in the
770 option, and the device checks performed are described in the
777 even if they appear in use or specify a conflicting replication level.
778 Not all devices can be overridden in this manner.
780 Displays the configuration that would be used without actually adding the
782 The actual pool creation can still fail due to insufficient privileges or
789 .Ar pool device new_device
795 The existing device cannot be part of a raidz configuration.
798 is not currently part of a mirrored configuration,
800 automatically transforms into a two-way mirror of
806 is part of a two-way mirror, attaching
808 creates a three-way mirror, and so on.
811 begins to resilver immediately.
816 even if its appears to be in use.
817 Not all devices can be overridden in this manner.
825 Checkpoints the current state of
827 , which can be later restored by
828 .Nm zpool Cm import --rewind-to-checkpoint .
829 The existence of a checkpoint in a pool prohibits the following
838 In addition, it may break reservation boundaries if the pool lacks free
842 command indicates the existence of a checkpoint or the progress of discarding a
843 checkpoint from a pool.
846 command reports how much space the checkpoint takes from the pool.
849 Discards an existing checkpoint from
858 Clears device errors in a pool.
859 If no arguments are specified, all device errors within the pool are cleared.
860 If one or more devices is specified, only those errors associated with the
861 specified device or devices are cleared.
867 .Op Fl m Ar mountpoint
868 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
869 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
874 Creates a new storage pool containing the virtual devices specified on the
876 The pool name must begin with a letter, and can only contain
877 alphanumeric characters as well as underscore
889 are reserved, as are names beginning with the pattern
893 specification is described in the
897 The command verifies that each device specified is accessible and not currently
898 in use by another subsystem.
899 There are some uses, such as being currently mounted, or specified as the
900 dedicated dump device, that prevents a device from ever being used by ZFS.
901 Other uses, such as having a preexisting UFS file system, can be overridden with
906 The command also checks that the replication strategy for the pool is
908 An attempt to combine redundant and non-redundant storage in a single pool, or
909 to mix disks and files, results in an error unless
912 The use of differently sized devices within a single raidz or mirror group is
913 also flagged as an error unless
919 option is specified, the default mount point is
921 The mount point must not exist or must be empty, or else the root dataset
923 This can be overridden with the
927 By default all supported features are enabled on the new pool unless the
932 Create whole disk pool with EFI System partition to support booting system
934 Default size is 256MB.
935 To create boot partition with custom size, set the
944 Do not enable any features on the new pool.
945 Individual features can be enabled by setting their corresponding properties to
952 for details about feature properties.
956 even if they appear in use or specify a conflicting replication level.
957 Not all devices can be overridden in this manner.
958 .It Fl m Ar mountpoint
959 Sets the mount point for the root dataset.
960 The default mount point is
967 The mount point must be an absolute path,
971 For more information on dataset mount points, see
974 Displays the configuration that would be used without actually creating the
976 The actual pool creation can still fail due to insufficient privileges or
978 .It Fl o Ar property Ns = Ns Ar value
979 Sets the given pool properties.
982 section for a list of valid properties that can be set.
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
1000 This is intended to handle name space collisions when creating pools
1001 for other systems, such as virtual machines or physical machines
1002 whose pools live on network block devices.
1010 Destroys the given pool, freeing up any devices for other use.
1011 This command tries to unmount any active datasets before destroying the pool.
1014 Forces any active datasets contained within the pool to be unmounted.
1024 The operation is refused if there are no other valid replicas of the data.
1031 Exports the given pools from the system.
1032 All devices are marked as exported, but are still considered in use by other
1034 The devices can be moved between systems
1035 .Pq even those of different endianness
1036 and imported as long as a sufficient number of devices are present.
1038 Before exporting the pool, all datasets within the pool are unmounted.
1039 A pool can not be exported if it has a shared spare that is currently being
1042 For pools to be portable, you must give the
1044 command whole disks, not just slices, so that ZFS can label the disks with
1045 portable EFI labels.
1046 Otherwise, disk drivers on platforms of different endianness will not recognize
1050 Forcefully unmount all datasets, using the
1054 This command will forcefully export the pool even if it has a shared spare that
1055 is currently being used.
1056 This may lead to potential data corruption.
1062 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1063 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1066 Retrieves the given list of properties
1068 or all properties if
1072 for the specified storage pool(s).
1073 These properties are displayed with the following fields:
1075 name Name of storage pool
1076 property Property name
1077 value Property value
1078 source Property source, either 'default' or 'local'.
1083 section for more information on the available pool properties.
1087 Do not display headers, and separate fields by a single tab instead of arbitrary
1090 A comma-separated list of columns to display.
1091 .Sy name Ns , Ns Sy property Ns , Ns Sy value Ns , Ns Sy source
1092 is the default value.
1094 Display numbers in parsable (exact) values.
1100 .Oo Ar pool Oc Ns ...
1102 Displays the command history of the specified pool(s) or all pools if no pool is
1106 Displays internally logged ZFS events in addition to user initiated events.
1108 Displays log records in long format, which in addition to standard format
1109 includes, the user name, the hostname, and the zone in which the operation was
1118 Lists pools available to import.
1121 option is not specified, this command searches for devices in
1125 option can be specified multiple times, and all directories are searched.
1126 If the device appears to be part of an exported pool, this command displays a
1127 summary of the pool with the name of the pool, a numeric identifier, as well as
1128 the vdev layout and current health of the device for each device or file.
1129 Destroyed pools, pools that were previously destroyed with the
1130 .Nm zpool Cm destroy
1131 command, are not listed unless the
1133 option is specified.
1135 The numeric identifier is unique, and can be used instead of the pool name when
1136 multiple exported pools of the same name are available.
1138 .It Fl c Ar cachefile
1139 Reads configuration from the given
1141 that was created with the
1146 is used instead of searching for devices.
1148 Searches for devices or files in
1152 option can be specified multiple times.
1154 Lists destroyed pools only.
1162 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1164 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1167 Imports all pools found in the search directories.
1168 Identical to the previous command, except that all pools with a sufficient
1169 number of devices available are imported.
1170 Destroyed pools, pools that were previously destroyed with the
1171 .Nm zpool Cm destroy
1172 command, will not be imported unless the
1174 option is specified.
1177 Searches for and imports all pools found.
1178 .It Fl c Ar cachefile
1179 Reads configuration from the given
1181 that was created with the
1186 is used instead of searching for devices.
1188 Searches for devices or files in
1192 option can be specified multiple times.
1193 This option is incompatible with the
1197 Imports destroyed pools only.
1200 option is also required.
1202 Forces import, even if the pool appears to be potentially active.
1204 Recovery mode for a non-importable pool.
1205 Attempt to return the pool to an importable state by discarding the last few
1207 Not all damaged pools can be recovered by using this option.
1208 If successful, the data from the discarded transactions is irretrievably lost.
1209 This option is ignored if the pool is importable or already imported.
1211 Allows a pool to import when there is a missing log device.
1212 Recent transactions can be lost because the log device will be discarded.
1217 Determines whether a non-importable pool can be made importable again, but does
1218 not actually perform the pool recovery.
1219 For more details about pool recovery mode, see the
1223 Import the pool without mounting any file systems.
1225 Comma-separated list of mount options to use when mounting datasets within the
1229 for a description of dataset properties and mount options.
1230 .It Fl o Ar property Ns = Ns Ar value
1231 Sets the specified property on the imported pool.
1234 section for more information on the available pool properties.
1250 .Op Fl -rewind-to-checkpoint
1251 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1253 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1255 .Ar pool Ns | Ns Ar id
1258 Imports a specific pool.
1259 A pool can be identified by its name or the numeric identifier.
1262 is specified, the pool is imported using the name
1264 Otherwise, it is imported with the same name as its exported name.
1266 If a device is removed from a system without running
1268 first, the device appears as potentially active.
1269 It cannot be determined if this was a failed export, or whether the device is
1270 really in use from another host.
1271 To import a pool in this state, the
1275 .It Fl c Ar cachefile
1276 Reads configuration from the given
1278 that was created with the
1283 is used instead of searching for devices.
1285 Searches for devices or files in
1289 option can be specified multiple times.
1290 This option is incompatible with the
1294 Imports destroyed pool.
1297 option is also required.
1299 Forces import, even if the pool appears to be potentially active.
1301 Recovery mode for a non-importable pool.
1302 Attempt to return the pool to an importable state by discarding the last few
1304 Not all damaged pools can be recovered by using this option.
1305 If successful, the data from the discarded transactions is irretrievably lost.
1306 This option is ignored if the pool is importable or already imported.
1308 Allows a pool to import when there is a missing log device.
1309 Recent transactions can be lost because the log device will be discarded.
1314 Determines whether a non-importable pool can be made importable again, but does
1315 not actually perform the pool recovery.
1316 For more details about pool recovery mode, see the
1320 Comma-separated list of mount options to use when mounting datasets within the
1324 for a description of dataset properties and mount options.
1325 .It Fl o Ar property Ns = Ns Ar value
1326 Sets the specified property on the imported pool.
1329 section for more information on the available pool properties.
1345 Temporary pool names last until export.
1346 Ensures that the original pool name will be used in all label updates and
1347 therefore is retained upon export.
1352 when not explicitly specified.
1353 .It Fl -rewind-to-checkpoint
1354 Rewinds pool to the checkpointed state.
1355 Once the pool is imported with this flag there is no way to undo the rewind.
1356 All changes and data that were written after the checkpoint are lost!
1357 The only exception is when the
1359 mounting option is enabled.
1360 In this case, the checkpointed state of the pool is opened and an
1361 administrator can see how the pool would look like if they were
1369 .Op Ar device Ns ...
1371 Begins initializing by writing to all unallocated regions on the specified
1372 devices, or all eligible devices in the pool if no individual devices are
1374 Only leaf data or log devices may be initialized.
1377 Cancel initializing on the specified devices, or all eligible devices if none
1379 If one or more target devices are invalid or are not currently being
1380 initialized, the command will fail and no cancellation will occur on any device.
1382 Suspend initializing on the specified devices, or all eligible devices if none
1384 If one or more target devices are invalid or are not currently being
1385 initialized, the command will fail and no suspension will occur on any device.
1386 Initializing can then be resumed by running
1387 .Nm zpool Cm initialize
1388 with no flags on the relevant target devices.
1394 .Op Fl T Sy u Ns | Ns Sy d
1395 .Oo Ar pool Oc Ns ...
1396 .Op Ar interval Op Ar count
1398 Displays I/O statistics for the given pools.
1401 the statistics are printed every
1403 seconds until ^C is pressed.
1406 are specified, statistics for every pool in the system is shown.
1409 is specified, the command exits after
1411 reports are printed.
1413 .It Fl T Sy u Ns | Ns Sy d
1414 Display a time stamp.
1417 for a printed representation of the internal representation of time.
1422 for standard date format.
1426 Verbose statistics Reports usage statistics for individual vdevs within the
1427 pool, in addition to the pool-wide statistics.
1435 Removes ZFS label information from the specified
1439 must not be part of an active pool configuration.
1442 Treat exported or foreign devices as inactive.
1448 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1449 .Op Fl T Sy u Ns | Ns Sy d
1450 .Oo Ar pool Oc Ns ...
1451 .Op Ar interval Op Ar count
1453 Lists the given pools along with a health status and space usage.
1456 are specified, all pools in the system are listed.
1459 the information is printed every
1461 seconds until ^C is pressed.
1464 is specified, the command exits after
1466 reports are printed.
1470 Do not display headers, and separate fields by a single tab instead of arbitrary
1472 .It Fl o Ar property
1473 Comma-separated list of properties to display.
1476 section for a list of valid properties.
1478 .Cm name , size , allocated , free , checkpoint, expandsize , fragmentation , capacity ,
1479 .Cm dedupratio , health , altroot .
1481 Display numbers in parsable
1484 .It Fl T Sy u Ns | Ns Sy d
1485 Display a time stamp.
1488 for a printed representation of the internal representation of time.
1493 for standard date format.
1498 Reports usage statistics for individual vdevs within the pool, in addition to
1499 the pool-wise statistics.
1505 .Ar pool Ar device Ns ...
1507 Takes the specified physical device offline.
1510 is offline, no attempt is made to read or write to the device.
1511 This command is not applicable to spares.
1515 Upon reboot, the specified physical device reverts to its previous state.
1521 .Ar pool Ar device Ns ...
1523 Brings the specified physical device online.
1524 This command is not applicable to spares.
1527 Expand the device to use all available space.
1528 If the device is part of a mirror or raidz then all devices must be expanded
1529 before the new space will become available to the pool.
1536 Generates a new unique identifier for the pool.
1537 You must ensure that all devices in this pool are online and healthy before
1538 performing this action.
1544 Reopen all the vdevs associated with the pool.
1549 .Ar pool Ar device Ns ...
1551 Removes the specified device from the pool.
1552 This command currently only supports removing hot spares, cache, log
1553 devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
1555 Removing a top-level vdev reduces the total amount of space in the storage pool.
1556 The specified device will be evacuated by copying all allocated space from it to
1557 the other devices in the pool.
1560 command initiates the removal and returns, while the evacuation continues in
1562 The removal progress can be monitored with
1563 .Nm zpool Cm status.
1564 This feature must be enabled to be used, see
1565 .Xr zpool-features 5
1567 A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
1569 Non-log devices or data devices that are part of a mirrored configuration can be removed using
1575 Do not actually perform the removal ("no-op").
1576 Instead, print the estimated amount of memory that will be used by the
1577 mapping table after the removal completes.
1578 This is nonzero only for top-level vdevs.
1582 Used in conjunction with the
1584 flag, displays numbers as parsable (exact) values.
1592 Stops and cancels an in-progress removal of a top-level vdev.
1597 .Ar pool Ar device Op Ar new_device
1603 This is equivalent to attaching
1605 waiting for it to resilver, and then detaching
1610 must be greater than or equal to the minimum size of all the devices in a mirror
1611 or raidz configuration.
1614 is required if the pool is not redundant.
1617 is not specified, it defaults to
1619 This form of replacement is useful after an existing disk has failed and has
1620 been physically replaced.
1621 In this case, the new disk may have the same
1623 path as the old device, even though it is actually a different disk.
1624 ZFS recognizes this.
1629 even if its appears to be in use.
1630 Not all devices can be overridden in this manner.
1638 Begins a scrub or resumes a paused scrub.
1639 The scrub examines all data in the specified pools to verify that it checksums
1643 devices, ZFS automatically repairs any damage discovered during the scrub.
1646 command reports the progress of the scrub and summarizes the results of the
1647 scrub upon completion.
1649 Scrubbing and resilvering are very similar operations.
1650 The difference is that resilvering only examines data that ZFS knows to be out
1653 for example, when attaching a new device to a mirror or replacing an existing
1656 whereas scrubbing examines all data to discover silent errors due to hardware
1657 faults or disk failure.
1659 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1661 If a scrub is paused, the
1664 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1673 Scrub pause state and progress are periodically synced to disk.
1674 If the system is restarted or pool is exported during a paused scrub,
1675 even after import, scrub will remain paused until it is resumed.
1676 Once resumed the scrub will pick up from the place where it was last
1677 checkpointed to disk.
1678 To resume a paused scrub issue
1685 .Ar property Ns = Ns Ar value
1688 Sets the given property on the specified pool.
1691 section for more information on what properties can be set and acceptable
1697 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1708 At the time of the split,
1710 will be a replica of
1714 Do dry run, do not actually perform the split.
1715 Print out the expected configuration of
1717 .It Fl o Ar property Ns = Ns Ar value
1718 Sets the specified property for
1722 section for more information on the available pool properties.
1730 and automatically import it.
1736 .Op Fl T Sy u Ns | Ns Sy d
1737 .Oo Ar pool Oc Ns ...
1738 .Op Ar interval Op Ar count
1740 Displays the detailed health status for the given pools.
1743 is specified, then the status of each pool in the system is displayed.
1744 For more information on pool and device health, see the
1745 .Sx Device Failure and Recovery
1748 If a scrub or resilver is in progress, this command reports the percentage done
1749 and the estimated time to completion.
1750 Both of these are only approximate, because the amount of data in the pool and
1751 the other workloads on the system can change.
1754 Display a histogram of deduplication statistics, showing the allocated
1755 .Pq physically present on disk
1757 .Pq logically referenced in the pool
1758 block counts and sizes by reference count.
1759 .It Fl T Sy u Ns | Ns Sy d
1760 Display a time stamp.
1763 for a printed representation of the internal representation of time.
1768 for standard date format.
1772 Displays verbose data error information, printing out a complete list of all
1773 data errors since the last complete pool scrub.
1775 Only display status for pools that are exhibiting errors or are otherwise
1777 Warnings about pools not using the latest on-disk format will not be included.
1783 Displays pools which do not have all supported features enabled and pools
1784 formatted using a legacy ZFS version number.
1785 These pools can continue to be used, but some features may not be available.
1787 .Nm zpool Cm upgrade Fl a
1788 to enable all features on all pools.
1794 Displays legacy ZFS versions supported by the current software.
1796 .Xr zpool-features 5
1797 for a description of feature flags features supported by the current software.
1802 .Fl a Ns | Ns Ar pool Ns ...
1804 Enables all supported features on the given pool.
1805 Once this is done, the pool will no longer be accessible on systems that do not
1806 support feature flags.
1808 .Xr zpool-features 5
1809 for details on compatibility with systems that support feature flags, but do not
1810 support all features enabled on the pool.
1813 Enables all supported features on all pools.
1815 Upgrade to the specified legacy version.
1818 flag is specified, no features will be enabled on the pool.
1819 This option can only be used to increase the version number up to the last
1820 supported legacy version number.
1824 The following exit values are returned:
1827 Successful completion.
1831 Invalid command line options were specified.
1835 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1836 The following command creates a pool with a single raidz root vdev that
1837 consists of six disks.
1839 # zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0
1841 .It Sy Example 2 No Creating a Mirrored Storage Pool
1842 The following command creates a pool with two mirrors, where each mirror
1845 # zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0
1847 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Slices
1848 The following command creates an unmirrored pool using two disk slices.
1850 # zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4
1852 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
1853 The following command creates an unmirrored pool using files.
1854 While not recommended, a pool based on files can be useful for experimental
1857 # zpool create tank /path/to/file/a /path/to/file/b
1859 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
1860 The following command adds two mirrored disks to the pool
1862 assuming the pool is already made up of two-way mirrors.
1863 The additional space is immediately available to any datasets within the pool.
1865 # zpool add tank mirror c1t0d0 c1t1d0
1867 .It Sy Example 6 No Listing Available ZFS Storage Pools
1868 The following command lists all available pools on the system.
1869 In this case, the pool
1871 is faulted due to a missing device.
1872 The results from this command are similar to the following:
1875 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1876 rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE -
1877 tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE -
1878 zion - - - - - - - FAULTED -
1880 .It Sy Example 7 No Destroying a ZFS Storage Pool
1881 The following command destroys the pool
1883 and any datasets contained within.
1885 # zpool destroy -f tank
1887 .It Sy Example 8 No Exporting a ZFS Storage Pool
1888 The following command exports the devices in pool
1890 so that they can be relocated or later imported.
1894 .It Sy Example 9 No Importing a ZFS Storage Pool
1895 The following command displays available pools, and then imports the pool
1897 for use on the system.
1898 The results from this command are similar to the following:
1902 id: 15451357997522795478
1904 action: The pool can be imported using its name or numeric identifier.
1914 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
1915 The following command upgrades all ZFS Storage pools to the current version of
1919 This system is currently running ZFS version 2.
1921 .It Sy Example 11 No Managing Hot Spares
1922 The following command creates a new pool with an available hot spare:
1924 # zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0
1927 If one of the disks were to fail, the pool would be reduced to the degraded
1929 The failed device can be replaced using the following command:
1931 # zpool replace tank c0t0d0 c0t3d0
1934 Once the data has been resilvered, the spare is automatically removed and is
1935 made available for use should another device fail.
1936 The hot spare can be permanently removed from the pool using the following
1939 # zpool remove tank c0t2d0
1941 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
1942 The following command creates a ZFS storage pool consisting of two, two-way
1943 mirrors and mirrored log devices:
1945 # zpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
1948 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
1949 The following command adds two disks for use as cache devices to a ZFS storage
1952 # zpool add pool cache c2d0 c3d0
1955 Once added, the cache devices gradually fill with content from main memory.
1956 Depending on the size of your cache devices, it could take over an hour for
1958 Capacity and reads can be monitored using the
1962 # zpool iostat -v pool 5
1964 .It Sy Example 14 No Removing a Mirrored top-level (Log or Data) Device
1965 The following commands remove the mirrored log device
1967 and mirrored top-level data device
1970 Given this configuration:
1974 scrub: none requested
1977 NAME STATE READ WRITE CKSUM
1979 mirror-0 ONLINE 0 0 0
1982 mirror-1 ONLINE 0 0 0
1986 mirror-2 ONLINE 0 0 0
1991 The command to remove the mirrored log
1995 # zpool remove tank mirror-2
1998 The command to remove the mirrored data
2002 # zpool remove tank mirror-1
2004 .It Sy Example 15 No Displaying expanded space on a device
2005 The following command displays the detailed information for the pool
2007 This pool is comprised of a single raidz vdev where one of its devices
2008 increased its capacity by 10GB.
2009 In this example, the pool will not be able to utilize this extra capacity until
2010 all the devices under the raidz vdev have been expanded.
2012 # zpool list -v data
2013 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2014 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
2015 raidz1 23.9G 14.6G 9.30G 48% -
2021 .Sh INTERFACE STABILITY
2026 .Xr zpool-features 5