2 .\" Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>.
3 .\" Copyright (c) 2013-2014, Xin Li <delphij@FreeBSD.org>.
4 .\" All Rights Reserved.
6 .\" The contents of this file are subject to the terms of the
7 .\" Common Development and Distribution License (the "License").
8 .\" You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 .\" or http://www.opensolaris.org/os/licensing.
12 .\" See the License for the specific language governing permissions
13 .\" and limitations under the License.
15 .\" When distributing Covered Code, include this CDDL HEADER in each
16 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 .\" If applicable, add the following below this CDDL HEADER, with the
18 .\" fields enclosed by brackets "[]" replaced with your own identifying
19 .\" information: Portions Copyright [yyyy] [name of copyright owner]
21 .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved.
22 .\" Copyright (c) 2011, Justin T. Gibbs <gibbs@FreeBSD.org>
23 .\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
24 .\" Copyright (c) 2013 by Delphix. All Rights Reserved.
25 .\" Copyright 2017 Nexenta Systems, Inc.
26 .\" Copyright (c) 2017 Datto Inc.
30 .Dd September 08, 2017
35 .Nd configures ZFS storage pools
46 .Ar pool device new_device
55 .Op Fl o Ar property Ns = Ns Ar value
57 .Op Fl O Ar file-system-property Ns = Ns Ar value
59 .Op Fl m Ar mountpoint
76 .Op Fl o Ar field Ns Op , Ns Ar ...
77 .Ar all | property Ns Op , Ns Ar ...
86 .Op Fl d Ar dir | Fl c Ar cachefile
91 .Op Fl o Ar property Ns = Ns Ar value
93 .Op Fl d Ar dir | Fl c Ar cachefile
104 .Op Fl o Ar property Ns = Ns Ar value
106 .Op Fl d Ar dir | Fl c Ar cachefile
117 .Op Fl T Cm d Ns | Ns Cm u
128 .Op Fl o Ar property Ns Op , Ns Ar ...
129 .Op Fl T Cm d Ns | Ns Cm u
132 .Op Ar inverval Op Ar count
161 .Ar property Ns = Ns Ar value pool
167 .Op Fl o Ar property Ns = Ns Ar value
173 .Op Fl T Cm d Ns | Ns Cm u
176 .Op Ar interval Op Ar count
189 storage pools. A storage pool is a collection of devices that provides physical
190 storage and data replication for
194 All datasets within a storage pool share the same space. See
196 for information on managing datasets.
197 .Ss Virtual Devices (vdevs)
201 describes a single device or a collection of devices organized according to
202 certain performance and fault characteristics. The following virtual devices
204 .Bl -tag -width "XXXXXX"
206 A block device, typically located under
209 can use individual slices or partitions, though the recommended mode of
210 operation is to use whole disks. A disk can be specified by a full path to the
213 provider name. When given a whole disk,
215 automatically labels the disk, if necessary.
217 A regular file. The use of files as a backing store is strongly discouraged. It
218 is designed primarily for experimental purposes, as the fault tolerance of a
219 file is only as good the file system of which it is a part. A file must be
220 specified by a full path.
222 A mirror of two or more devices. Data is replicated in an identical fashion
223 across all components of a mirror. A mirror with
229 bytes and can withstand
231 devices failing before data integrity is compromised.
234 .Sy raidz1 raidz2 raidz3 ) .
237 that allows for better distribution of parity and eliminates the
239 write hole (in which data and parity become inconsistent after a power loss).
240 Data and parity is striped across all disks within a
246 group can have single-, double- , or triple parity, meaning that the
248 group can sustain one, two, or three failures, respectively, without
251 type specifies a single-parity
255 type specifies a double-parity
259 type specifies a triple-parity
274 parity disks can hold approximately
279 bytes and can withstand
281 device(s) failing before data integrity is compromised. The minimum number of
284 group is one more than the number of parity disks. The
285 recommended number is between 3 and 9 to help increase performance.
288 .No pseudo- Ns No vdev
289 which keeps track of available hot spares for a pool.
290 For more information, see the
294 A separate-intent log device. If more than one log device is specified, then
295 writes are load-balanced between devices. Log devices can be mirrored. However,
298 types are not supported for the intent log. For more information,
303 A device used to cache storage pool data. A cache device cannot be configured
306 group. For more information, see the
311 Virtual devices cannot be nested, so a mirror or
313 virtual device can only
314 contain files or disks. Mirrors of mirrors (or other combinations) are not
317 A pool can have any number of virtual devices at the top of the configuration
321 Data is dynamically distributed across all top-level devices to balance data
322 among devices. As new virtual devices are added,
324 automatically places data on the newly available devices.
326 Virtual devices are specified one at a time on the command line, separated by
327 whitespace. The keywords
331 are used to distinguish where a group ends and another begins. For example, the
332 following creates two root
334 each a mirror of two disks:
335 .Bd -literal -offset 2n
336 .Li # Ic zpool create mypool mirror da0 da1 mirror da2 da3
338 .Ss Device Failure and Recovery
340 supports a rich set of mechanisms for handling device failure and data
341 corruption. All metadata and data is checksummed, and
343 automatically repairs bad data from a good copy when corruption is detected.
345 In order to take advantage of these features, a pool must make use of some form
346 of redundancy, using either mirrored or
350 supports running in a non-redundant configuration, where each root
352 is simply a disk or file, this is strongly discouraged. A single case of bit
353 corruption can render some or all of your data unavailable.
355 A pool's health status is described by one of three states: online, degraded,
356 or faulted. An online pool has all devices operating normally. A degraded pool
357 is one in which one or more devices have failed, but the data is still
358 available due to a redundant configuration. A faulted pool has corrupted
359 metadata, or one or more faulted devices, and insufficient replicas to continue
362 The health of the top-level
367 potentially impacted by the state of its associated
369 or component devices. A top-level
371 or component device is in one of the following states:
372 .Bl -tag -width "DEGRADED"
374 One or more top-level
376 is in the degraded state because one or more
377 component devices are offline. Sufficient replicas exist to continue
380 One or more component devices is in the degraded or faulted state, but
381 sufficient replicas exist to continue functioning. The underlying conditions
383 .Bl -bullet -offset 2n
385 The number of checksum errors exceeds acceptable levels and the device is
386 degraded as an indication that something may be wrong.
388 continues to use the device as necessary.
392 errors exceeds acceptable levels. The device could not be
393 marked as faulted because there are insufficient replicas to continue
397 One or more top-level
399 is in the faulted state because one or more
400 component devices are offline. Insufficient replicas exist to continue
403 One or more component devices is in the faulted state, and insufficient
404 replicas exist to continue functioning. The underlying conditions are as
406 .Bl -bullet -offset 2n
408 The device could be opened, but the contents did not match expected values.
412 errors exceeds acceptable levels and the device is faulted to
413 prevent further use of the device.
416 The device was explicitly taken offline by the
420 The device is online and functioning.
422 The device was physically removed while the system was running. Device removal
423 detection is hardware-dependent and may not be supported on all platforms.
425 The device could not be opened. If a pool is imported when a device was
426 unavailable, then the device will be identified by a unique identifier instead
427 of its path since the path was never correct in the first place.
430 If a device is removed and later reattached to the system,
432 attempts to put the device online automatically. Device attach detection is
433 hardware-dependent and might not be supported on all platforms.
436 allows devices to be associated with pools as
438 These devices are not actively used in the pool, but when an active device
439 fails, it is automatically replaced by a hot spare. To create a pool with hot
443 with any number of devices. For example,
444 .Bd -literal -offset 2n
445 .Li # Ic zpool create pool mirror da0 da1 spare da2 da3
448 Spares can be shared across multiple pools, and can be added with the
450 command and removed with the
452 command. Once a spare replacement is initiated, a new "spare"
455 within the configuration that will remain there until the original device is
456 replaced. At this point, the hot spare becomes available again if another
459 If a pool has a shared spare that is currently being used, the pool can not be
460 exported since other pools may use this shared spare, which may lead to
461 potential data corruption.
463 An in-progress spare replacement can be cancelled by detaching the hot spare.
464 If the original faulted device is detached, then the hot spare assumes its
465 place in the configuration, and is removed from the spare list of all active
468 Spares cannot replace log devices.
470 This feature requires a userland helper.
474 It must be manually enabled by adding
475 .Va zfsd_enable="YES"
485 requirements for synchronous transactions. For instance, databases often
486 require their transactions to be on stable storage devices when returning from
489 and other applications can also use
491 to ensure data stability. By default, the intent log is allocated from blocks
492 within the main pool. However, it might be possible to get better performance
493 using separate intent log devices such as
495 or a dedicated disk. For example:
496 .Bd -literal -offset 2n
497 .Li # Ic zpool create pool da0 da1 log da2
500 Multiple log devices can also be specified, and they can be mirrored. See the
502 section for an example of mirroring multiple log devices.
504 Log devices can be added, replaced, attached, detached, imported and exported
505 as part of the larger pool. Mirrored log devices can be removed by specifying
506 the top-level mirror for the log.
508 Devices can be added to a storage pool as "cache devices." These devices
509 provide an additional layer of caching between main memory and disk. For
510 read-heavy workloads, where the working set size is much larger than what can
511 be cached in main memory, using cache devices allow much more of this working
512 set to be served from low latency media. Using cache devices provides the
513 greatest performance improvement for random read-workloads of mostly static
516 To create a pool with cache devices, specify a "cache"
518 with any number of devices. For example:
519 .Bd -literal -offset 2n
520 .Li # Ic zpool create pool da0 da1 cache da2 da3
523 Cache devices cannot be mirrored or part of a
525 configuration. If a read
526 error is encountered on a cache device, that read
528 is reissued to the original storage pool device, which might be part of a
533 The content of the cache devices is considered volatile, as is the case with
536 Each pool has several properties associated with it. Some properties are
537 read-only statistics while others are configurable and change the behavior of
538 the pool. The following are read-only properties:
539 .Bl -tag -width "dedupratio"
541 Amount of storage space within the pool that has been physically allocated.
543 Percentage of pool space used. This property can also be referred to by its
544 shortened column name, "cap".
546 A text string consisting of printable ASCII characters that will be stored
547 such that it is available even if the pool becomes faulted. An administrator
548 can provide additional information about a pool using this property.
550 The deduplication ratio specified for a pool, expressed as a multiplier.
553 value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See
555 for a description of the deduplication feature.
557 Amount of uninitialized space within the pool or device that can be used to
558 increase the total capacity of the pool.
559 Uninitialized space consists of
560 any space on an EFI labeled vdev which has not been brought online
561 .Pq i.e. zpool online -e .
562 This space occurs when a LUN is dynamically expanded.
564 The amount of fragmentation in the pool.
566 Number of blocks within the pool that are not allocated.
568 After a file system or snapshot is destroyed, the space it was using is
569 returned to the pool asynchronously.
571 is the amount of space remaining to be reclaimed.
578 A unique identifier for the pool.
580 The current health of the pool. Health can be
589 Total size of the storage pool.
590 .It Sy unsupported@ Ns Ar feature_guid
591 Information about unsupported features that are enabled on the pool.
596 Amount of storage space used within the pool.
599 The space usage properties report actual physical space available to the
600 storage pool. The physical space can be different from the total amount of
601 space that any contained datasets can actually use. The amount of space used in
604 configuration depends on the characteristics of the data being written.
607 reserves some space for internal accounting that the
609 command takes into account, but the
611 command does not. For non-full pools of a reasonable size, these effects should
612 be invisible. For small pools, or pools that are close to being completely
613 full, these discrepancies may become more noticeable.
615 The following property can be set at creation time and import time:
618 Alternate root directory. If set, this directory is prepended to any mount
619 points within the pool. This can be used when examining an unknown pool where
620 the mount points cannot be trusted, or in an alternate boot environment, where
621 the typical paths are not valid.
623 is not a persistent property. It is valid only while the system is up.
628 though this may be overridden using an explicit setting.
631 The following property can only be set at import time:
633 .It Sy readonly Ns = Ns Cm on No | Cm off
636 pool will be imported in read-only mode with the following restrictions:
637 .Bl -bullet -offset 2n
639 Synchronous data in the intent log will not be accessible
641 Properties of the pool can not be changed
643 Datasets of this pool can only be mounted read-only
645 To write to a read-only pool, a export and import of the pool is required.
648 This property can also be referred to by its shortened column name,
652 The following properties can be set at creation time and import time, and later
657 .It Sy autoexpand Ns = Ns Cm on No | Cm off
658 Controls automatic pool expansion when the underlying LUN is grown. If set to
660 the pool will be resized according to the size of the expanded
661 device. If the device is part of a mirror or
663 then all devices within that
664 .No mirror/ Ns No raidz
665 group must be expanded before the new space is made available to
666 the pool. The default behavior is
668 This property can also be referred to by its shortened column name,
670 .It Sy autoreplace Ns = Ns Cm on No | Cm off
671 Controls automatic device replacement. If set to
673 device replacement must be initiated by the administrator by using the
677 any new device, found in the same
678 physical location as a device that previously belonged to the pool, is
679 automatically formatted and replaced. The default behavior is
681 This property can also be referred to by its shortened column name, "replace".
682 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
683 Identifies the default bootable dataset for the root pool. This property is
684 expected to be set mainly by the installation and upgrade programs.
685 .It Sy cachefile Ns = Ns Ar path No | Cm none
686 Controls the location of where the pool configuration is cached. Discovering
687 all pools on system startup requires a cached copy of the configuration data
688 that is stored on the root file system. All pools in this cache are
689 automatically imported when the system boots. Some environments, such as
690 install and clustering, need to cache this information in a different location
691 so that pools are not automatically imported. Setting this property caches the
692 pool configuration in a different location that can later be imported with
693 .Qq Nm Cm import Fl c .
694 Setting it to the special value
696 creates a temporary pool that is never cached, and the special value
698 (empty string) uses the default location.
699 .It Sy comment Ns = Ns Ar text
700 A text string consisting of printable ASCII characters that will be stored
701 such that it is available even if the pool becomes faulted.
702 An administrator can provide additional information about a pool using this
704 .It Sy dedupditto Ns = Ns Ar number
705 Threshold for the number of block ditto copies. If the reference count for a
706 deduplicated block increases above this number, a new ditto copy of this block
707 is automatically stored. Default setting is
709 which causes no ditto copies to be created for deduplicated blocks.
710 The miniumum legal nonzero setting is 100.
711 .It Sy delegation Ns = Ns Cm on No | Cm off
712 Controls whether a non-privileged user is granted access based on the dataset
713 permissions defined on the dataset. See
715 for more information on
717 delegated administration.
718 .It Sy failmode Ns = Ns Cm wait No | Cm continue No | Cm panic
719 Controls the system behavior in the event of catastrophic pool failure. This
720 condition is typically a result of a loss of connectivity to the underlying
721 storage device(s) or a failure of all devices within the pool. The behavior of
722 such an event is determined as follows:
723 .Bl -tag -width indent
727 access until the device connectivity is recovered and the errors are cleared.
728 This is the default behavior.
734 requests but allows reads to any of the remaining healthy devices. Any write
735 requests that have yet to be committed to disk would be blocked.
737 Prints out a message to the console and generates a system crash dump.
739 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
740 The value of this property is the current state of
742 The only valid value when setting this property is
746 to the enabled state.
749 for details on feature states.
750 .It Sy listsnaps Ns = Ns Cm on No | Cm off
751 Controls whether information about snapshots associated with this pool is
756 option. The default value is
758 .It Sy version Ns = Ns Ar version
759 The current on-disk version of the pool. This can be increased, but never
760 decreased. The preferred method of updating pools is with the
762 command, though this property can be used when a specific version is needed
763 for backwards compatibility.
764 Once feature flags is enabled on a pool this property will no longer have a
768 All subcommands that modify state are logged persistently to the pool in their
773 command provides subcommands to create and destroy storage pools, add capacity
774 to storage pools, and provide information about the storage pools. The following
775 subcommands are supported:
782 Displays a help message.
790 Adds the specified virtual devices to the given pool. The
792 specification is described in the
793 .Qq Sx Virtual Devices
794 section. The behavior of the
796 option, and the device checks performed are described in the
799 .Bl -tag -width indent
803 even if they appear in use or specify a conflicting replication level.
804 Not all devices can be overridden in this manner.
806 Displays the configuration that would be used without actually adding the
808 The actual pool creation can still fail due to insufficient privileges or device
811 Do not add a disk that is currently configured as a quorum device to a zpool.
812 After a disk is in the pool, that disk can then be configured as a quorum
819 .Ar pool device new_device
826 device. The existing device cannot be part of a
830 is not currently part of a mirrored configuration,
832 automatically transforms into a two-way mirror of
833 .Ar device No and Ar new_device .
836 is part of a two-way mirror, attaching
838 creates a three-way mirror, and so on. In either case,
840 begins to resilver immediately.
841 .Bl -tag -width indent
845 even if its appears to be in use. Not all devices can be overridden in this
856 Clears device errors in a pool. If no arguments are specified, all device
857 errors within the pool are cleared. If one or more devices is specified, only
858 those errors associated with the specified device or devices are cleared.
859 .Bl -tag -width indent
861 Initiates recovery mode for an unopenable pool. Attempts to discard the last
862 few transactions in the pool to return it to an openable state. Not all damaged
863 pools can be recovered by using this option. If successful, the data from the
864 discarded transactions is irretrievably lost.
866 Used in combination with the
868 flag. Check whether discarding transactions would make the pool openable, but
869 do not actually discard any transactions.
875 .Op Fl o Ar property Ns = Ns Ar value
877 .Op Fl O Ar file-system-property Ns = Ns Ar value
879 .Op Fl m Ar mountpoint
884 Creates a new storage pool containing the virtual devices specified on the
885 command line. The pool name must begin with a letter, and can only contain
886 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
887 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
888 names beginning with the pattern "c[0-9]". The
890 specification is described in the
891 .Qq Sx Virtual Devices
894 The command verifies that each device specified is accessible and not currently
895 in use by another subsystem. There are some uses, such as being currently
896 mounted, or specified as the dedicated dump device, that prevents a device from
899 Other uses, such as having a preexisting
901 file system, can be overridden with the
905 The command also checks that the replication strategy for the pool is
906 consistent. An attempt to combine redundant and non-redundant storage in a
907 single pool, or to mix disks and files, results in an error unless
909 is specified. The use of differently sized devices within a single
911 or mirror group is 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
920 root dataset cannot be mounted. This can be overridden with the
924 By default all supported features are enabled on the new pool unless the
927 .Bl -tag -width indent
931 even if they appear in use or specify a conflicting replication level.
932 Not all devices can be overridden in this manner.
934 Displays the configuration that would be used without actually creating the
935 pool. The actual pool creation can still fail due to insufficient privileges or
938 Do not enable any features on the new pool.
939 Individual features can be enabled by setting their corresponding properties
947 for details about feature properties.
949 .Fl o Ar property Ns = Ns Ar value
950 .Op Fl o Ar property Ns = Ns Ar value
953 Sets the given pool properties. See the
955 section for a list of valid properties that can be set.
958 .Ar file-system-property Ns = Ns Ar value
959 .Op Fl O Ar file-system-property Ns = Ns Ar value
962 Sets the given file system properties in the root file system of the pool. See
964 for a list of valid properties that
968 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
969 .It Fl m Ar mountpoint
970 Sets the mount point for the root dataset. The default mount point is
973 .Qq Cm altroot Ns Pa /pool
976 is specified. The mount point must be an absolute path,
980 For more information on dataset mount points, see
990 Destroys the given pool, freeing up any devices for other use. This command
991 tries to unmount any active datasets before destroying the pool.
992 .Bl -tag -width indent
994 Forces any active datasets contained within the pool to be unmounted.
1004 from a mirror. The operation is refused if there are no other valid replicas
1013 Exports the given pools from the system. All devices are marked as exported,
1014 but are still considered in use by other subsystems. The devices can be moved
1015 between systems (even those of different endianness) and imported as long as a
1016 sufficient number of devices are present.
1018 Before exporting the pool, all datasets within the pool are unmounted. A pool
1019 can not be exported if it has a shared spare that is currently being used.
1021 For pools to be portable, you must give the
1023 command whole disks, not just slices, so that
1025 can label the disks with portable
1027 labels. Otherwise, disk drivers on platforms of different endianness will not
1028 recognize the disks.
1029 .Bl -tag -width indent
1031 Forcefully unmount all datasets, using the
1035 This command will forcefully export the pool even if it has a shared spare that
1036 is currently being used. This may lead to potential data corruption.
1042 .Op Fl o Ar field Ns Op , Ns Ar ...
1043 .Ar all | property Ns Op , Ns Ar ...
1047 Retrieves the given list of properties (or all properties if
1049 is used) for the specified storage pool(s). These properties are displayed with
1050 the following fields:
1051 .Bl -column -offset indent "property"
1052 .It name Ta Name of storage pool
1053 .It property Ta Property name
1054 .It value Ta Property value
1055 .It source Ta Property source, either 'default' or 'local'.
1060 section for more information on the available pool properties.
1062 Scripted mode. Do not display headers, and separate fields by a single tab
1063 instead of arbitrary space.
1065 Display numbers in parsable (exact) values.
1067 A comma-separated list of columns to display.
1069 .Sy property Ns , Ns
1072 is the default value.
1081 Displays the command history of the specified pools or all pools if no pool is
1083 .Bl -tag -width indent
1085 Displays internally logged
1087 events in addition to user initiated events.
1089 Displays log records in long format, which in addition to standard format
1090 includes, the user name, the hostname, and the zone in which the operation was
1096 .Op Fl d Ar dir | Fl c Ar cachefile
1100 Lists pools available to import. If the
1102 option is not specified, this command searches for devices in
1106 option can be specified multiple times, and all directories are searched. If
1107 the device appears to be part of an exported pool, this command displays a
1108 summary of the pool with the name of the pool, a numeric identifier, as well as
1111 layout and current health of the device for each device or file.
1112 Destroyed pools, pools that were previously destroyed with the
1114 command, are not listed unless the
1116 option is specified.
1118 The numeric identifier is unique, and can be used instead of the pool name when
1119 multiple exported pools of the same name are available.
1120 .Bl -tag -width indent
1121 .It Fl c Ar cachefile
1122 Reads configuration from the given
1124 that was created with the
1128 is used instead of searching for devices.
1130 Searches for devices or files in
1134 option can be specified multiple times.
1136 Lists destroyed pools only.
1142 .Op Fl o Ar property Ns = Ns Ar value
1144 .Op Fl d Ar dir | Fl c Ar cachefile
1154 Imports all pools found in the search directories. Identical to the previous
1155 command, except that all pools with a sufficient number of devices available
1156 are imported. Destroyed pools, pools that were previously destroyed with the
1158 command, will not be imported unless the
1160 option is specified.
1161 .Bl -tag -width indent
1163 Comma-separated list of mount options to use when mounting datasets within the
1166 for a description of dataset properties and mount options.
1167 .It Fl o Ar property Ns = Ns Ar value
1168 Sets the specified property on the imported pool. See the
1170 section for more information on the available pool properties.
1171 .It Fl c Ar cachefile
1172 Reads configuration from the given
1174 that was created with the
1178 is used instead of searching for devices.
1180 Searches for devices or files in
1184 option can be specified multiple times. This option is incompatible with the
1188 Imports destroyed pools only. The
1190 option is also required.
1192 Forces import, even if the pool appears to be potentially active.
1194 Allows a pool to import when there is a missing log device. Recent transactions
1195 can be lost because the log device will be discarded.
1197 Import the pool without mounting any file systems.
1208 Recovery mode for a non-importable pool. Attempt to return the pool to an
1209 importable state by discarding the last few transactions. Not all damaged pools
1210 can be recovered by using this option. If successful, the data from the
1211 discarded transactions is irretrievably lost. This option is ignored if the
1212 pool is importable or already imported.
1216 recovery option. Determines whether a non-importable pool can be made
1217 importable again, but does not actually perform the pool recovery. For more
1218 details about pool recovery mode, see the
1222 Searches for and imports all pools found.
1228 .Op Fl o Ar property Ns = Ns Ar value
1230 .Op Fl d Ar dir | Fl c Ar cachefile
1241 Imports a specific pool. A pool can be identified by its name or the numeric
1244 is specified, the pool is imported using the name
1246 Otherwise, it is imported with the same name as its exported name.
1248 If a device is removed from a system without running
1250 first, the device appears as potentially active. It cannot be determined if
1251 this was a failed export, or whether the device is really in use from another
1252 host. To import a pool in this state, the
1255 .Bl -tag -width indent
1257 Comma-separated list of mount options to use when mounting datasets within the
1260 for a description of dataset properties and mount options.
1261 .It Fl o Ar property Ns = Ns Ar value
1262 Sets the specified property on the imported pool. See the
1264 section for more information on the available pool properties.
1265 .It Fl c Ar cachefile
1266 Reads configuration from the given
1268 that was created with the
1272 is used instead of searching for devices.
1274 Searches for devices or files in
1278 option can be specified multiple times. This option is incompatible with the
1282 Imports destroyed pools only. The
1284 option is also required.
1286 Forces import, even if the pool appears to be potentially active.
1288 Allows a pool to import when there is a missing log device. Recent transactions
1289 can be lost because the log device will be discarded.
1291 Import the pool without mounting any file systems.
1294 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1296 Recovery mode for a non-importable pool. Attempt to return the pool to an
1297 importable state by discarding the last few transactions. Not all damaged pools
1298 can be recovered by using this option. If successful, the data from the
1299 discarded transactions is irretrievably lost. This option is ignored if the
1300 pool is importable or already imported.
1304 recovery option. Determines whether a non-importable pool can be made
1305 importable again, but does not actually perform the pool recovery. For more
1306 details about pool recovery mode, see the
1313 .Op Fl T Cm d Ns | Ns Cm u
1317 .Op Ar interval Op Ar count
1322 statistics for the given pools. When given an interval, the statistics are
1329 are specified, statistics for every pool in the system is shown. If
1331 is specified, the command exits after
1333 reports are printed.
1334 .Bl -tag -width indent
1335 .It Fl T Cm d Ns | Ns Cm u
1340 for standard date format. See
1345 .Pq equals Qq Ic date +%s .
1347 Verbose statistics. Reports usage statistics for individual
1349 within the pool, in addition to the pool-wide statistics.
1360 label information from the specified
1364 must not be part of an active pool configuration.
1365 .Bl -tag -width indent
1367 Treat exported or foreign devices as inactive.
1373 .Op Fl o Ar property Ns Op , Ns Ar ...
1374 .Op Fl T Cm d Ns | Ns Cm u
1377 .Op Ar inverval Op Ar count
1380 Lists the given pools along with a health status and space usage. If no
1382 are specified, all pools in the system are listed.
1384 When given an interval, the output is printed every
1390 is specified, the command exits after
1392 reports are printed.
1393 .Bl -tag -width indent
1394 .It Fl T Cm d Ns | Ns Cm u
1399 for standard date format. See
1404 .Pq equals Qq Ic date +%s .
1406 Scripted mode. Do not display headers, and separate fields by a single tab
1407 instead of arbitrary space.
1409 Display numbers in parsable (exact) values.
1411 Verbose statistics. Reports usage statistics for individual
1414 the pool, in addition to the pool-wide statistics.
1415 .It Fl o Ar property Ns Op , Ns Ar ...
1416 Comma-separated list of properties to display. See the
1418 section for a list of valid properties. The default list is
1428 .It Fl T Cm d Ns | Ns Cm u
1433 for standard date format. See
1438 .Pq equals Qq Ic date +%s .
1447 Takes the specified physical device offline. While the
1449 is offline, no attempt is made to read or write to the device.
1450 .Bl -tag -width indent
1452 Temporary. Upon reboot, the specified physical device reverts to its previous
1462 Brings the specified physical device online.
1464 This command is not applicable to spares or cache devices.
1465 .Bl -tag -width indent
1467 Expand the device to use all available space. If the device is part of a mirror
1470 then all devices must be expanded before the new space will become
1471 available to the pool.
1479 Generates a new unique identifier for the pool. You must ensure that all
1480 devices in this pool are online and healthy before performing this action.
1487 Removes the specified device from the pool. This command currently only
1488 supports removing hot spares, cache, and log devices. A mirrored log device can
1489 be removed by specifying the top-level mirror for the log. Non-log devices that
1490 are part of a mirrored configuration can be removed using the
1492 command. Non-redundant and
1494 devices cannot be removed from a pool.
1501 Reopen all the vdevs associated with the pool.
1514 This is equivalent to attaching
1516 waiting for it to resilver, and then detaching
1521 must be greater than or equal to the minimum size
1522 of all the devices in a mirror or
1527 is required if the pool is not redundant. If
1529 is not specified, it defaults to
1531 This form of replacement is useful after an existing disk has failed and has
1532 been physically replaced. In this case, the new disk may have the same
1534 path as the old device, even though it is actually a different disk.
1537 .Bl -tag -width indent
1541 even if its appears to be in use. Not all devices can be overridden in this
1551 Begins a scrub or resumes a paused scrub.
1552 The scrub examines all data in the specified pools to verify that it checksums
1556 devices, ZFS automatically repairs any damage discovered during the scrub.
1559 command reports the progress of the scrub and summarizes the results of the
1560 scrub upon completion.
1562 Scrubbing and resilvering are very similar operations.
1563 The difference is that resilvering only examines data that ZFS knows to be out
1566 for example, when attaching a new device to a mirror or replacing an existing
1569 whereas scrubbing examines all data to discover silent errors due to hardware
1570 faults or disk failure.
1572 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1574 If a scrub is paused, the
1577 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1586 Scrub pause state and progress are periodically synced to disk.
1587 If the system is restarted or pool is exported during a paused scrub,
1588 even after import, scrub will remain paused until it is resumed.
1589 Once resumed the scrub will pick up from the place where it was last
1590 checkpointed to disk.
1591 To resume a paused scrub issue
1598 .Ar property Ns = Ns Ar value pool
1601 Sets the given property on the specified pool. See the
1603 section for more information on what properties can be set and acceptable
1611 .Op Fl o Ar property Ns = Ns Ar value
1616 Splits off one disk from each mirrored top-level
1618 in a pool and creates a new pool from the split-off disks. The original pool
1619 must be made up of one or more mirrors and must not be in the process of
1622 subcommand chooses the last device in each mirror
1624 unless overridden by a device specification on the command line.
1630 includes the specified device(s) in a new pool and, should any devices remain
1631 unspecified, assigns the last device in each mirror
1633 to that pool, as it does normally. If you are uncertain about the outcome of a
1637 ("dry-run") option to ensure your command will have the effect you intend.
1638 .Bl -tag -width indent
1640 Automatically import the newly created pool after splitting, using the
1643 parameter for the new pool's alternate root. See the
1649 Displays the configuration that would be created without actually splitting the
1650 pool. The actual pool split could still fail due to insufficient privileges or
1653 Comma-separated list of mount options to use when mounting datasets within the
1656 for a description of dataset properties and mount options. Valid only in
1657 conjunction with the
1660 .It Fl o Ar property Ns = Ns Ar value
1661 Sets the specified property on the new pool. See the
1663 section, above, for more information on the available pool properties.
1669 .Op Fl T Cm d Ns | Ns Cm u
1672 .Op Ar interval Op Ar count
1675 Displays the detailed health status for the given pools. If no
1677 is specified, then the status of each pool in the system is displayed. For more
1678 information on pool and device health, see the
1679 .Qq Sx Device Failure and Recovery
1682 When given an interval, the output is printed every
1688 is specified, the command exits after
1690 reports are printed.
1692 If a scrub or resilver is in progress, this command reports the percentage
1693 done and the estimated time to completion. Both of these are only approximate,
1694 because the amount of data in the pool and the other workloads on the system
1696 .Bl -tag -width indent
1698 Only display status for pools that are exhibiting errors or are otherwise
1700 Warnings about pools not using the latest on-disk format, having non-native
1701 block size or disabled features will not be included.
1703 Displays verbose data error information, printing out a complete list of all
1704 data errors since the last complete pool scrub.
1705 .It Fl T Cm d Ns | Ns Cm u
1710 for standard date format. See
1715 .Pq equals Qq Ic date +%s .
1723 Displays pools which do not have all supported features enabled and pools
1724 formatted using a legacy
1727 These pools can continue to be used, but some features may not be available.
1730 to enable all features on all pools.
1731 .Bl -tag -width indent
1735 versions supported by the current software.
1737 .Xr zpool-features 7
1738 for a description of feature flags features supported by the current software.
1747 Enables all supported features on the given pool.
1748 Once this is done, the pool will no longer be accessible on systems that do
1749 not support feature flags.
1751 .Xr zpool-features 7
1752 for details on compatibility with systems that support feature flags, but do
1753 not support all features enabled on the pool.
1754 .Bl -tag -width indent
1756 Enables all supported features on all pools.
1758 Upgrade to the specified legacy version. If the
1760 flag is specified, no features will be enabled on the pool.
1761 This option can only be used to increase version number up to the last
1762 supported legacy version number.
1766 The following exit values are returned:
1767 .Bl -tag -offset 2n -width 2n
1769 Successful completion.
1773 Invalid command line options were specified.
1777 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1779 The following command creates a pool with a single
1783 that consists of six disks.
1784 .Bd -literal -offset 2n
1785 .Li # Ic zpool create tank raidz da0 da1 da2 da3 da4 da5
1787 .It Sy Example 2 No Creating a Mirrored Storage Pool
1789 The following command creates a pool with two mirrors, where each mirror
1791 .Bd -literal -offset 2n
1792 .Li # Ic zpool create tank mirror da0 da1 mirror da2 da3
1794 .It Sy Example 3 No Creating a Tn ZFS No Storage Pool by Using Partitions
1796 The following command creates an unmirrored pool using two GPT partitions.
1797 .Bd -literal -offset 2n
1798 .Li # Ic zpool create tank da0p3 da1p3
1800 .It Sy Example 4 No Creating a Tn ZFS No Storage Pool by Using Files
1802 The following command creates an unmirrored pool using files. While not
1803 recommended, a pool based on files can be useful for experimental purposes.
1804 .Bd -literal -offset 2n
1805 .Li # Ic zpool create tank /path/to/file/a /path/to/file/b
1807 .It Sy Example 5 No Adding a Mirror to a Tn ZFS No Storage Pool
1809 The following command adds two mirrored disks to the pool
1811 assuming the pool is already made up of two-way mirrors. The additional space
1812 is immediately available to any datasets within the pool.
1813 .Bd -literal -offset 2n
1814 .Li # Ic zpool add tank mirror da2 da3
1816 .It Sy Example 6 No Listing Available Tn ZFS No Storage Pools
1818 The following command lists all available pools on the system.
1819 .Bd -literal -offset 2n
1821 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1822 pool 2.70T 473G 2.24T 33% - 17% 1.00x ONLINE -
1823 test 1.98G 89.5K 1.98G 48% - 0% 1.00x ONLINE -
1825 .It Sy Example 7 No Listing All Properties for a Pool
1827 The following command lists all the properties for a pool.
1828 .Bd -literal -offset 2n
1829 .Li # Ic zpool get all pool
1832 pool altroot - default
1833 pool health ONLINE -
1834 pool guid 2501120270416322443 default
1835 pool version 28 default
1836 pool bootfs pool/root local
1837 pool delegation on default
1838 pool autoreplace off default
1839 pool cachefile - default
1840 pool failmode wait default
1841 pool listsnapshots off default
1842 pool autoexpand off default
1843 pool dedupditto 0 default
1844 pool dedupratio 1.00x -
1846 pool allocated 473G -
1849 .It Sy Example 8 No Destroying a Tn ZFS No Storage Pool
1851 The following command destroys the pool
1853 and any datasets contained within.
1854 .Bd -literal -offset 2n
1855 .Li # Ic zpool destroy -f tank
1857 .It Sy Example 9 No Exporting a Tn ZFS No Storage Pool
1859 The following command exports the devices in pool
1861 so that they can be relocated or later imported.
1862 .Bd -literal -offset 2n
1863 .Li # Ic zpool export tank
1865 .It Sy Example 10 No Importing a Tn ZFS No Storage Pool
1867 The following command displays available pools, and then imports the pool
1869 for use on the system.
1871 The results from this command are similar to the following:
1872 .Bd -literal -offset 2n
1873 .Li # Ic zpool import
1876 id: 15451357997522795478
1878 action: The pool can be imported using its name or numeric identifier.
1890 Storage Pools to the Current Version
1893 The following command upgrades all
1895 Storage pools to the current version of
1897 .Bd -literal -offset 2n
1898 .Li # Ic zpool upgrade -a
1899 This system is currently running ZFS pool version 28.
1901 .It Sy Example 12 No Managing Hot Spares
1903 The following command creates a new pool with an available hot spare:
1904 .Bd -literal -offset 2n
1905 .Li # Ic zpool create tank mirror da0 da1 spare da2
1908 If one of the disks were to fail, the pool would be reduced to the degraded
1909 state. The failed device can be replaced using the following command:
1910 .Bd -literal -offset 2n
1911 .Li # Ic zpool replace tank da0 da2
1914 Once the data has been resilvered, the spare is automatically removed and is
1915 made available should another device fails. The hot spare can be permanently
1916 removed from the pool using the following command:
1917 .Bd -literal -offset 2n
1918 .Li # Ic zpool remove tank da2
1924 Pool with Mirrored Separate Intent Logs
1927 The following command creates a
1929 storage pool consisting of two, two-way
1930 mirrors and mirrored log devices:
1931 .Bd -literal -offset 2n
1932 .Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5
1934 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
1936 The following command adds two disks for use as cache devices to a
1939 .Bd -literal -offset 2n
1940 .Li # Ic zpool add pool cache da2 da3
1943 Once added, the cache devices gradually fill with content from main memory.
1944 Depending on the size of your cache devices, it could take over an hour for
1945 them to fill. Capacity and reads can be monitored using the
1947 subcommand as follows:
1948 .Bd -literal -offset 2n
1949 .Li # Ic zpool iostat -v pool 5
1953 Displaying expanded space on a device
1956 The following command dipslays the detailed information for the
1959 This pool is comprised of a single
1961 vdev where one of its
1962 devices increased its capacity by 10GB.
1963 In this example, the pool will not
1964 be able to utilized this extra capacity until all the devices under the
1966 vdev have been expanded.
1967 .Bd -literal -offset 2n
1968 .Li # Ic zpool list -v data
1969 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1970 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
1971 raidz1 23.9G 14.6G 9.30G 48% -
1978 Removing a Mirrored Log Device
1981 The following command removes the mirrored log device
1984 Given this configuration:
1985 .Bd -literal -offset 2n
1988 scrub: none requested
1991 NAME STATE READ WRITE CKSUM
1993 mirror-0 ONLINE 0 0 0
1996 mirror-1 ONLINE 0 0 0
2000 mirror-2 ONLINE 0 0 0
2005 The command to remove the mirrored log
2008 .Bd -literal -offset 2n
2009 .Li # Ic zpool remove tank mirror-2
2013 Recovering a Faulted
2018 If a pool is faulted but recoverable, a message indicating this state is
2021 if the pool was cached (see the
2023 argument above), or as part of the error output from a failed
2027 Recover a cached pool with the
2030 .Bd -literal -offset 2n
2031 .Li # Ic zpool clear -F data
2032 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
2033 Discarded approximately 29 seconds of transactions.
2036 If the pool configuration was not cached, use
2038 with the recovery mode flag:
2039 .Bd -literal -offset 2n
2040 .Li # Ic zpool import -F data
2041 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
2042 Discarded approximately 29 seconds of transactions.
2046 .Xr zpool-features 7 ,
2050 This manual page is a
2052 reimplementation of the
2056 modified and customized for
2058 and licensed under the Common Development and Distribution License
2063 implementation of this manual page was initially written by
2064 .An Martin Matuska Aq mm@FreeBSD.org .