4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
22 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23 .\" Copyright (c) 2013 by Delphix. All rights reserved.
24 .\" Copyright 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
53 .Op Fl m Ar mountpoint
54 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
55 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
72 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
73 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
88 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
90 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
96 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
98 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
100 .Ar pool Ns | Ns Ar id
105 .Op Fl T Sy u Ns | Ns Sy d
106 .Oo Ar pool Oc Ns ...
107 .Op Ar interval Op Ar count
115 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
116 .Op Fl T Sy u Ns | Ns Sy d
117 .Oo Ar pool Oc Ns ...
118 .Op Ar interval Op Ar count
122 .Ar pool Ar device Ns ...
126 .Ar pool Ar device Ns ...
135 .Ar pool Ar device Ns ...
139 .Ar pool Ar device Op Ar new_device
146 .Ar property Ns = Ns Ar value
151 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
157 .Op Fl T Sy u Ns | Ns Sy d
158 .Oo Ar pool Oc Ns ...
159 .Op Ar interval Op Ar count
168 .Fl a Ns | Ns Ar pool Ns ...
172 command configures ZFS storage pools.
173 A storage pool is a collection of devices that provides physical storage and
174 data replication for ZFS datasets.
175 All datasets within a storage pool share the same space.
178 for information on managing datasets.
179 .Ss Virtual Devices (vdevs)
180 A "virtual device" describes a single device or a collection of devices
181 organized according to certain performance and fault characteristics.
182 The following virtual devices are supported:
185 A block device, typically located under
187 ZFS can use individual slices or partitions, though the recommended mode of
188 operation is to use whole disks.
189 A disk can be specified by a full path, or it can be a shorthand name
190 .Po the relative portion of the path under
193 A whole disk can be specified by omitting the slice or partition designation.
197 .Pa /dev/dsk/c0t0d0s2 .
198 When given a whole disk, ZFS automatically labels the disk, if necessary.
201 The use of files as a backing store is strongly discouraged.
202 It is designed primarily for experimental purposes, as the fault tolerance of a
203 file is only as good as the file system of which it is a part.
204 A file must be specified by a full path.
206 A mirror of two or more devices.
207 Data is replicated in an identical fashion across all components of a mirror.
208 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
209 failing before data integrity is compromised.
210 .It Sy raidz , raidz1 , raidz2 , raidz3
211 A variation on RAID-5 that allows for better distribution of parity and
212 eliminates the RAID-5
214 .Pq in which data and parity become inconsistent after a power loss .
215 Data and parity is striped across all disks within a raidz group.
217 A raidz group can have single-, double-, or triple-parity, meaning that the
218 raidz group can sustain one, two, or three failures, respectively, without
222 vdev type specifies a single-parity raidz group; the
224 vdev type specifies a double-parity raidz group; and the
226 vdev type specifies a triple-parity raidz group.
229 vdev type is an alias for
232 A raidz group with N disks of size X with P parity disks can hold approximately
233 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
235 The minimum number of devices in a raidz group is one more than the number of
237 The recommended number is between 3 and 9 to help increase performance.
239 A special pseudo-vdev which keeps track of available hot spares for a pool.
240 For more information, see the
244 A separate intent log device.
245 If more than one log device is specified, then writes are load-balanced between
247 Log devices can be mirrored.
248 However, raidz vdev types are not supported for the intent log.
249 For more information, see the
253 A device used to cache storage pool data.
254 A cache device cannot be configured as a mirror or raidz group.
255 For more information, see the
260 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
261 contain files or disks.
263 .Pq or other combinations
266 A pool can have any number of virtual devices at the top of the configuration
270 Data is dynamically distributed across all top-level devices to balance data
272 As new virtual devices are added, ZFS automatically places data on the newly
275 Virtual devices are specified one at a time on the command line, separated by
281 are used to distinguish where a group ends and another begins.
282 For example, the following creates two root vdevs, each a mirror of two disks:
284 # zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0
286 .Ss Device Failure and Recovery
287 ZFS supports a rich set of mechanisms for handling device failure and data
289 All metadata and data is checksummed, and ZFS automatically repairs bad data
290 from a good copy when corruption is detected.
292 In order to take advantage of these features, a pool must make use of some form
293 of redundancy, using either mirrored or raidz groups.
294 While ZFS supports running in a non-redundant configuration, where each root
295 vdev is simply a disk or file, this is strongly discouraged.
296 A single case of bit corruption can render some or all of your data unavailable.
298 A pool's health status is described by one of three states: online, degraded,
300 An online pool has all devices operating normally.
301 A degraded pool is one in which one or more devices have failed, but the data is
302 still available due to a redundant configuration.
303 A faulted pool has corrupted metadata, or one or more faulted devices, and
304 insufficient replicas to continue functioning.
306 The health of the top-level vdev, such as mirror or raidz device, is
307 potentially impacted by the state of its associated vdevs, or component
309 A top-level vdev or component device is in one of the following states:
310 .Bl -tag -width "DEGRADED"
312 One or more top-level vdevs is in the degraded state because one or more
313 component devices are offline.
314 Sufficient replicas exist to continue functioning.
316 One or more component devices is in the degraded or faulted state, but
317 sufficient replicas exist to continue functioning.
318 The underlying conditions are as follows:
321 The number of checksum errors exceeds acceptable levels and the device is
322 degraded as an indication that something may be wrong.
323 ZFS continues to use the device as necessary.
325 The number of I/O errors exceeds acceptable levels.
326 The device could not be marked as faulted because there are insufficient
327 replicas to continue functioning.
330 One or more top-level vdevs is in the faulted state because one or more
331 component devices are offline.
332 Insufficient replicas exist to continue functioning.
334 One or more component devices is in the faulted state, and insufficient
335 replicas exist to continue functioning.
336 The underlying conditions are as follows:
339 The device could be opened, but the contents did not match expected values.
341 The number of I/O errors exceeds acceptable levels and the device is faulted to
342 prevent further use of the device.
345 The device was explicitly taken offline by the
349 The device is online and functioning.
351 The device was physically removed while the system was running.
352 Device removal detection is hardware-dependent and may not be supported on all
355 The device could not be opened.
356 If a pool is imported when a device was unavailable, then the device will be
357 identified by a unique identifier instead of its path since the path was never
358 correct in the first place.
361 If a device is removed and later re-attached to the system, ZFS attempts
362 to put the device online automatically.
363 Device attach detection is hardware-dependent and might not be supported on all
366 ZFS allows devices to be associated with pools as
368 These devices are not actively used in the pool, but when an active device
369 fails, it is automatically replaced by a hot spare.
370 To create a pool with hot spares, specify a
372 vdev with any number of devices.
375 # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
378 Spares can be shared across multiple pools, and can be added with the
380 command and removed with the
383 Once a spare replacement is initiated, a new
385 vdev is created within the configuration that will remain there until the
386 original device is replaced.
387 At this point, the hot spare becomes available again if another device fails.
389 If a pool has a shared spare that is currently being used, the pool can not be
390 exported since other pools may use this shared spare, which may lead to
391 potential data corruption.
393 An in-progress spare replacement can be cancelled by detaching the hot spare.
394 If the original faulted device is detached, then the hot spare assumes its
395 place in the configuration, and is removed from the spare list of all active
398 Spares cannot replace log devices.
400 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
402 For instance, databases often require their transactions to be on stable storage
403 devices when returning from a system call.
404 NFS and other applications can also use
406 to ensure data stability.
407 By default, the intent log is allocated from blocks within the main pool.
408 However, it might be possible to get better performance using separate intent
409 log devices such as NVRAM or a dedicated disk.
412 # zpool create pool c0d0 c1d0 log c2d0
415 Multiple log devices can also be specified, and they can be mirrored.
418 section for an example of mirroring multiple log devices.
420 Log devices can be added, replaced, attached, detached, and imported and
421 exported as part of the larger pool.
422 Mirrored log devices can be removed by specifying the top-level mirror for the
425 Devices can be added to a storage pool as
427 These devices provide an additional layer of caching between main memory and
429 For read-heavy workloads, where the working set size is much larger than what
430 can be cached in main memory, using cache devices allow much more of this
431 working set to be served from low latency media.
432 Using cache devices provides the greatest performance improvement for random
433 read-workloads of mostly static content.
435 To create a pool with cache devices, specify a
437 vdev with any number of devices.
440 # zpool create pool c0d0 c1d0 cache c2d0 c3d0
443 Cache devices cannot be mirrored or part of a raidz configuration.
444 If a read error is encountered on a cache device, that read I/O is reissued to
445 the original storage pool device, which might be part of a mirrored or raidz
448 The content of the cache devices is considered volatile, as is the case with
451 Each pool has several properties associated with it.
452 Some properties are read-only statistics while others are configurable and
453 change the behavior of the pool.
455 The following are read-only properties:
458 Amount of storage available within the pool.
459 This property can also be referred to by its shortened column name,
462 The size of the system boot partition.
463 This property can only be set at pool creation time and is read-only once pool
465 Setting this property implies using the
469 Percentage of pool space used.
470 This property can also be referred to by its shortened column name,
473 Amount of uninitialized space within the pool or device that can be used to
474 increase the total capacity of the pool.
475 Uninitialized space consists of any space on an EFI labeled vdev which has not
478 .Nm zpool Cm online Fl e
480 This space occurs when a LUN is dynamically expanded.
482 The amount of fragmentation in the pool.
484 The amount of free space available in the pool.
486 After a file system or snapshot is destroyed, the space it was using is
487 returned to the pool asynchronously.
489 is the amount of space remaining to be reclaimed.
496 The current health of the pool.
498 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
500 A unique identifier for the pool.
502 Total size of the storage pool.
503 .It Sy unsupported@ Ns Em feature_guid
504 Information about unsupported features that are enabled on the pool.
509 Amount of storage space used within the pool.
512 The space usage properties report actual physical space available to the
514 The physical space can be different from the total amount of space that any
515 contained datasets can actually use.
516 The amount of space used in a raidz configuration depends on the characteristics
517 of the data being written.
518 In addition, ZFS reserves some space for internal accounting that the
520 command takes into account, but the
523 For non-full pools of a reasonable size, these effects should be invisible.
524 For small pools, or pools that are close to being completely full, these
525 discrepancies may become more noticeable.
527 The following property can be set at creation time and import time:
530 Alternate root directory.
531 If set, this directory is prepended to any mount points within the pool.
532 This can be used when examining an unknown pool where the mount points cannot be
533 trusted, or in an alternate boot environment, where the typical paths are not
536 is not a persistent property.
537 It is valid only while the system is up.
541 .Sy cachefile Ns = Ns Sy none ,
542 though this may be overridden using an explicit setting.
545 The following property can be set only at import time:
547 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
550 the pool will be imported in read-only mode.
551 This property can also be referred to by its shortened column name,
555 The following properties can be set at creation time and import time, and later
560 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
561 Controls automatic pool expansion when the underlying LUN is grown.
564 the pool will be resized according to the size of the expanded device.
565 If the device is part of a mirror or raidz then all devices within that
566 mirror/raidz group must be expanded before the new space is made available to
568 The default behavior is
570 This property can also be referred to by its shortened column name,
572 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
573 Controls automatic device replacement.
576 device replacement must be initiated by the administrator by using the
581 any new device, found in the same physical location as a device that previously
582 belonged to the pool, is automatically formatted and replaced.
583 The default behavior is
585 This property can also be referred to by its shortened column name,
587 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
588 Identifies the default bootable dataset for the root pool.
589 This property is expected to be set mainly by the installation and upgrade
591 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
592 Controls the location of where the pool configuration is cached.
593 Discovering all pools on system startup requires a cached copy of the
594 configuration data that is stored on the root file system.
595 All pools in this cache are automatically imported when the system boots.
596 Some environments, such as install and clustering, need to cache this
597 information in a different location so that pools are not automatically
599 Setting this property caches the pool configuration in a different location that
600 can later be imported with
601 .Nm zpool Cm import Fl c .
602 Setting it to the special value
604 creates a temporary pool that is never cached, and the special value
607 uses the default location.
609 Multiple pools can share the same cache file.
610 Because the kernel destroys and recreates this file when pools are added and
611 removed, care should be taken when attempting to access this file.
612 When the last pool using a
614 is exported or destroyed, the file is removed.
615 .It Sy comment Ns = Ns Ar text
616 A text string consisting of printable ASCII characters that will be stored
617 such that it is available even if the pool becomes faulted.
618 An administrator can provide additional information about a pool using this
620 .It Sy dedupditto Ns = Ns Ar number
621 Threshold for the number of block ditto copies.
622 If the reference count for a deduplicated block increases above this number, a
623 new ditto copy of this block is automatically stored.
624 The default setting is
626 which causes no ditto copies to be created for deduplicated blocks.
627 The minimum legal nonzero setting is
629 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
630 Controls whether a non-privileged user is granted access based on the dataset
631 permissions defined on the dataset.
634 for more information on ZFS delegated administration.
635 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
636 Controls the system behavior in the event of catastrophic pool failure.
637 This condition is typically a result of a loss of connectivity to the underlying
638 storage device(s) or a failure of all devices within the pool.
639 The behavior of such an event is determined as follows:
640 .Bl -tag -width "continue"
642 Blocks all I/O access until the device connectivity is recovered and the errors
644 This is the default behavior.
648 to any new write I/O requests but allows reads to any of the remaining healthy
650 Any write requests that have yet to be committed to disk would be blocked.
652 Prints out a message to the console and generates a system crash dump.
654 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
655 The value of this property is the current state of
657 The only valid value when setting this property is
661 to the enabled state.
664 for details on feature states.
665 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
666 Controls whether information about snapshots associated with this pool is
674 This property can also be referred to by its shortened name,
676 .It Sy version Ns = Ns Ar version
677 The current on-disk version of the pool.
678 This can be increased, but never decreased.
679 The preferred method of updating pools is with the
681 command, though this property can be used when a specific version is needed for
682 backwards compatibility.
683 Once feature flags are enabled on a pool this property will no longer have a
687 All subcommands that modify state are logged persistently to the pool in their
692 command provides subcommands to create and destroy storage pools, add capacity
693 to storage pools, and provide information about the storage pools.
694 The following subcommands are supported:
700 Displays a help message.
707 Adds the specified virtual devices to the given pool.
710 specification is described in the
715 option, and the device checks performed are described in the
722 even if they appear in use or specify a conflicting replication level.
723 Not all devices can be overridden in this manner.
725 Displays the configuration that would be used without actually adding the
727 The actual pool creation can still fail due to insufficient privileges or
734 .Ar pool device new_device
740 The existing device cannot be part of a raidz configuration.
743 is not currently part of a mirrored configuration,
745 automatically transforms into a two-way mirror of
751 is part of a two-way mirror, attaching
753 creates a three-way mirror, and so on.
756 begins to resilver immediately.
761 even if its appears to be in use.
762 Not all devices can be overridden in this manner.
770 Clears device errors in a pool.
771 If no arguments are specified, all device errors within the pool are cleared.
772 If one or more devices is specified, only those errors associated with the
773 specified device or devices are cleared.
779 .Op Fl m Ar mountpoint
780 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
781 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
785 Creates a new storage pool containing the virtual devices specified on the
787 The pool name must begin with a letter, and can only contain
788 alphanumeric characters as well as underscore
800 are reserved, as are names beginning with the pattern
804 specification is described in the
808 The command verifies that each device specified is accessible and not currently
809 in use by another subsystem.
810 There are some uses, such as being currently mounted, or specified as the
811 dedicated dump device, that prevents a device from ever being used by ZFS.
812 Other uses, such as having a preexisting UFS file system, can be overridden with
817 The command also checks that the replication strategy for the pool is
819 An attempt to combine redundant and non-redundant storage in a single pool, or
820 to mix disks and files, results in an error unless
823 The use of differently sized devices within a single raidz or mirror group is
824 also flagged as an error unless
830 option is specified, the default mount point is
832 The mount point must not exist or must be empty, or else the root dataset
834 This can be overridden with the
838 By default all supported features are enabled on the new pool unless the
843 Create whole disk pool with EFI System partition to support booting system
845 Default size is 256MB.
846 To create boot partition with custom size, set the
855 Do not enable any features on the new pool.
856 Individual features can be enabled by setting their corresponding properties to
863 for details about feature properties.
867 even if they appear in use or specify a conflicting replication level.
868 Not all devices can be overridden in this manner.
869 .It Fl m Ar mountpoint
870 Sets the mount point for the root dataset.
871 The default mount point is
878 The mount point must be an absolute path,
882 For more information on dataset mount points, see
885 Displays the configuration that would be used without actually creating the
887 The actual pool creation can still fail due to insufficient privileges or
889 .It Fl o Ar property Ns = Ns Ar value
890 Sets the given pool properties.
893 section for a list of valid properties that can be set.
894 .It Fl O Ar file-system-property Ns = Ns Ar value
895 Sets the given file system properties in the root file system of the pool.
900 for a list of valid properties that can be set.
903 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
911 Destroys the given pool, freeing up any devices for other use.
912 This command tries to unmount any active datasets before destroying the pool.
915 Forces any active datasets contained within the pool to be unmounted.
925 The operation is refused if there are no other valid replicas of the data.
932 Exports the given pools from the system.
933 All devices are marked as exported, but are still considered in use by other
935 The devices can be moved between systems
936 .Pq even those of different endianness
937 and imported as long as a sufficient number of devices are present.
939 Before exporting the pool, all datasets within the pool are unmounted.
940 A pool can not be exported if it has a shared spare that is currently being
943 For pools to be portable, you must give the
945 command whole disks, not just slices, so that ZFS can label the disks with
947 Otherwise, disk drivers on platforms of different endianness will not recognize
951 Forcefully unmount all datasets, using the
955 This command will forcefully export the pool even if it has a shared spare that
956 is currently being used.
957 This may lead to potential data corruption.
963 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
964 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
967 Retrieves the given list of properties
973 for the specified storage pool(s).
974 These properties are displayed with the following fields:
976 name Name of storage pool
977 property Property name
979 source Property source, either 'default' or 'local'.
984 section for more information on the available pool properties.
988 Do not display headers, and separate fields by a single tab instead of arbitrary
991 A comma-separated list of columns to display.
992 .Sy name Ns , Ns Sy property Ns , Ns Sy value Ns , Ns Sy source
993 is the default value.
995 Display numbers in parsable (exact) values.
1001 .Oo Ar pool Oc Ns ...
1003 Displays the command history of the specified pool(s) or all pools if no pool is
1007 Displays internally logged ZFS events in addition to user initiated events.
1009 Displays log records in long format, which in addition to standard format
1010 includes, the user name, the hostname, and the zone in which the operation was
1019 Lists pools available to import.
1022 option is not specified, this command searches for devices in
1026 option can be specified multiple times, and all directories are searched.
1027 If the device appears to be part of an exported pool, this command displays a
1028 summary of the pool with the name of the pool, a numeric identifier, as well as
1029 the vdev layout and current health of the device for each device or file.
1030 Destroyed pools, pools that were previously destroyed with the
1031 .Nm zpool Cm destroy
1032 command, are not listed unless the
1034 option is specified.
1036 The numeric identifier is unique, and can be used instead of the pool name when
1037 multiple exported pools of the same name are available.
1039 .It Fl c Ar cachefile
1040 Reads configuration from the given
1042 that was created with the
1047 is used instead of searching for devices.
1049 Searches for devices or files in
1053 option can be specified multiple times.
1055 Lists destroyed pools only.
1063 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1065 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1068 Imports all pools found in the search directories.
1069 Identical to the previous command, except that all pools with a sufficient
1070 number of devices available are imported.
1071 Destroyed pools, pools that were previously destroyed with the
1072 .Nm zpool Cm destroy
1073 command, will not be imported unless the
1075 option is specified.
1078 Searches for and imports all pools found.
1079 .It Fl c Ar cachefile
1080 Reads configuration from the given
1082 that was created with the
1087 is used instead of searching for devices.
1089 Searches for devices or files in
1093 option can be specified multiple times.
1094 This option is incompatible with the
1098 Imports destroyed pools only.
1101 option is also required.
1103 Forces import, even if the pool appears to be potentially active.
1105 Recovery mode for a non-importable pool.
1106 Attempt to return the pool to an importable state by discarding the last few
1108 Not all damaged pools can be recovered by using this option.
1109 If successful, the data from the discarded transactions is irretrievably lost.
1110 This option is ignored if the pool is importable or already imported.
1112 Allows a pool to import when there is a missing log device.
1113 Recent transactions can be lost because the log device will be discarded.
1118 Determines whether a non-importable pool can be made importable again, but does
1119 not actually perform the pool recovery.
1120 For more details about pool recovery mode, see the
1124 Import the pool without mounting any file systems.
1126 Comma-separated list of mount options to use when mounting datasets within the
1130 for a description of dataset properties and mount options.
1131 .It Fl o Ar property Ns = Ns Ar value
1132 Sets the specified property on the imported pool.
1135 section for more information on the available pool properties.
1151 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1153 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1155 .Ar pool Ns | Ns Ar id
1158 Imports a specific pool.
1159 A pool can be identified by its name or the numeric identifier.
1162 is specified, the pool is imported using the name
1164 Otherwise, it is imported with the same name as its exported name.
1166 If a device is removed from a system without running
1168 first, the device appears as potentially active.
1169 It cannot be determined if this was a failed export, or whether the device is
1170 really in use from another host.
1171 To import a pool in this state, the
1175 .It Fl c Ar cachefile
1176 Reads configuration from the given
1178 that was created with the
1183 is used instead of searching for devices.
1185 Searches for devices or files in
1189 option can be specified multiple times.
1190 This option is incompatible with the
1194 Imports destroyed pool.
1197 option is also required.
1199 Forces import, even if the pool appears to be potentially active.
1201 Recovery mode for a non-importable pool.
1202 Attempt to return the pool to an importable state by discarding the last few
1204 Not all damaged pools can be recovered by using this option.
1205 If successful, the data from the discarded transactions is irretrievably lost.
1206 This option is ignored if the pool is importable or already imported.
1208 Allows a pool to import when there is a missing log device.
1209 Recent transactions can be lost because the log device will be discarded.
1214 Determines whether a non-importable pool can be made importable again, but does
1215 not actually perform the pool recovery.
1216 For more details about pool recovery mode, see the
1220 Comma-separated list of mount options to use when mounting datasets within the
1224 for a description of dataset properties and mount options.
1225 .It Fl o Ar property Ns = Ns Ar value
1226 Sets the specified property on the imported pool.
1229 section for more information on the available pool properties.
1244 .Op Fl T Sy u Ns | Ns Sy d
1245 .Oo Ar pool Oc Ns ...
1246 .Op Ar interval Op Ar count
1248 Displays I/O statistics for the given pools.
1251 the statistics are printed every
1253 seconds until ^C is pressed.
1256 are specified, statistics for every pool in the system is shown.
1259 is specified, the command exits after
1261 reports are printed.
1263 .It Fl T Sy u Ns | Ns Sy d
1264 Display a time stamp.
1267 for a printed representation of the internal representation of time.
1272 for standard date format.
1276 Verbose statistics Reports usage statistics for individual vdevs within the
1277 pool, in addition to the pool-wide statistics.
1285 Removes ZFS label information from the specified
1289 must not be part of an active pool configuration.
1292 Treat exported or foreign devices as inactive.
1298 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1299 .Op Fl T Sy u Ns | Ns Sy d
1300 .Oo Ar pool Oc Ns ...
1301 .Op Ar interval Op Ar count
1303 Lists the given pools along with a health status and space usage.
1306 are specified, all pools in the system are listed.
1309 the information is printed every
1311 seconds until ^C is pressed.
1314 is specified, the command exits after
1316 reports are printed.
1320 Do not display headers, and separate fields by a single tab instead of arbitrary
1322 .It Fl o Ar property
1323 Comma-separated list of properties to display.
1326 section for a list of valid properties.
1328 .Sy name , size , used , available , fragmentation , expandsize , capacity ,
1329 .Sy dedupratio , health , altroot .
1331 Display numbers in parsable
1334 .It Fl T Sy u Ns | Ns Sy d
1335 Display a time stamp.
1338 for a printed representation of the internal representation of time.
1343 for standard date format.
1348 Reports usage statistics for individual vdevs within the pool, in addition to
1349 the pool-wise statistics.
1355 .Ar pool Ar device Ns ...
1357 Takes the specified physical device offline.
1360 is offline, no attempt is made to read or write to the device.
1361 This command is not applicable to spares.
1365 Upon reboot, the specified physical device reverts to its previous state.
1371 .Ar pool Ar device Ns ...
1373 Brings the specified physical device online.
1374 This command is not applicable to spares.
1377 Expand the device to use all available space.
1378 If the device is part of a mirror or raidz then all devices must be expanded
1379 before the new space will become available to the pool.
1386 Generates a new unique identifier for the pool.
1387 You must ensure that all devices in this pool are online and healthy before
1388 performing this action.
1394 Reopen all the vdevs associated with the pool.
1398 .Ar pool Ar device Ns ...
1400 Removes the specified device from the pool.
1401 This command currently only supports removing hot spares, cache, and log
1403 A mirrored log device can be removed by specifying the top-level mirror for the
1405 Non-log devices that are part of a mirrored configuration can be removed using
1409 Non-redundant and raidz devices cannot be removed from a pool.
1414 .Ar pool Ar device Op Ar new_device
1420 This is equivalent to attaching
1422 waiting for it to resilver, and then detaching
1427 must be greater than or equal to the minimum size of all the devices in a mirror
1428 or raidz configuration.
1431 is required if the pool is not redundant.
1434 is not specified, it defaults to
1436 This form of replacement is useful after an existing disk has failed and has
1437 been physically replaced.
1438 In this case, the new disk may have the same
1440 path as the old device, even though it is actually a different disk.
1441 ZFS recognizes this.
1446 even if its appears to be in use.
1447 Not all devices can be overridden in this manner.
1455 Begins a scrub or resumes a paused scrub.
1456 The scrub examines all data in the specified pools to verify that it checksums
1460 devices, ZFS automatically repairs any damage discovered during the scrub.
1463 command reports the progress of the scrub and summarizes the results of the
1464 scrub upon completion.
1466 Scrubbing and resilvering are very similar operations.
1467 The difference is that resilvering only examines data that ZFS knows to be out
1470 for example, when attaching a new device to a mirror or replacing an existing
1473 whereas scrubbing examines all data to discover silent errors due to hardware
1474 faults or disk failure.
1476 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1478 If a scrub is paused, the
1481 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1490 Scrub pause state and progress are periodically synced to disk.
1491 If the system is restarted or pool is exported during a paused scrub,
1492 even after import, scrub will remain paused until it is resumed.
1493 Once resumed the scrub will pick up from the place where it was last
1494 checkpointed to disk.
1495 To resume a paused scrub issue
1502 .Ar property Ns = Ns Ar value
1505 Sets the given property on the specified pool.
1508 section for more information on what properties can be set and acceptable
1514 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1525 At the time of the split,
1527 will be a replica of
1531 Do dry run, do not actually perform the split.
1532 Print out the expected configuration of
1534 .It Fl o Ar property Ns = Ns Ar value
1535 Sets the specified property for
1539 section for more information on the available pool properties.
1547 and automatically import it.
1553 .Op Fl T Sy u Ns | Ns Sy d
1554 .Oo Ar pool Oc Ns ...
1555 .Op Ar interval Op Ar count
1557 Displays the detailed health status for the given pools.
1560 is specified, then the status of each pool in the system is displayed.
1561 For more information on pool and device health, see the
1562 .Sx Device Failure and Recovery
1565 If a scrub or resilver is in progress, this command reports the percentage done
1566 and the estimated time to completion.
1567 Both of these are only approximate, because the amount of data in the pool and
1568 the other workloads on the system can change.
1571 Display a histogram of deduplication statistics, showing the allocated
1572 .Pq physically present on disk
1574 .Pq logically referenced in the pool
1575 block counts and sizes by reference count.
1576 .It Fl T Sy u Ns | Ns Sy d
1577 Display a time stamp.
1580 for a printed representation of the internal representation of time.
1585 for standard date format.
1589 Displays verbose data error information, printing out a complete list of all
1590 data errors since the last complete pool scrub.
1592 Only display status for pools that are exhibiting errors or are otherwise
1594 Warnings about pools not using the latest on-disk format will not be included.
1600 Displays pools which do not have all supported features enabled and pools
1601 formatted using a legacy ZFS version number.
1602 These pools can continue to be used, but some features may not be available.
1604 .Nm zpool Cm upgrade Fl a
1605 to enable all features on all pools.
1611 Displays legacy ZFS versions supported by the current software.
1613 .Xr zpool-features 5
1614 for a description of feature flags features supported by the current software.
1619 .Fl a Ns | Ns Ar pool Ns ...
1621 Enables all supported features on the given pool.
1622 Once this is done, the pool will no longer be accessible on systems that do not
1623 support feature flags.
1625 .Xr zpool-features 5
1626 for details on compatibility with systems that support feature flags, but do not
1627 support all features enabled on the pool.
1630 Enables all supported features on all pools.
1632 Upgrade to the specified legacy version.
1635 flag is specified, no features will be enabled on the pool.
1636 This option can only be used to increase the version number up to the last
1637 supported legacy version number.
1641 The following exit values are returned:
1644 Successful completion.
1648 Invalid command line options were specified.
1652 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1653 The following command creates a pool with a single raidz root vdev that
1654 consists of six disks.
1656 # zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0
1658 .It Sy Example 2 No Creating a Mirrored Storage Pool
1659 The following command creates a pool with two mirrors, where each mirror
1662 # zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0
1664 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Slices
1665 The following command creates an unmirrored pool using two disk slices.
1667 # zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4
1669 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
1670 The following command creates an unmirrored pool using files.
1671 While not recommended, a pool based on files can be useful for experimental
1674 # zpool create tank /path/to/file/a /path/to/file/b
1676 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
1677 The following command adds two mirrored disks to the pool
1679 assuming the pool is already made up of two-way mirrors.
1680 The additional space is immediately available to any datasets within the pool.
1682 # zpool add tank mirror c1t0d0 c1t1d0
1684 .It Sy Example 6 No Listing Available ZFS Storage Pools
1685 The following command lists all available pools on the system.
1686 In this case, the pool
1688 is faulted due to a missing device.
1689 The results from this command are similar to the following:
1692 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1693 rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE -
1694 tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE -
1695 zion - - - - - - - FAULTED -
1697 .It Sy Example 7 No Destroying a ZFS Storage Pool
1698 The following command destroys the pool
1700 and any datasets contained within.
1702 # zpool destroy -f tank
1704 .It Sy Example 8 No Exporting a ZFS Storage Pool
1705 The following command exports the devices in pool
1707 so that they can be relocated or later imported.
1711 .It Sy Example 9 No Importing a ZFS Storage Pool
1712 The following command displays available pools, and then imports the pool
1714 for use on the system.
1715 The results from this command are similar to the following:
1719 id: 15451357997522795478
1721 action: The pool can be imported using its name or numeric identifier.
1731 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
1732 The following command upgrades all ZFS Storage pools to the current version of
1736 This system is currently running ZFS version 2.
1738 .It Sy Example 11 No Managing Hot Spares
1739 The following command creates a new pool with an available hot spare:
1741 # zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0
1744 If one of the disks were to fail, the pool would be reduced to the degraded
1746 The failed device can be replaced using the following command:
1748 # zpool replace tank c0t0d0 c0t3d0
1751 Once the data has been resilvered, the spare is automatically removed and is
1752 made available for use should another device fail.
1753 The hot spare can be permanently removed from the pool using the following
1756 # zpool remove tank c0t2d0
1758 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
1759 The following command creates a ZFS storage pool consisting of two, two-way
1760 mirrors and mirrored log devices:
1762 # zpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
1765 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
1766 The following command adds two disks for use as cache devices to a ZFS storage
1769 # zpool add pool cache c2d0 c3d0
1772 Once added, the cache devices gradually fill with content from main memory.
1773 Depending on the size of your cache devices, it could take over an hour for
1775 Capacity and reads can be monitored using the
1779 # zpool iostat -v pool 5
1781 .It Sy Example 14 No Removing a Mirrored Log Device
1782 The following command removes the mirrored log device
1784 Given this configuration:
1788 scrub: none requested
1791 NAME STATE READ WRITE CKSUM
1793 mirror-0 ONLINE 0 0 0
1796 mirror-1 ONLINE 0 0 0
1800 mirror-2 ONLINE 0 0 0
1805 The command to remove the mirrored log
1809 # zpool remove tank mirror-2
1811 .It Sy Example 15 No Displaying expanded space on a device
1812 The following command displays the detailed information for the pool
1814 This pool is comprised of a single raidz vdev where one of its devices
1815 increased its capacity by 10GB.
1816 In this example, the pool will not be able to utilize this extra capacity until
1817 all the devices under the raidz vdev have been expanded.
1819 # zpool list -v data
1820 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1821 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
1822 raidz1 23.9G 14.6G 9.30G 48% -
1828 .Sh INTERFACE STABILITY
1833 .Xr zpool-features 5