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 ...
76 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
77 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
92 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
94 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
100 .Op Fl -rewind-to-checkpoint
101 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
103 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
105 .Ar pool Ns | Ns Ar id
115 .Op Fl T Sy u Ns | Ns Sy d
116 .Oo Ar pool Oc Ns ...
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
132 .Ar pool Ar device Ns ...
136 .Ar pool Ar device Ns ...
146 .Ar pool Ar device Ns ...
154 .Ar pool Ar device Op Ar new_device
161 .Ar property Ns = Ns Ar value
166 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
172 .Op Fl T Sy u Ns | Ns Sy d
173 .Oo Ar pool Oc Ns ...
174 .Op Ar interval Op Ar count
183 .Fl a Ns | Ns Ar pool Ns ...
187 command configures ZFS storage pools.
188 A storage pool is a collection of devices that provides physical storage and
189 data replication for ZFS datasets.
190 All datasets within a storage pool share the same space.
193 for information on managing datasets.
194 .Ss Virtual Devices (vdevs)
195 A "virtual device" describes a single device or a collection of devices
196 organized according to certain performance and fault characteristics.
197 The following virtual devices are supported:
200 A block device, typically located under
202 ZFS can use individual slices or partitions, though the recommended mode of
203 operation is to use whole disks.
204 A disk can be specified by a full path, or it can be a shorthand name
205 .Po the relative portion of the path under
208 A whole disk can be specified by omitting the slice or partition designation.
212 .Pa /dev/dsk/c0t0d0s2 .
213 When given a whole disk, ZFS automatically labels the disk, if necessary.
216 The use of files as a backing store is strongly discouraged.
217 It is designed primarily for experimental purposes, as the fault tolerance of a
218 file is only as good as the file system of which it is a part.
219 A file must be specified by a full path.
221 A mirror of two or more devices.
222 Data is replicated in an identical fashion across all components of a mirror.
223 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
224 failing before data integrity is compromised.
225 .It Sy raidz , raidz1 , raidz2 , raidz3
226 A variation on RAID-5 that allows for better distribution of parity and
227 eliminates the RAID-5
229 .Pq in which data and parity become inconsistent after a power loss .
230 Data and parity is striped across all disks within a raidz group.
232 A raidz group can have single-, double-, or triple-parity, meaning that the
233 raidz group can sustain one, two, or three failures, respectively, without
237 vdev type specifies a single-parity raidz group; the
239 vdev type specifies a double-parity raidz group; and the
241 vdev type specifies a triple-parity raidz group.
244 vdev type is an alias for
247 A raidz group with N disks of size X with P parity disks can hold approximately
248 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
250 The minimum number of devices in a raidz group is one more than the number of
252 The recommended number is between 3 and 9 to help increase performance.
254 A special pseudo-vdev which keeps track of available hot spares for a pool.
255 For more information, see the
259 A separate intent log device.
260 If more than one log device is specified, then writes are load-balanced between
262 Log devices can be mirrored.
263 However, raidz vdev types are not supported for the intent log.
264 For more information, see the
268 A device used to cache storage pool data.
269 A cache device cannot be configured as a mirror or raidz group.
270 For more information, see the
275 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
276 contain files or disks.
278 .Pq or other combinations
281 A pool can have any number of virtual devices at the top of the configuration
285 Data is dynamically distributed across all top-level devices to balance data
287 As new virtual devices are added, ZFS automatically places data on the newly
290 Virtual devices are specified one at a time on the command line, separated by
296 are used to distinguish where a group ends and another begins.
297 For example, the following creates two root vdevs, each a mirror of two disks:
299 # zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0
301 .Ss Device Failure and Recovery
302 ZFS supports a rich set of mechanisms for handling device failure and data
304 All metadata and data is checksummed, and ZFS automatically repairs bad data
305 from a good copy when corruption is detected.
307 In order to take advantage of these features, a pool must make use of some form
308 of redundancy, using either mirrored or raidz groups.
309 While ZFS supports running in a non-redundant configuration, where each root
310 vdev is simply a disk or file, this is strongly discouraged.
311 A single case of bit corruption can render some or all of your data unavailable.
313 A pool's health status is described by one of three states: online, degraded,
315 An online pool has all devices operating normally.
316 A degraded pool is one in which one or more devices have failed, but the data is
317 still available due to a redundant configuration.
318 A faulted pool has corrupted metadata, or one or more faulted devices, and
319 insufficient replicas to continue functioning.
321 The health of the top-level vdev, such as mirror or raidz device, is
322 potentially impacted by the state of its associated vdevs, or component
324 A top-level vdev or component device is in one of the following states:
325 .Bl -tag -width "DEGRADED"
327 One or more top-level vdevs is in the degraded state because one or more
328 component devices are offline.
329 Sufficient replicas exist to continue functioning.
331 One or more component devices is in the degraded or faulted state, but
332 sufficient replicas exist to continue functioning.
333 The underlying conditions are as follows:
336 The number of checksum errors exceeds acceptable levels and the device is
337 degraded as an indication that something may be wrong.
338 ZFS continues to use the device as necessary.
340 The number of I/O errors exceeds acceptable levels.
341 The device could not be marked as faulted because there are insufficient
342 replicas to continue functioning.
345 One or more top-level vdevs is in the faulted state because one or more
346 component devices are offline.
347 Insufficient replicas exist to continue functioning.
349 One or more component devices is in the faulted state, and insufficient
350 replicas exist to continue functioning.
351 The underlying conditions are as follows:
354 The device could be opened, but the contents did not match expected values.
356 The number of I/O errors exceeds acceptable levels and the device is faulted to
357 prevent further use of the device.
360 The device was explicitly taken offline by the
364 The device is online and functioning.
366 The device was physically removed while the system was running.
367 Device removal detection is hardware-dependent and may not be supported on all
370 The device could not be opened.
371 If a pool is imported when a device was unavailable, then the device will be
372 identified by a unique identifier instead of its path since the path was never
373 correct in the first place.
376 If a device is removed and later re-attached to the system, ZFS attempts
377 to put the device online automatically.
378 Device attach detection is hardware-dependent and might not be supported on all
381 ZFS allows devices to be associated with pools as
383 These devices are not actively used in the pool, but when an active device
384 fails, it is automatically replaced by a hot spare.
385 To create a pool with hot spares, specify a
387 vdev with any number of devices.
390 # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
393 Spares can be shared across multiple pools, and can be added with the
395 command and removed with the
398 Once a spare replacement is initiated, a new
400 vdev is created within the configuration that will remain there until the
401 original device is replaced.
402 At this point, the hot spare becomes available again if another device fails.
404 If a pool has a shared spare that is currently being used, the pool can not be
405 exported since other pools may use this shared spare, which may lead to
406 potential data corruption.
408 An in-progress spare replacement can be cancelled by detaching the hot spare.
409 If the original faulted device is detached, then the hot spare assumes its
410 place in the configuration, and is removed from the spare list of all active
413 Spares cannot replace log devices.
415 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
417 For instance, databases often require their transactions to be on stable storage
418 devices when returning from a system call.
419 NFS and other applications can also use
421 to ensure data stability.
422 By default, the intent log is allocated from blocks within the main pool.
423 However, it might be possible to get better performance using separate intent
424 log devices such as NVRAM or a dedicated disk.
427 # zpool create pool c0d0 c1d0 log c2d0
430 Multiple log devices can also be specified, and they can be mirrored.
433 section for an example of mirroring multiple log devices.
435 Log devices can be added, replaced, attached, detached, and imported and
436 exported as part of the larger pool.
437 Mirrored devices can be removed by specifying the top-level mirror vdev.
439 Devices can be added to a storage pool as
441 These devices provide an additional layer of caching between main memory and
443 For read-heavy workloads, where the working set size is much larger than what
444 can be cached in main memory, using cache devices allow much more of this
445 working set to be served from low latency media.
446 Using cache devices provides the greatest performance improvement for random
447 read-workloads of mostly static content.
449 To create a pool with cache devices, specify a
451 vdev with any number of devices.
454 # zpool create pool c0d0 c1d0 cache c2d0 c3d0
457 Cache devices cannot be mirrored or part of a raidz configuration.
458 If a read error is encountered on a cache device, that read I/O is reissued to
459 the original storage pool device, which might be part of a mirrored or raidz
462 The content of the cache devices is considered volatile, as is the case with
465 Before starting critical procedures that include destructive actions (e.g
467 ), an administrator can checkpoint the pool's state and in the case of a
468 mistake or failure, rewind the entire pool back to the checkpoint.
469 Otherwise, the checkpoint can be discarded when the procedure has completed
472 A pool checkpoint can be thought of as a pool-wide snapshot and should be used
473 with care as it contains every part of the pool's state, from properties to vdev
475 Thus, while a pool has a checkpoint certain operations are not allowed.
476 Specifically, vdev removal/attach/detach, mirror splitting, and
477 changing the pool's guid.
478 Adding a new vdev is supported but in the case of a rewind it will have to be
480 Finally, users of this feature should keep in mind that scrubs in a pool that
481 has a checkpoint do not repair checkpointed data.
483 To create a checkpoint for a pool:
485 # zpool checkpoint pool
488 To later rewind to its checkpointed state, you need to first export it and
489 then rewind it during import:
492 # zpool import --rewind-to-checkpoint pool
495 To discard the checkpoint from a pool:
497 # zpool checkpoint -d pool
500 Dataset reservations (controlled by the
504 zfs properties) may be unenforceable while a checkpoint exists, because the
505 checkpoint is allowed to consume the dataset's reservation.
506 Finally, data that is part of the checkpoint but has been freed in the
507 current state of the pool won't be scanned during a scrub.
509 Each pool has several properties associated with it.
510 Some properties are read-only statistics while others are configurable and
511 change the behavior of the pool.
513 The following are read-only properties:
516 Amount of storage space used within the pool.
518 The size of the system boot partition.
519 This property can only be set at pool creation time and is read-only once pool
521 Setting this property implies using the
525 Percentage of pool space used.
526 This property can also be referred to by its shortened column name,
529 Amount of uninitialized space within the pool or device that can be used to
530 increase the total capacity of the pool.
531 Uninitialized space consists of any space on an EFI labeled vdev which has not
534 .Nm zpool Cm online Fl e
536 This space occurs when a LUN is dynamically expanded.
538 The amount of fragmentation in the pool.
540 The amount of free space available in the pool.
542 After a file system or snapshot is destroyed, the space it was using is
543 returned to the pool asynchronously.
545 is the amount of space remaining to be reclaimed.
552 The current health of the pool.
554 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
556 A unique identifier for the pool.
558 Total size of the storage pool.
559 .It Sy unsupported@ Ns Em feature_guid
560 Information about unsupported features that are enabled on the pool.
566 The space usage properties report actual physical space available to the
568 The physical space can be different from the total amount of space that any
569 contained datasets can actually use.
570 The amount of space used in a raidz configuration depends on the characteristics
571 of the data being written.
572 In addition, ZFS reserves some space for internal accounting that the
574 command takes into account, but the
577 For non-full pools of a reasonable size, these effects should be invisible.
578 For small pools, or pools that are close to being completely full, these
579 discrepancies may become more noticeable.
581 The following property can be set at creation time and import time:
584 Alternate root directory.
585 If set, this directory is prepended to any mount points within the pool.
586 This can be used when examining an unknown pool where the mount points cannot be
587 trusted, or in an alternate boot environment, where the typical paths are not
590 is not a persistent property.
591 It is valid only while the system is up.
595 .Sy cachefile Ns = Ns Sy none ,
596 though this may be overridden using an explicit setting.
599 The following property can be set only at import time:
601 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
604 the pool will be imported in read-only mode.
605 This property can also be referred to by its shortened column name,
609 The following properties can be set at creation time and import time, and later
614 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
615 Controls automatic pool expansion when the underlying LUN is grown.
618 the pool will be resized according to the size of the expanded device.
619 If the device is part of a mirror or raidz then all devices within that
620 mirror/raidz group must be expanded before the new space is made available to
622 The default behavior is
624 This property can also be referred to by its shortened column name,
626 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
627 Controls automatic device replacement.
630 device replacement must be initiated by the administrator by using the
635 any new device, found in the same physical location as a device that previously
636 belonged to the pool, is automatically formatted and replaced.
637 The default behavior is
639 This property can also be referred to by its shortened column name,
641 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
642 Identifies the default bootable dataset for the root pool.
643 This property is expected to be set mainly by the installation and upgrade
645 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
646 Controls the location of where the pool configuration is cached.
647 Discovering all pools on system startup requires a cached copy of the
648 configuration data that is stored on the root file system.
649 All pools in this cache are automatically imported when the system boots.
650 Some environments, such as install and clustering, need to cache this
651 information in a different location so that pools are not automatically
653 Setting this property caches the pool configuration in a different location that
654 can later be imported with
655 .Nm zpool Cm import Fl c .
656 Setting it to the special value
658 creates a temporary pool that is never cached, and the special value
661 uses the default location.
663 Multiple pools can share the same cache file.
664 Because the kernel destroys and recreates this file when pools are added and
665 removed, care should be taken when attempting to access this file.
666 When the last pool using a
668 is exported or destroyed, the file is removed.
669 .It Sy comment Ns = Ns Ar text
670 A text string consisting of printable ASCII characters that will be stored
671 such that it is available even if the pool becomes faulted.
672 An administrator can provide additional information about a pool using this
674 .It Sy dedupditto Ns = Ns Ar number
675 Threshold for the number of block ditto copies.
676 If the reference count for a deduplicated block increases above this number, a
677 new ditto copy of this block is automatically stored.
678 The default setting is
680 which causes no ditto copies to be created for deduplicated blocks.
681 The minimum legal nonzero setting is
683 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
684 Controls whether a non-privileged user is granted access based on the dataset
685 permissions defined on the dataset.
688 for more information on ZFS delegated administration.
689 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
690 Controls the system behavior in the event of catastrophic pool failure.
691 This condition is typically a result of a loss of connectivity to the underlying
692 storage device(s) or a failure of all devices within the pool.
693 The behavior of such an event is determined as follows:
694 .Bl -tag -width "continue"
696 Blocks all I/O access until the device connectivity is recovered and the errors
698 This is the default behavior.
702 to any new write I/O requests but allows reads to any of the remaining healthy
704 Any write requests that have yet to be committed to disk would be blocked.
706 Prints out a message to the console and generates a system crash dump.
708 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
709 The value of this property is the current state of
711 The only valid value when setting this property is
715 to the enabled state.
718 for details on feature states.
719 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
720 Controls whether information about snapshots associated with this pool is
728 This property can also be referred to by its shortened name,
730 .It Sy version Ns = Ns Ar version
731 The current on-disk version of the pool.
732 This can be increased, but never decreased.
733 The preferred method of updating pools is with the
735 command, though this property can be used when a specific version is needed for
736 backwards compatibility.
737 Once feature flags are enabled on a pool this property will no longer have a
741 All subcommands that modify state are logged persistently to the pool in their
746 command provides subcommands to create and destroy storage pools, add capacity
747 to storage pools, and provide information about the storage pools.
748 The following subcommands are supported:
754 Displays a help message.
761 Adds the specified virtual devices to the given pool.
764 specification is described in the
769 option, and the device checks performed are described in the
776 even if they appear in use or specify a conflicting replication level.
777 Not all devices can be overridden in this manner.
779 Displays the configuration that would be used without actually adding the
781 The actual pool creation can still fail due to insufficient privileges or
788 .Ar pool device new_device
794 The existing device cannot be part of a raidz configuration.
797 is not currently part of a mirrored configuration,
799 automatically transforms into a two-way mirror of
805 is part of a two-way mirror, attaching
807 creates a three-way mirror, and so on.
810 begins to resilver immediately.
815 even if its appears to be in use.
816 Not all devices can be overridden in this manner.
824 Checkpoints the current state of
826 , which can be later restored by
827 .Nm zpool Cm import --rewind-to-checkpoint .
828 The existence of a checkpoint in a pool prohibits the following
837 In addition, it may break reservation boundaries if the pool lacks free
841 command indicates the existence of a checkpoint or the progress of discarding a
842 checkpoint from a pool.
845 command reports how much space the checkpoint takes from the pool.
848 Discards an existing checkpoint from
857 Clears device errors in a pool.
858 If no arguments are specified, all device errors within the pool are cleared.
859 If one or more devices is specified, only those errors associated with the
860 specified device or devices are cleared.
866 .Op Fl m Ar mountpoint
867 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
868 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
872 Creates a new storage pool containing the virtual devices specified on the
874 The pool name must begin with a letter, and can only contain
875 alphanumeric characters as well as underscore
887 are reserved, as are names beginning with the pattern
891 specification is described in the
895 The command verifies that each device specified is accessible and not currently
896 in use by another subsystem.
897 There are some uses, such as being currently mounted, or specified as the
898 dedicated dump device, that prevents a device from ever being used by ZFS.
899 Other uses, such as having a preexisting UFS file system, can be overridden with
904 The command also checks that the replication strategy for the pool is
906 An attempt to combine redundant and non-redundant storage in a single pool, or
907 to mix disks and files, results in an error unless
910 The use of differently sized devices within a single raidz or mirror group is
911 also flagged as an error unless
917 option is specified, the default mount point is
919 The mount point must not exist or must be empty, or else the root dataset
921 This can be overridden with the
925 By default all supported features are enabled on the new pool unless the
930 Create whole disk pool with EFI System partition to support booting system
932 Default size is 256MB.
933 To create boot partition with custom size, set the
942 Do not enable any features on the new pool.
943 Individual features can be enabled by setting their corresponding properties to
950 for details about feature properties.
954 even if they appear in use or specify a conflicting replication level.
955 Not all devices can be overridden in this manner.
956 .It Fl m Ar mountpoint
957 Sets the mount point for the root dataset.
958 The default mount point is
965 The mount point must be an absolute path,
969 For more information on dataset mount points, see
972 Displays the configuration that would be used without actually creating the
974 The actual pool creation can still fail due to insufficient privileges or
976 .It Fl o Ar property Ns = Ns Ar value
977 Sets the given pool properties.
980 section for a list of valid properties that can be set.
981 .It Fl O Ar file-system-property Ns = Ns Ar value
982 Sets the given file system properties in the root file system of the pool.
987 for a list of valid properties that can be set.
990 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
998 Destroys the given pool, freeing up any devices for other use.
999 This command tries to unmount any active datasets before destroying the pool.
1002 Forces any active datasets contained within the pool to be unmounted.
1012 The operation is refused if there are no other valid replicas of the data.
1019 Exports the given pools from the system.
1020 All devices are marked as exported, but are still considered in use by other
1022 The devices can be moved between systems
1023 .Pq even those of different endianness
1024 and imported as long as a sufficient number of devices are present.
1026 Before exporting the pool, all datasets within the pool are unmounted.
1027 A pool can not be exported if it has a shared spare that is currently being
1030 For pools to be portable, you must give the
1032 command whole disks, not just slices, so that ZFS can label the disks with
1033 portable EFI labels.
1034 Otherwise, disk drivers on platforms of different endianness will not recognize
1038 Forcefully unmount all datasets, using the
1042 This command will forcefully export the pool even if it has a shared spare that
1043 is currently being used.
1044 This may lead to potential data corruption.
1050 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1051 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1054 Retrieves the given list of properties
1056 or all properties if
1060 for the specified storage pool(s).
1061 These properties are displayed with the following fields:
1063 name Name of storage pool
1064 property Property name
1065 value Property value
1066 source Property source, either 'default' or 'local'.
1071 section for more information on the available pool properties.
1075 Do not display headers, and separate fields by a single tab instead of arbitrary
1078 A comma-separated list of columns to display.
1079 .Sy name Ns , Ns Sy property Ns , Ns Sy value Ns , Ns Sy source
1080 is the default value.
1082 Display numbers in parsable (exact) values.
1088 .Oo Ar pool Oc Ns ...
1090 Displays the command history of the specified pool(s) or all pools if no pool is
1094 Displays internally logged ZFS events in addition to user initiated events.
1096 Displays log records in long format, which in addition to standard format
1097 includes, the user name, the hostname, and the zone in which the operation was
1106 Lists pools available to import.
1109 option is not specified, this command searches for devices in
1113 option can be specified multiple times, and all directories are searched.
1114 If the device appears to be part of an exported pool, this command displays a
1115 summary of the pool with the name of the pool, a numeric identifier, as well as
1116 the vdev layout and current health of the device for each device or file.
1117 Destroyed pools, pools that were previously destroyed with the
1118 .Nm zpool Cm destroy
1119 command, are not listed unless the
1121 option is specified.
1123 The numeric identifier is unique, and can be used instead of the pool name when
1124 multiple exported pools of the same name are available.
1126 .It Fl c Ar cachefile
1127 Reads configuration from the given
1129 that was created with the
1134 is used instead of searching for devices.
1136 Searches for devices or files in
1140 option can be specified multiple times.
1142 Lists destroyed pools only.
1150 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1152 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1155 Imports all pools found in the search directories.
1156 Identical to the previous command, except that all pools with a sufficient
1157 number of devices available are imported.
1158 Destroyed pools, pools that were previously destroyed with the
1159 .Nm zpool Cm destroy
1160 command, will not be imported unless the
1162 option is specified.
1165 Searches for and imports all pools found.
1166 .It Fl c Ar cachefile
1167 Reads configuration from the given
1169 that was created with the
1174 is used instead of searching for devices.
1176 Searches for devices or files in
1180 option can be specified multiple times.
1181 This option is incompatible with the
1185 Imports destroyed pools only.
1188 option is also required.
1190 Forces import, even if the pool appears to be potentially active.
1192 Recovery mode for a non-importable pool.
1193 Attempt to return the pool to an importable state by discarding the last few
1195 Not all damaged pools can be recovered by using this option.
1196 If successful, the data from the discarded transactions is irretrievably lost.
1197 This option is ignored if the pool is importable or already imported.
1199 Allows a pool to import when there is a missing log device.
1200 Recent transactions can be lost because the log device will be discarded.
1205 Determines whether a non-importable pool can be made importable again, but does
1206 not actually perform the pool recovery.
1207 For more details about pool recovery mode, see the
1211 Import the pool without mounting any file systems.
1213 Comma-separated list of mount options to use when mounting datasets within the
1217 for a description of dataset properties and mount options.
1218 .It Fl o Ar property Ns = Ns Ar value
1219 Sets the specified property on the imported pool.
1222 section for more information on the available pool properties.
1238 .Op Fl -rewind-to-checkpoint
1239 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1241 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1243 .Ar pool Ns | Ns Ar id
1246 Imports a specific pool.
1247 A pool can be identified by its name or the numeric identifier.
1250 is specified, the pool is imported using the name
1252 Otherwise, it is imported with the same name as its exported name.
1254 If a device is removed from a system without running
1256 first, the device appears as potentially active.
1257 It cannot be determined if this was a failed export, or whether the device is
1258 really in use from another host.
1259 To import a pool in this state, the
1263 .It Fl c Ar cachefile
1264 Reads configuration from the given
1266 that was created with the
1271 is used instead of searching for devices.
1273 Searches for devices or files in
1277 option can be specified multiple times.
1278 This option is incompatible with the
1282 Imports destroyed pool.
1285 option is also required.
1287 Forces import, even if the pool appears to be potentially active.
1289 Recovery mode for a non-importable pool.
1290 Attempt to return the pool to an importable state by discarding the last few
1292 Not all damaged pools can be recovered by using this option.
1293 If successful, the data from the discarded transactions is irretrievably lost.
1294 This option is ignored if the pool is importable or already imported.
1296 Allows a pool to import when there is a missing log device.
1297 Recent transactions can be lost because the log device will be discarded.
1302 Determines whether a non-importable pool can be made importable again, but does
1303 not actually perform the pool recovery.
1304 For more details about pool recovery mode, see the
1308 Comma-separated list of mount options to use when mounting datasets within the
1312 for a description of dataset properties and mount options.
1313 .It Fl o Ar property Ns = Ns Ar value
1314 Sets the specified property on the imported pool.
1317 section for more information on the available pool properties.
1327 .It Fl -rewind-to-checkpoint
1328 Rewinds pool to the checkpointed state.
1329 Once the pool is imported with this flag there is no way to undo the rewind.
1330 All changes and data that were written after the checkpoint are lost!
1331 The only exception is when the
1333 mounting option is enabled.
1334 In this case, the checkpointed state of the pool is opened and an
1335 administrator can see how the pool would look like if they were
1343 .Op Ar device Ns ...
1345 Begins initializing by writing to all unallocated regions on the specified
1346 devices, or all eligible devices in the pool if no individual devices are
1348 Only leaf data or log devices may be initialized.
1351 Cancel initializing on the specified devices, or all eligible devices if none
1353 If one or more target devices are invalid or are not currently being
1354 initialized, the command will fail and no cancellation will occur on any device.
1356 Suspend initializing on the specified devices, or all eligible devices if none
1358 If one or more target devices are invalid or are not currently being
1359 initialized, the command will fail and no suspension will occur on any device.
1360 Initializing can then be resumed by running
1361 .Nm zpool Cm initialize
1362 with no flags on the relevant target devices.
1368 .Op Fl T Sy u Ns | Ns Sy d
1369 .Oo Ar pool Oc Ns ...
1370 .Op Ar interval Op Ar count
1372 Displays I/O statistics for the given pools.
1375 the statistics are printed every
1377 seconds until ^C is pressed.
1380 are specified, statistics for every pool in the system is shown.
1383 is specified, the command exits after
1385 reports are printed.
1387 .It Fl T Sy u Ns | Ns Sy d
1388 Display a time stamp.
1391 for a printed representation of the internal representation of time.
1396 for standard date format.
1400 Verbose statistics Reports usage statistics for individual vdevs within the
1401 pool, in addition to the pool-wide statistics.
1409 Removes ZFS label information from the specified
1413 must not be part of an active pool configuration.
1416 Treat exported or foreign devices as inactive.
1422 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1423 .Op Fl T Sy u Ns | Ns Sy d
1424 .Oo Ar pool Oc Ns ...
1425 .Op Ar interval Op Ar count
1427 Lists the given pools along with a health status and space usage.
1430 are specified, all pools in the system are listed.
1433 the information is printed every
1435 seconds until ^C is pressed.
1438 is specified, the command exits after
1440 reports are printed.
1444 Do not display headers, and separate fields by a single tab instead of arbitrary
1446 .It Fl o Ar property
1447 Comma-separated list of properties to display.
1450 section for a list of valid properties.
1452 .Cm name , size , allocated , free , expandsize , fragmentation , capacity ,
1453 .Cm dedupratio , health , altroot .
1455 Display numbers in parsable
1458 .It Fl T Sy u Ns | Ns Sy d
1459 Display a time stamp.
1462 for a printed representation of the internal representation of time.
1467 for standard date format.
1472 Reports usage statistics for individual vdevs within the pool, in addition to
1473 the pool-wise statistics.
1479 .Ar pool Ar device Ns ...
1481 Takes the specified physical device offline.
1484 is offline, no attempt is made to read or write to the device.
1485 This command is not applicable to spares.
1489 Upon reboot, the specified physical device reverts to its previous state.
1495 .Ar pool Ar device Ns ...
1497 Brings the specified physical device online.
1498 This command is not applicable to spares.
1501 Expand the device to use all available space.
1502 If the device is part of a mirror or raidz then all devices must be expanded
1503 before the new space will become available to the pool.
1510 Generates a new unique identifier for the pool.
1511 You must ensure that all devices in this pool are online and healthy before
1512 performing this action.
1518 Reopen all the vdevs associated with the pool.
1523 .Ar pool Ar device Ns ...
1525 Removes the specified device from the pool.
1526 This command currently only supports removing hot spares, cache, log
1527 devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
1529 Removing a top-level vdev reduces the total amount of space in the storage pool.
1530 The specified device will be evacuated by copying all allocated space from it to
1531 the other devices in the pool.
1534 command initiates the removal and returns, while the evacuation continues in
1536 The removal progress can be monitored with
1537 .Nm zpool Cm status.
1538 This feature must be enabled to be used, see
1539 .Xr zpool-features 5
1541 A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
1543 Non-log devices or data devices that are part of a mirrored configuration can be removed using
1549 Do not actually perform the removal ("no-op").
1550 Instead, print the estimated amount of memory that will be used by the
1551 mapping table after the removal completes.
1552 This is nonzero only for top-level vdevs.
1556 Used in conjunction with the
1558 flag, displays numbers as parsable (exact) values.
1566 Stops and cancels an in-progress removal of a top-level vdev.
1571 .Ar pool Ar device Op Ar new_device
1577 This is equivalent to attaching
1579 waiting for it to resilver, and then detaching
1584 must be greater than or equal to the minimum size of all the devices in a mirror
1585 or raidz configuration.
1588 is required if the pool is not redundant.
1591 is not specified, it defaults to
1593 This form of replacement is useful after an existing disk has failed and has
1594 been physically replaced.
1595 In this case, the new disk may have the same
1597 path as the old device, even though it is actually a different disk.
1598 ZFS recognizes this.
1603 even if its appears to be in use.
1604 Not all devices can be overridden in this manner.
1612 Begins a scrub or resumes a paused scrub.
1613 The scrub examines all data in the specified pools to verify that it checksums
1617 devices, ZFS automatically repairs any damage discovered during the scrub.
1620 command reports the progress of the scrub and summarizes the results of the
1621 scrub upon completion.
1623 Scrubbing and resilvering are very similar operations.
1624 The difference is that resilvering only examines data that ZFS knows to be out
1627 for example, when attaching a new device to a mirror or replacing an existing
1630 whereas scrubbing examines all data to discover silent errors due to hardware
1631 faults or disk failure.
1633 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1635 If a scrub is paused, the
1638 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1647 Scrub pause state and progress are periodically synced to disk.
1648 If the system is restarted or pool is exported during a paused scrub,
1649 even after import, scrub will remain paused until it is resumed.
1650 Once resumed the scrub will pick up from the place where it was last
1651 checkpointed to disk.
1652 To resume a paused scrub issue
1659 .Ar property Ns = Ns Ar value
1662 Sets the given property on the specified pool.
1665 section for more information on what properties can be set and acceptable
1671 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1682 At the time of the split,
1684 will be a replica of
1688 Do dry run, do not actually perform the split.
1689 Print out the expected configuration of
1691 .It Fl o Ar property Ns = Ns Ar value
1692 Sets the specified property for
1696 section for more information on the available pool properties.
1704 and automatically import it.
1710 .Op Fl T Sy u Ns | Ns Sy d
1711 .Oo Ar pool Oc Ns ...
1712 .Op Ar interval Op Ar count
1714 Displays the detailed health status for the given pools.
1717 is specified, then the status of each pool in the system is displayed.
1718 For more information on pool and device health, see the
1719 .Sx Device Failure and Recovery
1722 If a scrub or resilver is in progress, this command reports the percentage done
1723 and the estimated time to completion.
1724 Both of these are only approximate, because the amount of data in the pool and
1725 the other workloads on the system can change.
1728 Display a histogram of deduplication statistics, showing the allocated
1729 .Pq physically present on disk
1731 .Pq logically referenced in the pool
1732 block counts and sizes by reference count.
1733 .It Fl T Sy u Ns | Ns Sy d
1734 Display a time stamp.
1737 for a printed representation of the internal representation of time.
1742 for standard date format.
1746 Displays verbose data error information, printing out a complete list of all
1747 data errors since the last complete pool scrub.
1749 Only display status for pools that are exhibiting errors or are otherwise
1751 Warnings about pools not using the latest on-disk format will not be included.
1757 Displays pools which do not have all supported features enabled and pools
1758 formatted using a legacy ZFS version number.
1759 These pools can continue to be used, but some features may not be available.
1761 .Nm zpool Cm upgrade Fl a
1762 to enable all features on all pools.
1768 Displays legacy ZFS versions supported by the current software.
1770 .Xr zpool-features 5
1771 for a description of feature flags features supported by the current software.
1776 .Fl a Ns | Ns Ar pool Ns ...
1778 Enables all supported features on the given pool.
1779 Once this is done, the pool will no longer be accessible on systems that do not
1780 support feature flags.
1782 .Xr zpool-features 5
1783 for details on compatibility with systems that support feature flags, but do not
1784 support all features enabled on the pool.
1787 Enables all supported features on all pools.
1789 Upgrade to the specified legacy version.
1792 flag is specified, no features will be enabled on the pool.
1793 This option can only be used to increase the version number up to the last
1794 supported legacy version number.
1798 The following exit values are returned:
1801 Successful completion.
1805 Invalid command line options were specified.
1809 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1810 The following command creates a pool with a single raidz root vdev that
1811 consists of six disks.
1813 # zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0
1815 .It Sy Example 2 No Creating a Mirrored Storage Pool
1816 The following command creates a pool with two mirrors, where each mirror
1819 # zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0
1821 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Slices
1822 The following command creates an unmirrored pool using two disk slices.
1824 # zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4
1826 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
1827 The following command creates an unmirrored pool using files.
1828 While not recommended, a pool based on files can be useful for experimental
1831 # zpool create tank /path/to/file/a /path/to/file/b
1833 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
1834 The following command adds two mirrored disks to the pool
1836 assuming the pool is already made up of two-way mirrors.
1837 The additional space is immediately available to any datasets within the pool.
1839 # zpool add tank mirror c1t0d0 c1t1d0
1841 .It Sy Example 6 No Listing Available ZFS Storage Pools
1842 The following command lists all available pools on the system.
1843 In this case, the pool
1845 is faulted due to a missing device.
1846 The results from this command are similar to the following:
1849 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1850 rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE -
1851 tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE -
1852 zion - - - - - - - FAULTED -
1854 .It Sy Example 7 No Destroying a ZFS Storage Pool
1855 The following command destroys the pool
1857 and any datasets contained within.
1859 # zpool destroy -f tank
1861 .It Sy Example 8 No Exporting a ZFS Storage Pool
1862 The following command exports the devices in pool
1864 so that they can be relocated or later imported.
1868 .It Sy Example 9 No Importing a ZFS Storage Pool
1869 The following command displays available pools, and then imports the pool
1871 for use on the system.
1872 The results from this command are similar to the following:
1876 id: 15451357997522795478
1878 action: The pool can be imported using its name or numeric identifier.
1888 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
1889 The following command upgrades all ZFS Storage pools to the current version of
1893 This system is currently running ZFS version 2.
1895 .It Sy Example 11 No Managing Hot Spares
1896 The following command creates a new pool with an available hot spare:
1898 # zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0
1901 If one of the disks were to fail, the pool would be reduced to the degraded
1903 The failed device can be replaced using the following command:
1905 # zpool replace tank c0t0d0 c0t3d0
1908 Once the data has been resilvered, the spare is automatically removed and is
1909 made available for use should another device fail.
1910 The hot spare can be permanently removed from the pool using the following
1913 # zpool remove tank c0t2d0
1915 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
1916 The following command creates a ZFS storage pool consisting of two, two-way
1917 mirrors and mirrored log devices:
1919 # zpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
1922 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
1923 The following command adds two disks for use as cache devices to a ZFS storage
1926 # zpool add pool cache c2d0 c3d0
1929 Once added, the cache devices gradually fill with content from main memory.
1930 Depending on the size of your cache devices, it could take over an hour for
1932 Capacity and reads can be monitored using the
1936 # zpool iostat -v pool 5
1938 .It Sy Example 14 No Removing a Mirrored top-level (Log or Data) Device
1939 The following commands remove the mirrored log device
1941 and mirrored top-level data device
1944 Given this configuration:
1948 scrub: none requested
1951 NAME STATE READ WRITE CKSUM
1953 mirror-0 ONLINE 0 0 0
1956 mirror-1 ONLINE 0 0 0
1960 mirror-2 ONLINE 0 0 0
1965 The command to remove the mirrored log
1969 # zpool remove tank mirror-2
1972 The command to remove the mirrored data
1976 # zpool remove tank mirror-1
1978 .It Sy Example 15 No Displaying expanded space on a device
1979 The following command displays the detailed information for the pool
1981 This pool is comprised of a single raidz vdev where one of its devices
1982 increased its capacity by 10GB.
1983 In this example, the pool will not be able to utilize this extra capacity until
1984 all the devices under the raidz vdev have been expanded.
1986 # zpool list -v data
1987 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1988 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
1989 raidz1 23.9G 14.6G 9.30G 48% -
1995 .Sh INTERFACE STABILITY
2000 .Xr zpool-features 5