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) 2012, 2017 by Delphix. All Rights Reserved.
25 .\" Copyright 2017 Nexenta Systems, Inc.
26 .\" Copyright (c) 2017 Datto Inc.
35 .Nd configures ZFS storage pools
46 .Ar pool device new_device
59 .Op Fl o Ar property Ns = Ns Ar value
61 .Op Fl O Ar file-system-property Ns = Ns Ar value
63 .Op Fl m Ar mountpoint
81 .Op Fl o Ar field Ns Op , Ns Ar ...
82 .Ar all | property Ns Op , Ns Ar ...
91 .Op Fl d Ar dir | Fl c Ar cachefile
96 .Op Fl o Ar property Ns = Ns Ar value
98 .Op Fl -rewind-to-checkpoint
99 .Op Fl d Ar dir | Fl c Ar cachefile
110 .Op Fl o Ar property Ns = Ns Ar value
112 .Op Fl -rewind-to-checkpoint
113 .Op Fl d Ar dir | Fl c Ar cachefile
125 .Op Fl T Cm d Ns | Ns Cm u
136 .Op Fl o Ar property Ns Op , Ns Ar ...
137 .Op Fl T Cm d Ns | Ns Cm u
140 .Op Ar inverval Op Ar count
174 .Ar property Ns = Ns Ar value pool
180 .Op Fl o Ar property Ns = Ns Ar value
186 .Op Fl T Cm d Ns | Ns Cm u
189 .Op Ar interval Op Ar count
202 storage pools. A storage pool is a collection of devices that provides physical
203 storage and data replication for
207 All datasets within a storage pool share the same space. See
209 for information on managing datasets.
210 .Ss Virtual Devices (vdevs)
214 describes a single device or a collection of devices organized according to
215 certain performance and fault characteristics. The following virtual devices
217 .Bl -tag -width "XXXXXX"
219 A block device, typically located under
222 can use individual slices or partitions, though the recommended mode of
223 operation is to use whole disks. A disk can be specified by a full path to the
226 provider name. When given a whole disk,
228 automatically labels the disk, if necessary.
230 A regular file. The use of files as a backing store is strongly discouraged. It
231 is designed primarily for experimental purposes, as the fault tolerance of a
232 file is only as good the file system of which it is a part. A file must be
233 specified by a full path.
235 A mirror of two or more devices. Data is replicated in an identical fashion
236 across all components of a mirror. A mirror with
242 bytes and can withstand
244 devices failing before data integrity is compromised.
247 .Sy raidz1 raidz2 raidz3 ) .
250 that allows for better distribution of parity and eliminates the
252 write hole (in which data and parity become inconsistent after a power loss).
253 Data and parity is striped across all disks within a
259 group can have single-, double- , or triple parity, meaning that the
261 group can sustain one, two, or three failures, respectively, without
264 type specifies a single-parity
268 type specifies a double-parity
272 type specifies a triple-parity
287 parity disks can hold approximately
292 bytes and can withstand
294 device(s) failing before data integrity is compromised. The minimum number of
297 group is one more than the number of parity disks. The
298 recommended number is between 3 and 9 to help increase performance.
301 .No pseudo- Ns No vdev
302 which keeps track of available hot spares for a pool.
303 For more information, see the
307 A separate-intent log device. If more than one log device is specified, then
308 writes are load-balanced between devices. Log devices can be mirrored. However,
311 types are not supported for the intent log. For more information,
316 A device used to cache storage pool data. A cache device cannot be configured
319 group. For more information, see the
324 Virtual devices cannot be nested, so a mirror or
326 virtual device can only
327 contain files or disks. Mirrors of mirrors (or other combinations) are not
330 A pool can have any number of virtual devices at the top of the configuration
334 Data is dynamically distributed across all top-level devices to balance data
335 among devices. As new virtual devices are added,
337 automatically places data on the newly available devices.
339 Virtual devices are specified one at a time on the command line, separated by
340 whitespace. The keywords
344 are used to distinguish where a group ends and another begins. For example, the
345 following creates two root
347 each a mirror of two disks:
348 .Bd -literal -offset 2n
349 .Li # Ic zpool create mypool mirror da0 da1 mirror da2 da3
351 .Ss Device Failure and Recovery
353 supports a rich set of mechanisms for handling device failure and data
354 corruption. All metadata and data is checksummed, and
356 automatically repairs bad data from a good copy when corruption is detected.
358 In order to take advantage of these features, a pool must make use of some form
359 of redundancy, using either mirrored or
363 supports running in a non-redundant configuration, where each root
365 is simply a disk or file, this is strongly discouraged. A single case of bit
366 corruption can render some or all of your data unavailable.
368 A pool's health status is described by one of three states: online, degraded,
369 or faulted. An online pool has all devices operating normally. A degraded pool
370 is one in which one or more devices have failed, but the data is still
371 available due to a redundant configuration. A faulted pool has corrupted
372 metadata, or one or more faulted devices, and insufficient replicas to continue
375 The health of the top-level
380 potentially impacted by the state of its associated
382 or component devices. A top-level
384 or component device is in one of the following states:
385 .Bl -tag -width "DEGRADED"
387 One or more top-level
389 is in the degraded state because one or more
390 component devices are offline. Sufficient replicas exist to continue
393 One or more component devices is in the degraded or faulted state, but
394 sufficient replicas exist to continue functioning. The underlying conditions
396 .Bl -bullet -offset 2n
398 The number of checksum errors exceeds acceptable levels and the device is
399 degraded as an indication that something may be wrong.
401 continues to use the device as necessary.
405 errors exceeds acceptable levels. The device could not be
406 marked as faulted because there are insufficient replicas to continue
410 One or more top-level
412 is in the faulted state because one or more
413 component devices are offline. Insufficient replicas exist to continue
416 One or more component devices is in the faulted state, and insufficient
417 replicas exist to continue functioning. The underlying conditions are as
419 .Bl -bullet -offset 2n
421 The device could be opened, but the contents did not match expected values.
425 errors exceeds acceptable levels and the device is faulted to
426 prevent further use of the device.
429 The device was explicitly taken offline by the
433 The device is online and functioning.
435 The device was physically removed while the system was running. Device removal
436 detection is hardware-dependent and may not be supported on all platforms.
438 The device could not be opened. If a pool is imported when a device was
439 unavailable, then the device will be identified by a unique identifier instead
440 of its path since the path was never correct in the first place.
443 If a device is removed and later reattached to the system,
445 attempts to put the device online automatically. Device attach detection is
446 hardware-dependent and might not be supported on all platforms.
449 allows devices to be associated with pools as
451 These devices are not actively used in the pool, but when an active device
452 fails, it is automatically replaced by a hot spare. To create a pool with hot
456 with any number of devices. For example,
457 .Bd -literal -offset 2n
458 .Li # Ic zpool create pool mirror da0 da1 spare da2 da3
461 Spares can be shared across multiple pools, and can be added with the
463 command and removed with the
465 command. Once a spare replacement is initiated, a new "spare"
468 within the configuration that will remain there until the original device is
469 replaced. At this point, the hot spare becomes available again if another
472 If a pool has a shared spare that is currently being used, the pool can not be
473 exported since other pools may use this shared spare, which may lead to
474 potential data corruption.
476 An in-progress spare replacement can be cancelled by detaching the hot spare.
477 If the original faulted device is detached, then the hot spare assumes its
478 place in the configuration, and is removed from the spare list of all active
481 Spares cannot replace log devices.
483 This feature requires a userland helper.
487 It must be manually enabled by adding
488 .Va zfsd_enable="YES"
498 requirements for synchronous transactions. For instance, databases often
499 require their transactions to be on stable storage devices when returning from
502 and other applications can also use
504 to ensure data stability. By default, the intent log is allocated from blocks
505 within the main pool. However, it might be possible to get better performance
506 using separate intent log devices such as
508 or a dedicated disk. For example:
509 .Bd -literal -offset 2n
510 .Li # Ic zpool create pool da0 da1 log da2
513 Multiple log devices can also be specified, and they can be mirrored. See the
515 section for an example of mirroring multiple log devices.
517 Log devices can be added, replaced, attached, detached, imported and exported
518 as part of the larger pool.
519 Mirrored devices can be removed by specifying the top-level mirror vdev.
521 Devices can be added to a storage pool as "cache devices." These devices
522 provide an additional layer of caching between main memory and disk. For
523 read-heavy workloads, where the working set size is much larger than what can
524 be cached in main memory, using cache devices allow much more of this working
525 set to be served from low latency media. Using cache devices provides the
526 greatest performance improvement for random read-workloads of mostly static
529 To create a pool with cache devices, specify a "cache"
531 with any number of devices. For example:
532 .Bd -literal -offset 2n
533 .Li # Ic zpool create pool da0 da1 cache da2 da3
536 Cache devices cannot be mirrored or part of a
538 configuration. If a read
539 error is encountered on a cache device, that read
541 is reissued to the original storage pool device, which might be part of a
546 The content of the cache devices is considered volatile, as is the case with
549 Before starting critical procedures that include destructive actions (e.g
551 ), an administrator can checkpoint the pool's state and in the case of a
552 mistake or failure, rewind the entire pool back to the checkpoint.
553 Otherwise, the checkpoint can be discarded when the procedure has completed
556 A pool checkpoint can be thought of as a pool-wide snapshot and should be used
557 with care as it contains every part of the pool's state, from properties to vdev
559 Thus, while a pool has a checkpoint certain operations are not allowed.
560 Specifically, vdev removal/attach/detach, mirror splitting, and
561 changing the pool's guid.
562 Adding a new vdev is supported but in the case of a rewind it will have to be
564 Finally, users of this feature should keep in mind that scrubs in a pool that
565 has a checkpoint do not repair checkpointed data.
567 To create a checkpoint for a pool:
569 # zpool checkpoint pool
572 To later rewind to its checkpointed state, you need to first export it and
573 then rewind it during import:
576 # zpool import --rewind-to-checkpoint pool
579 To discard the checkpoint from a pool:
581 # zpool checkpoint -d pool
584 Dataset reservations (controlled by the
588 zfs properties) may be unenforceable while a checkpoint exists, because the
589 checkpoint is allowed to consume the dataset's reservation.
590 Finally, data that is part of the checkpoint but has been freed in the
591 current state of the pool won't be scanned during a scrub.
593 Each pool has several properties associated with it. Some properties are
594 read-only statistics while others are configurable and change the behavior of
595 the pool. The following are read-only properties:
596 .Bl -tag -width "dedupratio"
598 Amount of storage space within the pool that has been physically allocated.
600 Percentage of pool space used. This property can also be referred to by its
601 shortened column name, "cap".
603 A text string consisting of printable ASCII characters that will be stored
604 such that it is available even if the pool becomes faulted. An administrator
605 can provide additional information about a pool using this property.
607 The deduplication ratio specified for a pool, expressed as a multiplier.
610 value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See
612 for a description of the deduplication feature.
614 Amount of uninitialized space within the pool or device that can be used to
615 increase the total capacity of the pool.
616 Uninitialized space consists of
617 any space on an EFI labeled vdev which has not been brought online
618 .Pq i.e. zpool online -e .
619 This space occurs when a LUN is dynamically expanded.
621 The amount of fragmentation in the pool.
623 Number of blocks within the pool that are not allocated.
625 After a file system or snapshot is destroyed, the space it was using is
626 returned to the pool asynchronously.
628 is the amount of space remaining to be reclaimed.
635 A unique identifier for the pool.
637 The current health of the pool. Health can be
646 Total size of the storage pool.
647 .It Sy unsupported@ Ns Ar feature_guid
648 Information about unsupported features that are enabled on the pool.
653 Amount of storage space used within the pool.
656 The space usage properties report actual physical space available to the
657 storage pool. The physical space can be different from the total amount of
658 space that any contained datasets can actually use. The amount of space used in
661 configuration depends on the characteristics of the data being written.
664 reserves some space for internal accounting that the
666 command takes into account, but the
668 command does not. For non-full pools of a reasonable size, these effects should
669 be invisible. For small pools, or pools that are close to being completely
670 full, these discrepancies may become more noticeable.
672 The following property can be set at creation time and import time:
675 Alternate root directory. If set, this directory is prepended to any mount
676 points within the pool. This can be used when examining an unknown pool where
677 the mount points cannot be trusted, or in an alternate boot environment, where
678 the typical paths are not valid.
680 is not a persistent property. It is valid only while the system is up.
685 though this may be overridden using an explicit setting.
688 The following property can only be set at import time:
690 .It Sy readonly Ns = Ns Cm on No | Cm off
693 pool will be imported in read-only mode with the following restrictions:
694 .Bl -bullet -offset 2n
696 Synchronous data in the intent log will not be accessible
698 Properties of the pool can not be changed
700 Datasets of this pool can only be mounted read-only
702 To write to a read-only pool, a export and import of the pool is required.
705 This property can also be referred to by its shortened column name,
709 The following properties can be set at creation time and import time, and later
714 .It Sy autoexpand Ns = Ns Cm on No | Cm off
715 Controls automatic pool expansion when the underlying LUN is grown. If set to
717 the pool will be resized according to the size of the expanded
718 device. If the device is part of a mirror or
720 then all devices within that
721 .No mirror/ Ns No raidz
722 group must be expanded before the new space is made available to
723 the pool. The default behavior is
725 This property can also be referred to by its shortened column name,
727 .It Sy autoreplace Ns = Ns Cm on No | Cm off
728 Controls automatic device replacement. If set to
730 device replacement must be initiated by the administrator by using the
734 any new device, found in the same
735 physical location as a device that previously belonged to the pool, is
736 automatically formatted and replaced. The default behavior is
738 This property can also be referred to by its shortened column name, "replace".
739 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
740 Identifies the default bootable dataset for the root pool. This property is
741 expected to be set mainly by the installation and upgrade programs.
742 .It Sy cachefile Ns = Ns Ar path No | Cm none
743 Controls the location of where the pool configuration is cached. Discovering
744 all pools on system startup requires a cached copy of the configuration data
745 that is stored on the root file system. All pools in this cache are
746 automatically imported when the system boots. Some environments, such as
747 install and clustering, need to cache this information in a different location
748 so that pools are not automatically imported. Setting this property caches the
749 pool configuration in a different location that can later be imported with
750 .Qq Nm Cm import Fl c .
751 Setting it to the special value
753 creates a temporary pool that is never cached, and the special value
755 (empty string) uses the default location.
756 .It Sy comment Ns = Ns Ar text
757 A text string consisting of printable ASCII characters that will be stored
758 such that it is available even if the pool becomes faulted.
759 An administrator can provide additional information about a pool using this
761 .It Sy dedupditto Ns = Ns Ar number
762 Threshold for the number of block ditto copies. If the reference count for a
763 deduplicated block increases above this number, a new ditto copy of this block
764 is automatically stored. Default setting is
766 which causes no ditto copies to be created for deduplicated blocks.
767 The miniumum legal nonzero setting is 100.
768 .It Sy delegation Ns = Ns Cm on No | Cm off
769 Controls whether a non-privileged user is granted access based on the dataset
770 permissions defined on the dataset. See
772 for more information on
774 delegated administration.
775 .It Sy failmode Ns = Ns Cm wait No | Cm continue No | Cm panic
776 Controls the system behavior in the event of catastrophic pool failure. This
777 condition is typically a result of a loss of connectivity to the underlying
778 storage device(s) or a failure of all devices within the pool. The behavior of
779 such an event is determined as follows:
780 .Bl -tag -width indent
784 access until the device connectivity is recovered and the errors are cleared.
785 This is the default behavior.
791 requests but allows reads to any of the remaining healthy devices. Any write
792 requests that have yet to be committed to disk would be blocked.
794 Prints out a message to the console and generates a system crash dump.
796 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
797 The value of this property is the current state of
799 The only valid value when setting this property is
803 to the enabled state.
806 for details on feature states.
807 .It Sy listsnaps Ns = Ns Cm on No | Cm off
808 Controls whether information about snapshots associated with this pool is
813 option. The default value is
815 .It Sy version Ns = Ns Ar version
816 The current on-disk version of the pool. This can be increased, but never
817 decreased. The preferred method of updating pools is with the
819 command, though this property can be used when a specific version is needed
820 for backwards compatibility.
821 Once feature flags is enabled on a pool this property will no longer have a
825 All subcommands that modify state are logged persistently to the pool in their
830 command provides subcommands to create and destroy storage pools, add capacity
831 to storage pools, and provide information about the storage pools. The following
832 subcommands are supported:
839 Displays a help message.
847 Adds the specified virtual devices to the given pool. The
849 specification is described in the
850 .Qq Sx Virtual Devices
851 section. The behavior of the
853 option, and the device checks performed are described in the
856 .Bl -tag -width indent
860 even if they appear in use or specify a conflicting replication level.
861 Not all devices can be overridden in this manner.
863 Displays the configuration that would be used without actually adding the
865 The actual pool creation can still fail due to insufficient privileges or device
868 Do not add a disk that is currently configured as a quorum device to a zpool.
869 After a disk is in the pool, that disk can then be configured as a quorum
876 .Ar pool device new_device
883 device. The existing device cannot be part of a
887 is not currently part of a mirrored configuration,
889 automatically transforms into a two-way mirror of
890 .Ar device No and Ar new_device .
893 is part of a two-way mirror, attaching
895 creates a three-way mirror, and so on. In either case,
897 begins to resilver immediately.
898 .Bl -tag -width indent
902 even if its appears to be in use. Not all devices can be overridden in this
911 Checkpoints the current state of
913 , which can be later restored by
914 .Nm zpool Cm import --rewind-to-checkpoint .
915 The existence of a checkpoint in a pool prohibits the following
924 In addition, it may break reservation boundaries if the pool lacks free
928 command indicates the existence of a checkpoint or the progress of discarding a
929 checkpoint from a pool.
932 command reports how much space the checkpoint takes from the pool.
935 Discards an existing checkpoint from
946 Clears device errors in a pool. If no arguments are specified, all device
947 errors within the pool are cleared. If one or more devices is specified, only
948 those errors associated with the specified device or devices are cleared.
949 .Bl -tag -width indent
951 Initiates recovery mode for an unopenable pool. Attempts to discard the last
952 few transactions in the pool to return it to an openable state. Not all damaged
953 pools can be recovered by using this option. If successful, the data from the
954 discarded transactions is irretrievably lost.
956 Used in combination with the
958 flag. Check whether discarding transactions would make the pool openable, but
959 do not actually discard any transactions.
965 .Op Fl o Ar property Ns = Ns Ar value
967 .Op Fl O Ar file-system-property Ns = Ns Ar value
969 .Op Fl m Ar mountpoint
975 Creates a new storage pool containing the virtual devices specified on the
976 command line. The pool name must begin with a letter, and can only contain
977 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
978 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
979 names beginning with the pattern "c[0-9]". The
981 specification is described in the
982 .Qq Sx Virtual Devices
985 The command verifies that each device specified is accessible and not currently
986 in use by another subsystem. There are some uses, such as being currently
987 mounted, or specified as the dedicated dump device, that prevents a device from
990 Other uses, such as having a preexisting
992 file system, can be overridden with the
996 The command also checks that the replication strategy for the pool is
997 consistent. An attempt to combine redundant and non-redundant storage in a
998 single pool, or to mix disks and files, results in an error unless
1000 is specified. The use of differently sized devices within a single
1002 or mirror group is also flagged as an error unless
1008 option is specified, the default mount point is
1010 The mount point must not exist or must be empty, or else the
1011 root dataset cannot be mounted. This can be overridden with the
1015 By default all supported features are enabled on the new pool unless the
1017 option is specified.
1018 .Bl -tag -width indent
1022 even if they appear in use or specify a conflicting replication level.
1023 Not all devices can be overridden in this manner.
1025 Displays the configuration that would be used without actually creating the
1026 pool. The actual pool creation can still fail due to insufficient privileges or
1029 Do not enable any features on the new pool.
1030 Individual features can be enabled by setting their corresponding properties
1037 .Xr zpool-features 7
1038 for details about feature properties.
1040 .Fl o Ar property Ns = Ns Ar value
1041 .Op Fl o Ar property Ns = Ns Ar value
1044 Sets the given pool properties. See the
1046 section for a list of valid properties that can be set.
1049 .Ar file-system-property Ns = Ns Ar value
1050 .Op Fl O Ar file-system-property Ns = Ns Ar value
1053 Sets the given file system properties in the root file system of the pool. See
1054 .Xr zfs 8 Properties
1055 for a list of valid properties that
1059 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1060 .It Fl m Ar mountpoint
1061 Sets the mount point for the root dataset. The default mount point is
1064 .Qq Cm altroot Ns Pa /pool
1067 is specified. The mount point must be an absolute path,
1071 For more information on dataset mount points, see
1073 .It Fl t Ar tempname
1074 Sets the in-core pool name to
1076 while the on-disk name will be the name specified as the pool name
1078 This will set the default
1082 This is intended to handle name space collisions when creating pools
1083 for other systems, such as virtual machines or physical machines
1084 whose pools live on network block devices.
1093 Destroys the given pool, freeing up any devices for other use. This command
1094 tries to unmount any active datasets before destroying the pool.
1095 .Bl -tag -width indent
1097 Forces any active datasets contained within the pool to be unmounted.
1107 from a mirror. The operation is refused if there are no other valid replicas
1116 Exports the given pools from the system. All devices are marked as exported,
1117 but are still considered in use by other subsystems. The devices can be moved
1118 between systems (even those of different endianness) and imported as long as a
1119 sufficient number of devices are present.
1121 Before exporting the pool, all datasets within the pool are unmounted. A pool
1122 can not be exported if it has a shared spare that is currently being used.
1124 For pools to be portable, you must give the
1126 command whole disks, not just slices, so that
1128 can label the disks with portable
1130 labels. Otherwise, disk drivers on platforms of different endianness will not
1131 recognize the disks.
1132 .Bl -tag -width indent
1134 Forcefully unmount all datasets, using the
1138 This command will forcefully export the pool even if it has a shared spare that
1139 is currently being used. This may lead to potential data corruption.
1145 .Op Fl o Ar field Ns Op , Ns Ar ...
1146 .Ar all | property Ns Op , Ns Ar ...
1150 Retrieves the given list of properties (or all properties if
1152 is used) for the specified storage pool(s). These properties are displayed with
1153 the following fields:
1154 .Bl -column -offset indent "property"
1155 .It name Ta Name of storage pool
1156 .It property Ta Property name
1157 .It value Ta Property value
1158 .It source Ta Property source, either 'default' or 'local'.
1163 section for more information on the available pool properties.
1165 Scripted mode. Do not display headers, and separate fields by a single tab
1166 instead of arbitrary space.
1168 Display numbers in parsable (exact) values.
1170 A comma-separated list of columns to display.
1172 .Sy property Ns , Ns
1175 is the default value.
1184 Displays the command history of the specified pools or all pools if no pool is
1186 .Bl -tag -width indent
1188 Displays internally logged
1190 events in addition to user initiated events.
1192 Displays log records in long format, which in addition to standard format
1193 includes, the user name, the hostname, and the zone in which the operation was
1199 .Op Fl d Ar dir | Fl c Ar cachefile
1203 Lists pools available to import. If the
1205 option is not specified, this command searches for devices in
1209 option can be specified multiple times, and all directories are searched. If
1210 the device appears to be part of an exported pool, this command displays a
1211 summary of the pool with the name of the pool, a numeric identifier, as well as
1214 layout and current health of the device for each device or file.
1215 Destroyed pools, pools that were previously destroyed with the
1217 command, are not listed unless the
1219 option is specified.
1221 The numeric identifier is unique, and can be used instead of the pool name when
1222 multiple exported pools of the same name are available.
1223 .Bl -tag -width indent
1224 .It Fl c Ar cachefile
1225 Reads configuration from the given
1227 that was created with the
1231 is used instead of searching for devices.
1233 Searches for devices or files in
1237 option can be specified multiple times.
1239 Lists destroyed pools only.
1245 .Op Fl o Ar property Ns = Ns Ar value
1247 .Op Fl d Ar dir | Fl c Ar cachefile
1257 Imports all pools found in the search directories. Identical to the previous
1258 command, except that all pools with a sufficient number of devices available
1259 are imported. Destroyed pools, pools that were previously destroyed with the
1261 command, will not be imported unless the
1263 option is specified.
1264 .Bl -tag -width indent
1266 Comma-separated list of mount options to use when mounting datasets within the
1269 for a description of dataset properties and mount options.
1270 .It Fl o Ar property Ns = Ns Ar value
1271 Sets the specified property on the imported pool. See the
1273 section for more information on the available pool properties.
1274 .It Fl c Ar cachefile
1275 Reads configuration from the given
1277 that was created with the
1281 is used instead of searching for devices.
1283 Searches for devices or files in
1287 option can be specified multiple times. This option is incompatible with the
1291 Imports destroyed pools only. The
1293 option is also required.
1295 Forces import, even if the pool appears to be potentially active.
1297 Allows a pool to import when there is a missing log device. Recent transactions
1298 can be lost because the log device will be discarded.
1300 Import the pool without mounting any file systems.
1311 Recovery mode for a non-importable pool. Attempt to return the pool to an
1312 importable state by discarding the last few transactions. Not all damaged pools
1313 can be recovered by using this option. If successful, the data from the
1314 discarded transactions is irretrievably lost. This option is ignored if the
1315 pool is importable or already imported.
1319 recovery option. Determines whether a non-importable pool can be made
1320 importable again, but does not actually perform the pool recovery. For more
1321 details about pool recovery mode, see the
1325 Searches for and imports all pools found.
1331 .Op Fl o Ar property Ns = Ns Ar value
1333 .Op Fl d Ar dir | Fl c Ar cachefile
1345 Imports a specific pool. A pool can be identified by its name or the numeric
1348 is specified, the pool is imported using the name
1350 Otherwise, it is imported with the same name as its exported name.
1352 If a device is removed from a system without running
1354 first, the device appears as potentially active. It cannot be determined if
1355 this was a failed export, or whether the device is really in use from another
1356 host. To import a pool in this state, the
1359 .Bl -tag -width indent
1361 Comma-separated list of mount options to use when mounting datasets within the
1364 for a description of dataset properties and mount options.
1365 .It Fl o Ar property Ns = Ns Ar value
1366 Sets the specified property on the imported pool. See the
1368 section for more information on the available pool properties.
1369 .It Fl c Ar cachefile
1370 Reads configuration from the given
1372 that was created with the
1376 is used instead of searching for devices.
1378 Searches for devices or files in
1382 option can be specified multiple times. This option is incompatible with the
1386 Imports destroyed pools only. The
1388 option is also required.
1390 Forces import, even if the pool appears to be potentially active.
1392 Allows a pool to import when there is a missing log device. Recent transactions
1393 can be lost because the log device will be discarded.
1395 Import the pool without mounting any file systems.
1398 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1405 Temporary pool names last until export.
1406 Ensures that the original pool name will be used in all label updates and
1407 therefore is retained upon export.
1412 when not explicitly specified.
1414 Recovery mode for a non-importable pool. Attempt to return the pool to an
1415 importable state by discarding the last few transactions. Not all damaged pools
1416 can be recovered by using this option. If successful, the data from the
1417 discarded transactions is irretrievably lost. This option is ignored if the
1418 pool is importable or already imported.
1422 recovery option. Determines whether a non-importable pool can be made
1423 importable again, but does not actually perform the pool recovery. For more
1424 details about pool recovery mode, see the
1427 .It Fl -rewind-to-checkpoint
1428 Rewinds pool to the checkpointed state.
1429 Once the pool is imported with this flag there is no way to undo the rewind.
1430 All changes and data that were written after the checkpoint are lost!
1431 The only exception is when the
1433 mounting option is enabled.
1434 In this case, the checkpointed state of the pool is opened and an
1435 administrator can see how the pool would look like if they were
1441 .Op Fl T Cm d Ns | Ns Cm u
1445 .Op Ar interval Op Ar count
1450 statistics for the given pools. When given an interval, the statistics are
1457 are specified, statistics for every pool in the system is shown. If
1459 is specified, the command exits after
1461 reports are printed.
1462 .Bl -tag -width indent
1463 .It Fl T Cm d Ns | Ns Cm u
1468 for standard date format. See
1473 .Pq equals Qq Ic date +%s .
1475 Verbose statistics. Reports usage statistics for individual
1477 within the pool, in addition to the pool-wide statistics.
1488 label information from the specified
1492 must not be part of an active pool configuration.
1493 .Bl -tag -width indent
1495 Treat exported or foreign devices as inactive.
1501 .Op Fl o Ar property Ns Op , Ns Ar ...
1502 .Op Fl T Cm d Ns | Ns Cm u
1505 .Op Ar inverval Op Ar count
1508 Lists the given pools along with a health status and space usage. If no
1510 are specified, all pools in the system are listed.
1512 When given an interval, the output is printed every
1518 is specified, the command exits after
1520 reports are printed.
1521 .Bl -tag -width indent
1522 .It Fl T Cm d Ns | Ns Cm u
1527 for standard date format. See
1532 .Pq equals Qq Ic date +%s .
1534 Scripted mode. Do not display headers, and separate fields by a single tab
1535 instead of arbitrary space.
1537 Display numbers in parsable (exact) values.
1539 Verbose statistics. Reports usage statistics for individual
1542 the pool, in addition to the pool-wide statistics.
1543 .It Fl o Ar property Ns Op , Ns Ar ...
1544 Comma-separated list of properties to display. See the
1546 section for a list of valid properties. The default list is
1558 .It Fl T Cm d Ns | Ns Cm u
1563 for standard date format. See
1568 .Pq equals Qq Ic date +%s .
1577 Takes the specified physical device offline. While the
1579 is offline, no attempt is made to read or write to the device.
1580 .Bl -tag -width indent
1582 Temporary. Upon reboot, the specified physical device reverts to its previous
1592 Brings the specified physical device online.
1594 This command is not applicable to spares or cache devices.
1595 .Bl -tag -width indent
1597 Expand the device to use all available space. If the device is part of a mirror
1600 then all devices must be expanded before the new space will become
1601 available to the pool.
1609 Generates a new unique identifier for the pool. You must ensure that all
1610 devices in this pool are online and healthy before performing this action.
1618 Removes the specified device from the pool.
1619 This command currently only supports removing hot spares, cache, log
1620 devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
1622 Removing a top-level vdev reduces the total amount of space in the storage pool.
1623 The specified device will be evacuated by copying all allocated space from it to
1624 the other devices in the pool.
1627 command initiates the removal and returns, while the evacuation continues in
1629 The removal progress can be monitored with
1630 .Nm zpool Cm status.
1631 This feature must be enabled to be used, see
1632 .Xr zpool-features 5
1634 A mirrored top-level device (log or data) can be removed by specifying the
1635 top-level mirror for the same.
1636 Non-log devices or data devices that are part of a mirrored configuration can
1637 be removed using the
1642 Do not actually perform the removal ("no-op").
1643 Instead, print the estimated amount of memory that will be used by the
1644 mapping table after the removal completes.
1645 This is nonzero only for top-level vdevs.
1649 Used in conjunction with the
1651 flag, displays numbers as parsable (exact) values.
1660 Stops and cancels an in-progress removal of a top-level vdev.
1667 Reopen all the vdevs associated with the pool.
1680 This is equivalent to attaching
1682 waiting for it to resilver, and then detaching
1687 must be greater than or equal to the minimum size
1688 of all the devices in a mirror or
1693 is required if the pool is not redundant. If
1695 is not specified, it defaults to
1697 This form of replacement is useful after an existing disk has failed and has
1698 been physically replaced. In this case, the new disk may have the same
1700 path as the old device, even though it is actually a different disk.
1703 .Bl -tag -width indent
1707 even if its appears to be in use. Not all devices can be overridden in this
1717 Begins a scrub or resumes a paused scrub.
1718 The scrub examines all data in the specified pools to verify that it checksums
1722 devices, ZFS automatically repairs any damage discovered during the scrub.
1725 command reports the progress of the scrub and summarizes the results of the
1726 scrub upon completion.
1728 Scrubbing and resilvering are very similar operations.
1729 The difference is that resilvering only examines data that ZFS knows to be out
1732 for example, when attaching a new device to a mirror or replacing an existing
1735 whereas scrubbing examines all data to discover silent errors due to hardware
1736 faults or disk failure.
1738 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1740 If a scrub is paused, the
1743 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1752 Scrub pause state and progress are periodically synced to disk.
1753 If the system is restarted or pool is exported during a paused scrub,
1754 even after import, scrub will remain paused until it is resumed.
1755 Once resumed the scrub will pick up from the place where it was last
1756 checkpointed to disk.
1757 To resume a paused scrub issue
1764 .Ar property Ns = Ns Ar value pool
1767 Sets the given property on the specified pool. See the
1769 section for more information on what properties can be set and acceptable
1777 .Op Fl o Ar property Ns = Ns Ar value
1782 Splits off one disk from each mirrored top-level
1784 in a pool and creates a new pool from the split-off disks. The original pool
1785 must be made up of one or more mirrors and must not be in the process of
1788 subcommand chooses the last device in each mirror
1790 unless overridden by a device specification on the command line.
1796 includes the specified device(s) in a new pool and, should any devices remain
1797 unspecified, assigns the last device in each mirror
1799 to that pool, as it does normally. If you are uncertain about the outcome of a
1803 ("dry-run") option to ensure your command will have the effect you intend.
1804 .Bl -tag -width indent
1806 Automatically import the newly created pool after splitting, using the
1809 parameter for the new pool's alternate root. See the
1815 Displays the configuration that would be created without actually splitting the
1816 pool. The actual pool split could still fail due to insufficient privileges or
1819 Comma-separated list of mount options to use when mounting datasets within the
1822 for a description of dataset properties and mount options. Valid only in
1823 conjunction with the
1826 .It Fl o Ar property Ns = Ns Ar value
1827 Sets the specified property on the new pool. See the
1829 section, above, for more information on the available pool properties.
1835 .Op Fl T Cm d Ns | Ns Cm u
1838 .Op Ar interval Op Ar count
1841 Displays the detailed health status for the given pools. If no
1843 is specified, then the status of each pool in the system is displayed. For more
1844 information on pool and device health, see the
1845 .Qq Sx Device Failure and Recovery
1848 When given an interval, the output is printed every
1854 is specified, the command exits after
1856 reports are printed.
1858 If a scrub or resilver is in progress, this command reports the percentage
1859 done and the estimated time to completion. Both of these are only approximate,
1860 because the amount of data in the pool and the other workloads on the system
1862 .Bl -tag -width indent
1864 Only display status for pools that are exhibiting errors or are otherwise
1866 Warnings about pools not using the latest on-disk format, having non-native
1867 block size or disabled features will not be included.
1869 Displays verbose data error information, printing out a complete list of all
1870 data errors since the last complete pool scrub.
1871 .It Fl T Cm d Ns | Ns Cm u
1876 for standard date format. See
1881 .Pq equals Qq Ic date +%s .
1889 Displays pools which do not have all supported features enabled and pools
1890 formatted using a legacy
1893 These pools can continue to be used, but some features may not be available.
1896 to enable all features on all pools.
1897 .Bl -tag -width indent
1901 versions supported by the current software.
1903 .Xr zpool-features 7
1904 for a description of feature flags features supported by the current software.
1913 Enables all supported features on the given pool.
1914 Once this is done, the pool will no longer be accessible on systems that do
1915 not support feature flags.
1917 .Xr zpool-features 7
1918 for details on compatibility with systems that support feature flags, but do
1919 not support all features enabled on the pool.
1920 .Bl -tag -width indent
1922 Enables all supported features on all pools.
1924 Upgrade to the specified legacy version. If the
1926 flag is specified, no features will be enabled on the pool.
1927 This option can only be used to increase version number up to the last
1928 supported legacy version number.
1932 The following exit values are returned:
1933 .Bl -tag -offset 2n -width 2n
1935 Successful completion.
1939 Invalid command line options were specified.
1943 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1945 The following command creates a pool with a single
1949 that consists of six disks.
1950 .Bd -literal -offset 2n
1951 .Li # Ic zpool create tank raidz da0 da1 da2 da3 da4 da5
1953 .It Sy Example 2 No Creating a Mirrored Storage Pool
1955 The following command creates a pool with two mirrors, where each mirror
1957 .Bd -literal -offset 2n
1958 .Li # Ic zpool create tank mirror da0 da1 mirror da2 da3
1960 .It Sy Example 3 No Creating a Tn ZFS No Storage Pool by Using Partitions
1962 The following command creates an unmirrored pool using two GPT partitions.
1963 .Bd -literal -offset 2n
1964 .Li # Ic zpool create tank da0p3 da1p3
1966 .It Sy Example 4 No Creating a Tn ZFS No Storage Pool by Using Files
1968 The following command creates an unmirrored pool using files. While not
1969 recommended, a pool based on files can be useful for experimental purposes.
1970 .Bd -literal -offset 2n
1971 .Li # Ic zpool create tank /path/to/file/a /path/to/file/b
1973 .It Sy Example 5 No Adding a Mirror to a Tn ZFS No Storage Pool
1975 The following command adds two mirrored disks to the pool
1977 assuming the pool is already made up of two-way mirrors. The additional space
1978 is immediately available to any datasets within the pool.
1979 .Bd -literal -offset 2n
1980 .Li # Ic zpool add tank mirror da2 da3
1982 .It Sy Example 6 No Listing Available Tn ZFS No Storage Pools
1984 The following command lists all available pools on the system.
1985 .Bd -literal -offset 2n
1987 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1988 pool 2.70T 473G 2.24T 33% - 17% 1.00x ONLINE -
1989 test 1.98G 89.5K 1.98G 48% - 0% 1.00x ONLINE -
1991 .It Sy Example 7 No Listing All Properties for a Pool
1993 The following command lists all the properties for a pool.
1994 .Bd -literal -offset 2n
1995 .Li # Ic zpool get all pool
1998 pool altroot - default
1999 pool health ONLINE -
2000 pool guid 2501120270416322443 default
2001 pool version 28 default
2002 pool bootfs pool/root local
2003 pool delegation on default
2004 pool autoreplace off default
2005 pool cachefile - default
2006 pool failmode wait default
2007 pool listsnapshots off default
2008 pool autoexpand off default
2009 pool dedupditto 0 default
2010 pool dedupratio 1.00x -
2012 pool allocated 473G -
2015 .It Sy Example 8 No Destroying a Tn ZFS No Storage Pool
2017 The following command destroys the pool
2019 and any datasets contained within.
2020 .Bd -literal -offset 2n
2021 .Li # Ic zpool destroy -f tank
2023 .It Sy Example 9 No Exporting a Tn ZFS No Storage Pool
2025 The following command exports the devices in pool
2027 so that they can be relocated or later imported.
2028 .Bd -literal -offset 2n
2029 .Li # Ic zpool export tank
2031 .It Sy Example 10 No Importing a Tn ZFS No Storage Pool
2033 The following command displays available pools, and then imports the pool
2035 for use on the system.
2037 The results from this command are similar to the following:
2038 .Bd -literal -offset 2n
2039 .Li # Ic zpool import
2042 id: 15451357997522795478
2044 action: The pool can be imported using its name or numeric identifier.
2056 Storage Pools to the Current Version
2059 The following command upgrades all
2061 Storage pools to the current version of
2063 .Bd -literal -offset 2n
2064 .Li # Ic zpool upgrade -a
2065 This system is currently running ZFS pool version 28.
2067 .It Sy Example 12 No Managing Hot Spares
2069 The following command creates a new pool with an available hot spare:
2070 .Bd -literal -offset 2n
2071 .Li # Ic zpool create tank mirror da0 da1 spare da2
2074 If one of the disks were to fail, the pool would be reduced to the degraded
2075 state. The failed device can be replaced using the following command:
2076 .Bd -literal -offset 2n
2077 .Li # Ic zpool replace tank da0 da2
2080 Once the data has been resilvered, the spare is automatically removed and is
2081 made available should another device fails. The hot spare can be permanently
2082 removed from the pool using the following command:
2083 .Bd -literal -offset 2n
2084 .Li # Ic zpool remove tank da2
2090 Pool with Mirrored Separate Intent Logs
2093 The following command creates a
2095 storage pool consisting of two, two-way
2096 mirrors and mirrored log devices:
2097 .Bd -literal -offset 2n
2098 .Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5
2100 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
2102 The following command adds two disks for use as cache devices to a
2105 .Bd -literal -offset 2n
2106 .Li # Ic zpool add pool cache da2 da3
2109 Once added, the cache devices gradually fill with content from main memory.
2110 Depending on the size of your cache devices, it could take over an hour for
2111 them to fill. Capacity and reads can be monitored using the
2113 subcommand as follows:
2114 .Bd -literal -offset 2n
2115 .Li # Ic zpool iostat -v pool 5
2119 Displaying expanded space on a device
2122 The following command dipslays the detailed information for the
2125 This pool is comprised of a single
2127 vdev where one of its
2128 devices increased its capacity by 10GB.
2129 In this example, the pool will not
2130 be able to utilized this extra capacity until all the devices under the
2132 vdev have been expanded.
2133 .Bd -literal -offset 2n
2134 .Li # Ic zpool list -v data
2135 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2136 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
2137 raidz1 23.9G 14.6G 9.30G 48% -
2144 Removing a Mirrored top-level (Log or Data) Device
2147 The following commands remove the mirrored log device
2149 and mirrored top-level data device
2152 Given this configuration:
2153 .Bd -literal -offset 2n
2156 scrub: none requested
2159 NAME STATE READ WRITE CKSUM
2161 mirror-0 ONLINE 0 0 0
2164 mirror-1 ONLINE 0 0 0
2168 mirror-2 ONLINE 0 0 0
2173 The command to remove the mirrored log
2176 .Bd -literal -offset 2n
2177 .Li # Ic zpool remove tank mirror-2
2180 The command to remove the mirrored data
2183 .Bd -literal -offset 2n
2184 .Li # Ic zpool remove tank mirror-1
2188 Recovering a Faulted
2193 If a pool is faulted but recoverable, a message indicating this state is
2196 if the pool was cached (see the
2198 argument above), or as part of the error output from a failed
2202 Recover a cached pool with the
2205 .Bd -literal -offset 2n
2206 .Li # Ic zpool clear -F data
2207 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
2208 Discarded approximately 29 seconds of transactions.
2211 If the pool configuration was not cached, use
2213 with the recovery mode flag:
2214 .Bd -literal -offset 2n
2215 .Li # Ic zpool import -F data
2216 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
2217 Discarded approximately 29 seconds of transactions.
2221 .Xr zpool-features 7 ,
2225 This manual page is a
2227 reimplementation of the
2231 modified and customized for
2233 and licensed under the Common Development and Distribution License
2238 implementation of this manual page was initially written by
2239 .An Martin Matuska Aq mm@FreeBSD.org .