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 2011, Nexenta Systems, Inc. All Rights Reserved.
23 .\" Copyright (c) 2011, Justin T. Gibbs <gibbs@FreeBSD.org>
24 .\" Copyright (c) 2012 by Delphix. All Rights Reserved.
25 .\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
34 .Nd configures ZFS storage pools
45 .Ar pool device new_device
54 .Op Fl o Ar property Ns = Ns Ar value
56 .Op Fl O Ar file-system-property Ns = Ns Ar value
58 .Op Fl m Ar mountpoint
75 .Op Fl o Ar field Ns Op , Ns Ar ...
76 .Ar all | property Ns Op , Ns Ar ...
85 .Op Fl d Ar dir | Fl c Ar cachefile
90 .Op Fl o Ar property Ns = Ns Ar value
92 .Op Fl d Ar dir | Fl c Ar cachefile
103 .Op Fl o Ar property Ns = Ns Ar value
105 .Op Fl d Ar dir | Fl c Ar cachefile
116 .Op Fl T Cm d Ns | Ns Cm u
127 .Op Fl o Ar property Ns Op , Ns Ar ...
128 .Op Fl T Cm d Ns | Ns Cm u
131 .Op Ar inverval Op Ar count
160 .Ar property Ns = Ns Ar value pool
166 .Op Fl o Ar property Ns = Ns Ar value
172 .Op Fl T Cm d Ns | Ns Cm u
175 .Op Ar interval Op Ar count
188 storage pools. A storage pool is a collection of devices that provides physical
189 storage and data replication for
193 All datasets within a storage pool share the same space. See
195 for information on managing datasets.
196 .Ss Virtual Devices (vdevs)
200 describes a single device or a collection of devices organized according to
201 certain performance and fault characteristics. The following virtual devices
203 .Bl -tag -width "XXXXXX"
205 A block device, typically located under
208 can use individual slices or partitions, though the recommended mode of
209 operation is to use whole disks. A disk can be specified by a full path to the
212 provider name. When given a whole disk,
214 automatically labels the disk, if necessary.
216 A regular file. The use of files as a backing store is strongly discouraged. It
217 is designed primarily for experimental purposes, as the fault tolerance of a
218 file is only as good the file system of which it is a part. A file must be
219 specified by a full path.
221 A mirror of two or more devices. Data is replicated in an identical fashion
222 across all components of a mirror. A mirror with
228 bytes and can withstand
230 devices failing before data integrity is compromised.
233 .Sy raidz1 raidz2 raidz3 ) .
236 that allows for better distribution of parity and eliminates the
238 write hole (in which data and parity become inconsistent after a power loss).
239 Data and parity is striped across all disks within a
245 group can have single-, double- , or triple parity, meaning that the
247 group can sustain one, two, or three failures, respectively, without
250 type specifies a single-parity
254 type specifies a double-parity
258 type specifies a triple-parity
273 parity disks can hold approximately
278 bytes and can withstand
280 device(s) failing before data integrity is compromised. The minimum number of
283 group is one more than the number of parity disks. The
284 recommended number is between 3 and 9 to help increase performance.
287 .No pseudo- Ns No vdev
288 which keeps track of available hot spares for a pool.
289 For more information, see the
293 A separate-intent log device. If more than one log device is specified, then
294 writes are load-balanced between devices. Log devices can be mirrored. However,
297 types are not supported for the intent log. For more information,
302 A device used to cache storage pool data. A cache device cannot be configured
305 group. For more information, see the
310 Virtual devices cannot be nested, so a mirror or
312 virtual device can only
313 contain files or disks. Mirrors of mirrors (or other combinations) are not
316 A pool can have any number of virtual devices at the top of the configuration
320 Data is dynamically distributed across all top-level devices to balance data
321 among devices. As new virtual devices are added,
323 automatically places data on the newly available devices.
325 Virtual devices are specified one at a time on the command line, separated by
326 whitespace. The keywords
330 are used to distinguish where a group ends and another begins. For example, the
331 following creates two root
333 each a mirror of two disks:
334 .Bd -literal -offset 2n
335 .Li # Ic zpool create mypool mirror da0 da1 mirror da2 da3
337 .Ss Device Failure and Recovery
339 supports a rich set of mechanisms for handling device failure and data
340 corruption. All metadata and data is checksummed, and
342 automatically repairs bad data from a good copy when corruption is detected.
344 In order to take advantage of these features, a pool must make use of some form
345 of redundancy, using either mirrored or
349 supports running in a non-redundant configuration, where each root
351 is simply a disk or file, this is strongly discouraged. A single case of bit
352 corruption can render some or all of your data unavailable.
354 A pool's health status is described by one of three states: online, degraded,
355 or faulted. An online pool has all devices operating normally. A degraded pool
356 is one in which one or more devices have failed, but the data is still
357 available due to a redundant configuration. A faulted pool has corrupted
358 metadata, or one or more faulted devices, and insufficient replicas to continue
361 The health of the top-level
366 potentially impacted by the state of its associated
368 or component devices. A top-level
370 or component device is in one of the following states:
371 .Bl -tag -width "DEGRADED"
373 One or more top-level
375 is in the degraded state because one or more
376 component devices are offline. Sufficient replicas exist to continue
379 One or more component devices is in the degraded or faulted state, but
380 sufficient replicas exist to continue functioning. The underlying conditions
382 .Bl -bullet -offset 2n
384 The number of checksum errors exceeds acceptable levels and the device is
385 degraded as an indication that something may be wrong.
387 continues to use the device as necessary.
391 errors exceeds acceptable levels. The device could not be
392 marked as faulted because there are insufficient replicas to continue
396 One or more top-level
398 is in the faulted state because one or more
399 component devices are offline. Insufficient replicas exist to continue
402 One or more component devices is in the faulted state, and insufficient
403 replicas exist to continue functioning. The underlying conditions are as
405 .Bl -bullet -offset 2n
407 The device could be opened, but the contents did not match expected values.
411 errors exceeds acceptable levels and the device is faulted to
412 prevent further use of the device.
415 The device was explicitly taken offline by the
419 The device is online and functioning.
421 The device was physically removed while the system was running. Device removal
422 detection is hardware-dependent and may not be supported on all platforms.
424 The device could not be opened. If a pool is imported when a device was
425 unavailable, then the device will be identified by a unique identifier instead
426 of its path since the path was never correct in the first place.
429 If a device is removed and later reattached to the system,
431 attempts to put the device online automatically. Device attach detection is
432 hardware-dependent and might not be supported on all platforms.
435 allows devices to be associated with pools as
437 These devices are not actively used in the pool, but when an active device
438 fails, it is automatically replaced by a hot spare. To create a pool with hot
442 with any number of devices. For example,
443 .Bd -literal -offset 2n
444 .Li # Ic zpool create pool mirror da0 da1 spare da2 da3
447 Spares can be shared across multiple pools, and can be added with the
449 command and removed with the
451 command. Once a spare replacement is initiated, a new "spare"
454 within the configuration that will remain there until the original device is
455 replaced. At this point, the hot spare becomes available again if another
458 If a pool has a shared spare that is currently being used, the pool can not be
459 exported since other pools may use this shared spare, which may lead to
460 potential data corruption.
462 An in-progress spare replacement can be cancelled by detaching the hot spare.
463 If the original faulted device is detached, then the hot spare assumes its
464 place in the configuration, and is removed from the spare list of all active
467 Spares cannot replace log devices.
475 requirements for synchronous transactions. For instance, databases often
476 require their transactions to be on stable storage devices when returning from
479 and other applications can also use
481 to ensure data stability. By default, the intent log is allocated from blocks
482 within the main pool. However, it might be possible to get better performance
483 using separate intent log devices such as
485 or a dedicated disk. For example:
486 .Bd -literal -offset 2n
487 .Li # Ic zpool create pool da0 da1 log da2
490 Multiple log devices can also be specified, and they can be mirrored. See the
492 section for an example of mirroring multiple log devices.
494 Log devices can be added, replaced, attached, detached, imported and exported
495 as part of the larger pool. Mirrored log devices can be removed by specifying
496 the top-level mirror for the log.
498 Devices can be added to a storage pool as "cache devices." These devices
499 provide an additional layer of caching between main memory and disk. For
500 read-heavy workloads, where the working set size is much larger than what can
501 be cached in main memory, using cache devices allow much more of this working
502 set to be served from low latency media. Using cache devices provides the
503 greatest performance improvement for random read-workloads of mostly static
506 To create a pool with cache devices, specify a "cache"
508 with any number of devices. For example:
509 .Bd -literal -offset 2n
510 .Li # Ic zpool create pool da0 da1 cache da2 da3
513 Cache devices cannot be mirrored or part of a
515 configuration. If a read
516 error is encountered on a cache device, that read
518 is reissued to the original storage pool device, which might be part of a
523 The content of the cache devices is considered volatile, as is the case with
526 Each pool has several properties associated with it. Some properties are
527 read-only statistics while others are configurable and change the behavior of
528 the pool. The following are read-only properties:
529 .Bl -tag -width "dedupratio"
531 Amount of storage space within the pool that has been physically allocated.
533 Percentage of pool space used. This property can also be referred to by its
534 shortened column name, "cap".
536 A text string consisting of printable ASCII characters that will be stored
537 such that it is available even if the pool becomes faulted. An administrator
538 can provide additional information about a pool using this property.
540 The deduplication ratio specified for a pool, expressed as a multiplier.
543 value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See
545 for a description of the deduplication feature.
547 Number of blocks within the pool that are not allocated.
549 After a file system or snapshot is destroyed, the space it was using is
550 returned to the pool asynchronously.
552 is the amount of space remaining to be reclaimed.
559 Amount of uninitialized space within the pool or device that can be used to
560 increase the total capacity of the pool.
561 Uninitialized space consists of
562 any space on an EFI labeled vdev which has not been brought online
563 .Pq i.e. zpool online -e .
564 This space occurs when a LUN is dynamically expanded.
566 A unique identifier for the pool.
568 The current health of the pool. Health can be
577 Total size of the storage pool.
578 .It Sy unsupported@ Ns Ar feature_guid
579 Information about unsupported features that are enabled on the pool.
584 Amount of storage space used within the pool.
587 The space usage properties report actual physical space available to the
588 storage pool. The physical space can be different from the total amount of
589 space that any contained datasets can actually use. The amount of space used in
592 configuration depends on the characteristics of the data being written.
595 reserves some space for internal accounting that the
597 command takes into account, but the
599 command does not. For non-full pools of a reasonable size, these effects should
600 be invisible. For small pools, or pools that are close to being completely
601 full, these discrepancies may become more noticeable.
603 The following property can be set at creation time and import time:
606 Alternate root directory. If set, this directory is prepended to any mount
607 points within the pool. This can be used when examining an unknown pool where
608 the mount points cannot be trusted, or in an alternate boot environment, where
609 the typical paths are not valid.
611 is not a persistent property. It is valid only while the system is up.
616 though this may be overridden using an explicit setting.
619 The following property can only be set at import time:
621 .It Sy readonly Ns = Ns Cm on No | Cm off
624 pool will be imported in read-only mode with the following restrictions:
625 .Bl -bullet -offset 2n
627 Synchronous data in the intent log will not be accessible
629 Properties of the pool can not be changed
631 Datasets of this pool can only be mounted read-only
633 To write to a read-only pool, a export and import of the pool is required.
636 This property can also be referred to by its shortened column name,
640 The following properties can be set at creation time and import time, and later
645 .It Sy autoexpand Ns = Ns Cm on No | Cm off
646 Controls automatic pool expansion when the underlying LUN is grown. If set to
648 the pool will be resized according to the size of the expanded
649 device. If the device is part of a mirror or
651 then all devices within that
652 .No mirror/ Ns No raidz
653 group must be expanded before the new space is made available to
654 the pool. The default behavior is
656 This property can also be referred to by its shortened column name,
658 .It Sy autoreplace Ns = Ns Cm on No | Cm off
659 Controls automatic device replacement. If set to
661 device replacement must be initiated by the administrator by using the
665 any new device, found in the same
666 physical location as a device that previously belonged to the pool, is
667 automatically formatted and replaced. The default behavior is
669 This property can also be referred to by its shortened column name, "replace".
670 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
671 Identifies the default bootable dataset for the root pool. This property is
672 expected to be set mainly by the installation and upgrade programs.
673 .It Sy cachefile Ns = Ns Ar path No | Cm none
674 Controls the location of where the pool configuration is cached. Discovering
675 all pools on system startup requires a cached copy of the configuration data
676 that is stored on the root file system. All pools in this cache are
677 automatically imported when the system boots. Some environments, such as
678 install and clustering, need to cache this information in a different location
679 so that pools are not automatically imported. Setting this property caches the
680 pool configuration in a different location that can later be imported with
681 .Qq Nm Cm import Fl c .
682 Setting it to the special value
684 creates a temporary pool that is never cached, and the special value
686 (empty string) uses the default location.
687 .It Sy comment Ns = Ns Ar text
688 A text string consisting of printable ASCII characters that will be stored
689 such that it is available even if the pool becomes faulted.
690 An administrator can provide additional information about a pool using this
692 .It Sy dedupditto Ns = Ns Ar number
693 Threshold for the number of block ditto copies. If the reference count for a
694 deduplicated block increases above this number, a new ditto copy of this block
695 is automatically stored. Default setting is
697 which causes no ditto copies to be created for deduplicated blocks.
698 The miniumum legal nonzero setting is 100.
699 .It Sy delegation Ns = Ns Cm on No | Cm off
700 Controls whether a non-privileged user is granted access based on the dataset
701 permissions defined on the dataset. See
703 for more information on
705 delegated administration.
706 .It Sy failmode Ns = Ns Cm wait No | Cm continue No | Cm panic
707 Controls the system behavior in the event of catastrophic pool failure. This
708 condition is typically a result of a loss of connectivity to the underlying
709 storage device(s) or a failure of all devices within the pool. The behavior of
710 such an event is determined as follows:
711 .Bl -tag -width indent
715 access until the device connectivity is recovered and the errors are cleared.
716 This is the default behavior.
722 requests but allows reads to any of the remaining healthy devices. Any write
723 requests that have yet to be committed to disk would be blocked.
725 Prints out a message to the console and generates a system crash dump.
727 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
728 The value of this property is the current state of
730 The only valid value when setting this property is
734 to the enabled state.
737 for details on feature states.
738 .It Sy listsnaps Ns = Ns Cm on No | Cm off
739 Controls whether information about snapshots associated with this pool is
744 option. The default value is
746 .It Sy version Ns = Ns Ar version
747 The current on-disk version of the pool. This can be increased, but never
748 decreased. The preferred method of updating pools is with the
750 command, though this property can be used when a specific version is needed
751 for backwards compatibility.
752 Once feature flags is enabled on a pool this property will no longer have a
756 All subcommands that modify state are logged persistently to the pool in their
761 command provides subcommands to create and destroy storage pools, add capacity
762 to storage pools, and provide information about the storage pools. The following
763 subcommands are supported:
770 Displays a help message.
778 Adds the specified virtual devices to the given pool. The
780 specification is described in the
781 .Qq Sx Virtual Devices
782 section. The behavior of the
784 option, and the device checks performed are described in the
787 .Bl -tag -width indent
791 even if they appear in use or specify a conflicting replication level.
792 Not all devices can be overridden in this manner.
794 Displays the configuration that would be used without actually adding the
796 The actual pool creation can still fail due to insufficient privileges or device
799 Do not add a disk that is currently configured as a quorum device to a zpool.
800 After a disk is in the pool, that disk can then be configured as a quorum
807 .Ar pool device new_device
814 device. The existing device cannot be part of a
818 is not currently part of a mirrored configuration,
820 automatically transforms into a two-way mirror of
821 .Ar device No and Ar new_device .
824 is part of a two-way mirror, attaching
826 creates a three-way mirror, and so on. In either case,
828 begins to resilver immediately.
829 .Bl -tag -width indent
833 even if its appears to be in use. Not all devices can be overridden in this
844 Clears device errors in a pool. If no arguments are specified, all device
845 errors within the pool are cleared. If one or more devices is specified, only
846 those errors associated with the specified device or devices are cleared.
847 .Bl -tag -width indent
849 Initiates recovery mode for an unopenable pool. Attempts to discard the last
850 few transactions in the pool to return it to an openable state. Not all damaged
851 pools can be recovered by using this option. If successful, the data from the
852 discarded transactions is irretrievably lost.
854 Used in combination with the
856 flag. Check whether discarding transactions would make the pool openable, but
857 do not actually discard any transactions.
863 .Op Fl o Ar property Ns = Ns Ar value
865 .Op Fl O Ar file-system-property Ns = Ns Ar value
867 .Op Fl m Ar mountpoint
872 Creates a new storage pool containing the virtual devices specified on the
873 command line. The pool name must begin with a letter, and can only contain
874 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
875 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
876 names beginning with the pattern "c[0-9]". The
878 specification is described in the
879 .Qq Sx Virtual Devices
882 The command verifies that each device specified is accessible and not currently
883 in use by another subsystem. There are some uses, such as being currently
884 mounted, or specified as the dedicated dump device, that prevents a device from
887 Other uses, such as having a preexisting
889 file system, can be overridden with the
893 The command also checks that the replication strategy for the pool is
894 consistent. An attempt to combine redundant and non-redundant storage in a
895 single pool, or to mix disks and files, results in an error unless
897 is specified. The use of differently sized devices within a single
899 or mirror group is also flagged as an error unless
905 option is specified, the default mount point is
907 The mount point must not exist or must be empty, or else the
908 root dataset cannot be mounted. This can be overridden with the
912 By default all supported features are enabled on the new pool unless the
915 .Bl -tag -width indent
919 even if they appear in use or specify a conflicting replication level.
920 Not all devices can be overridden in this manner.
922 Displays the configuration that would be used without actually creating the
923 pool. The actual pool creation can still fail due to insufficient privileges or
926 Do not enable any features on the new pool.
927 Individual features can be enabled by setting their corresponding properties
935 for details about feature properties.
937 .Fl o Ar property Ns = Ns Ar value
938 .Op Fl o Ar property Ns = Ns Ar value
941 Sets the given pool properties. See the
943 section for a list of valid properties that can be set.
946 .Ar file-system-property Ns = Ns Ar value
947 .Op Fl O Ar file-system-property Ns = Ns Ar value
950 Sets the given file system properties in the root file system of the pool. See
952 for a list of valid properties that
956 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
957 .It Fl m Ar mountpoint
958 Sets the mount point for the root dataset. The default mount point is
961 .Qq Cm altroot Ns Pa /pool
964 is specified. The mount point must be an absolute path,
968 For more information on dataset mount points, see
978 Destroys the given pool, freeing up any devices for other use. This command
979 tries to unmount any active datasets before destroying the pool.
980 .Bl -tag -width indent
982 Forces any active datasets contained within the pool to be unmounted.
992 from a mirror. The operation is refused if there are no other valid replicas
1001 Exports the given pools from the system. All devices are marked as exported,
1002 but are still considered in use by other subsystems. The devices can be moved
1003 between systems (even those of different endianness) and imported as long as a
1004 sufficient number of devices are present.
1006 Before exporting the pool, all datasets within the pool are unmounted. A pool
1007 can not be exported if it has a shared spare that is currently being used.
1009 For pools to be portable, you must give the
1011 command whole disks, not just slices, so that
1013 can label the disks with portable
1015 labels. Otherwise, disk drivers on platforms of different endianness will not
1016 recognize the disks.
1017 .Bl -tag -width indent
1019 Forcefully unmount all datasets, using the
1023 This command will forcefully export the pool even if it has a shared spare that
1024 is currently being used. This may lead to potential data corruption.
1030 .Op Fl o Ar field Ns Op , Ns Ar ...
1031 .Ar all | property Ns Op , Ns Ar ...
1035 Retrieves the given list of properties (or all properties if
1037 is used) for the specified storage pool(s). These properties are displayed with
1038 the following fields:
1039 .Bl -column -offset indent "property"
1040 .It name Ta Name of storage pool
1041 .It property Ta Property name
1042 .It value Ta Property value
1043 .It source Ta Property source, either 'default' or 'local'.
1048 section for more information on the available pool properties.
1050 Scripted mode. Do not display headers, and separate fields by a single tab
1051 instead of arbitrary space.
1053 Display numbers in parsable (exact) values.
1055 A comma-separated list of columns to display.
1057 .Sy property Ns , Ns
1060 is the default value.
1069 Displays the command history of the specified pools or all pools if no pool is
1071 .Bl -tag -width indent
1073 Displays internally logged
1075 events in addition to user initiated events.
1077 Displays log records in long format, which in addition to standard format
1078 includes, the user name, the hostname, and the zone in which the operation was
1084 .Op Fl d Ar dir | Fl c Ar cachefile
1088 Lists pools available to import. If the
1090 option is not specified, this command searches for devices in
1094 option can be specified multiple times, and all directories are searched. If
1095 the device appears to be part of an exported pool, this command displays a
1096 summary of the pool with the name of the pool, a numeric identifier, as well as
1099 layout and current health of the device for each device or file.
1100 Destroyed pools, pools that were previously destroyed with the
1102 command, are not listed unless the
1104 option is specified.
1106 The numeric identifier is unique, and can be used instead of the pool name when
1107 multiple exported pools of the same name are available.
1108 .Bl -tag -width indent
1109 .It Fl c Ar cachefile
1110 Reads configuration from the given
1112 that was created with the
1116 is used instead of searching for devices.
1118 Searches for devices or files in
1122 option can be specified multiple times.
1124 Lists destroyed pools only.
1130 .Op Fl o Ar property Ns = Ns Ar value
1132 .Op Fl d Ar dir | Fl c Ar cachefile
1142 Imports all pools found in the search directories. Identical to the previous
1143 command, except that all pools with a sufficient number of devices available
1144 are imported. Destroyed pools, pools that were previously destroyed with the
1146 command, will not be imported unless the
1148 option is specified.
1149 .Bl -tag -width indent
1151 Comma-separated list of mount options to use when mounting datasets within the
1154 for a description of dataset properties and mount options.
1155 .It Fl o Ar property Ns = Ns Ar value
1156 Sets the specified property on the imported pool. See the
1158 section for more information on the available pool properties.
1159 .It Fl c Ar cachefile
1160 Reads configuration from the given
1162 that was created with the
1166 is used instead of searching for devices.
1168 Searches for devices or files in
1172 option can be specified multiple times. This option is incompatible with the
1176 Imports destroyed pools only. The
1178 option is also required.
1180 Forces import, even if the pool appears to be potentially active.
1182 Allows a pool to import when there is a missing log device. Recent transactions
1183 can be lost because the log device will be discarded.
1185 Import the pool without mounting any file systems.
1196 Recovery mode for a non-importable pool. Attempt to return the pool to an
1197 importable state by discarding the last few transactions. Not all damaged pools
1198 can be recovered by using this option. If successful, the data from the
1199 discarded transactions is irretrievably lost. This option is ignored if the
1200 pool is importable or already imported.
1204 recovery option. Determines whether a non-importable pool can be made
1205 importable again, but does not actually perform the pool recovery. For more
1206 details about pool recovery mode, see the
1210 Searches for and imports all pools found.
1216 .Op Fl o Ar property Ns = Ns Ar value
1218 .Op Fl d Ar dir | Fl c Ar cachefile
1229 Imports a specific pool. A pool can be identified by its name or the numeric
1232 is specified, the pool is imported using the name
1234 Otherwise, it is imported with the same name as its exported name.
1236 If a device is removed from a system without running
1238 first, the device appears as potentially active. It cannot be determined if
1239 this was a failed export, or whether the device is really in use from another
1240 host. To import a pool in this state, the
1243 .Bl -tag -width indent
1245 Comma-separated list of mount options to use when mounting datasets within the
1248 for a description of dataset properties and mount options.
1249 .It Fl o Ar property Ns = Ns Ar value
1250 Sets the specified property on the imported pool. See the
1252 section for more information on the available pool properties.
1253 .It Fl c Ar cachefile
1254 Reads configuration from the given
1256 that was created with the
1260 is used instead of searching for devices.
1262 Searches for devices or files in
1266 option can be specified multiple times. This option is incompatible with the
1270 Imports destroyed pools only. The
1272 option is also required.
1274 Forces import, even if the pool appears to be potentially active.
1276 Allows a pool to import when there is a missing log device. Recent transactions
1277 can be lost because the log device will be discarded.
1279 Import the pool without mounting any file systems.
1282 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1284 Recovery mode for a non-importable pool. Attempt to return the pool to an
1285 importable state by discarding the last few transactions. Not all damaged pools
1286 can be recovered by using this option. If successful, the data from the
1287 discarded transactions is irretrievably lost. This option is ignored if the
1288 pool is importable or already imported.
1292 recovery option. Determines whether a non-importable pool can be made
1293 importable again, but does not actually perform the pool recovery. For more
1294 details about pool recovery mode, see the
1301 .Op Fl T Cm d Ns | Ns Cm u
1305 .Op Ar interval Op Ar count
1310 statistics for the given pools. When given an interval, the statistics are
1317 are specified, statistics for every pool in the system is shown. If
1319 is specified, the command exits after
1321 reports are printed.
1322 .Bl -tag -width indent
1323 .It Fl T Cm d Ns | Ns Cm u
1328 for standard date format. See
1333 .Pq equals Qq Ic date +%s .
1335 Verbose statistics. Reports usage statistics for individual
1337 within the pool, in addition to the pool-wide statistics.
1348 label information from the specified
1352 must not be part of an active pool configuration.
1353 .Bl -tag -width indent
1355 Treat exported or foreign devices as inactive.
1361 .Op Fl o Ar property Ns Op , Ns Ar ...
1362 .Op Fl T Cm d Ns | Ns Cm u
1365 .Op Ar inverval Op Ar count
1368 Lists the given pools along with a health status and space usage. If no
1370 are specified, all pools in the system are listed.
1372 When given an interval, the output is printed every
1378 is specified, the command exits after
1380 reports are printed.
1381 .Bl -tag -width indent
1382 .It Fl T Cm d Ns | Ns Cm u
1387 for standard date format. See
1392 .Pq equals Qq Ic date +%s .
1394 Scripted mode. Do not display headers, and separate fields by a single tab
1395 instead of arbitrary space.
1397 Display numbers in parsable (exact) values.
1399 Verbose statistics. Reports usage statistics for individual
1402 the pool, in addition to the pool-wide statistics.
1403 .It Fl o Ar property Ns Op , Ns Ar ...
1404 Comma-separated list of properties to display. See the
1406 section for a list of valid properties. The default list is
1415 .It Fl T Cm d Ns | Ns Cm u
1420 for standard date format. See
1425 .Pq equals Qq Ic date +%s .
1434 Takes the specified physical device offline. While the
1436 is offline, no attempt is made to read or write to the device.
1437 .Bl -tag -width indent
1439 Temporary. Upon reboot, the specified physical device reverts to its previous
1449 Brings the specified physical device online.
1451 This command is not applicable to spares or cache devices.
1452 .Bl -tag -width indent
1454 Expand the device to use all available space. If the device is part of a mirror
1457 then all devices must be expanded before the new space will become
1458 available to the pool.
1466 Generates a new unique identifier for the pool. You must ensure that all
1467 devices in this pool are online and healthy before performing this action.
1474 Removes the specified device from the pool. This command currently only
1475 supports removing hot spares, cache, and log devices. A mirrored log device can
1476 be removed by specifying the top-level mirror for the log. Non-log devices that
1477 are part of a mirrored configuration can be removed using the
1479 command. Non-redundant and
1481 devices cannot be removed from a pool.
1488 Reopen all the vdevs associated with the pool.
1501 This is equivalent to attaching
1503 waiting for it to resilver, and then detaching
1508 must be greater than or equal to the minimum size
1509 of all the devices in a mirror or
1514 is required if the pool is not redundant. If
1516 is not specified, it defaults to
1518 This form of replacement is useful after an existing disk has failed and has
1519 been physically replaced. In this case, the new disk may have the same
1521 path as the old device, even though it is actually a different disk.
1524 .Bl -tag -width indent
1528 even if its appears to be in use. Not all devices can be overridden in this
1538 Begins a scrub. The scrub examines all data in the specified pools to verify
1539 that it checksums correctly. For replicated (mirror or
1543 automatically repairs any damage discovered during the scrub. The
1545 command reports the progress of the scrub and summarizes the results of the
1546 scrub upon completion.
1548 Scrubbing and resilvering are very similar operations. The difference is that
1549 resilvering only examines data that
1551 knows to be out of date (for example, when attaching a new device to a mirror
1552 or replacing an existing device), whereas scrubbing examines all data to
1553 discover silent errors due to hardware faults or disk failure.
1555 Because scrubbing and resilvering are
1556 .Tn I/O Ns -intensive
1559 only allows one at a time. If a scrub is already in progress, the
1561 command returns an error. To start a new scrub, you have to stop the old scrub
1563 .Qq Nm Cm scrub Fl s
1564 command first. If a resilver is in progress,
1566 does not allow a scrub to be started until the resilver completes.
1567 .Bl -tag -width indent
1574 .Ar property Ns = Ns Ar value pool
1577 Sets the given property on the specified pool. See the
1579 section for more information on what properties can be set and acceptable
1587 .Op Fl o Ar property Ns = Ns Ar value
1592 Splits off one disk from each mirrored top-level
1594 in a pool and creates a new pool from the split-off disks. The original pool
1595 must be made up of one or more mirrors and must not be in the process of
1598 subcommand chooses the last device in each mirror
1600 unless overridden by a device specification on the command line.
1606 includes the specified device(s) in a new pool and, should any devices remain
1607 unspecified, assigns the last device in each mirror
1609 to that pool, as it does normally. If you are uncertain about the outcome of a
1613 ("dry-run") option to ensure your command will have the effect you intend.
1614 .Bl -tag -width indent
1616 Automatically import the newly created pool after splitting, using the
1619 parameter for the new pool's alternate root. See the
1625 Displays the configuration that would be created without actually splitting the
1626 pool. The actual pool split could still fail due to insufficient privileges or
1629 Comma-separated list of mount options to use when mounting datasets within the
1632 for a description of dataset properties and mount options. Valid only in
1633 conjunction with the
1636 .It Fl o Ar property Ns = Ns Ar value
1637 Sets the specified property on the new pool. See the
1639 section, above, for more information on the available pool properties.
1645 .Op Fl T Cm d Ns | Ns Cm u
1648 .Op Ar interval Op Ar count
1651 Displays the detailed health status for the given pools. If no
1653 is specified, then the status of each pool in the system is displayed. For more
1654 information on pool and device health, see the
1655 .Qq Sx Device Failure and Recovery
1658 When given an interval, the output is printed every
1664 is specified, the command exits after
1666 reports are printed.
1668 If a scrub or resilver is in progress, this command reports the percentage
1669 done and the estimated time to completion. Both of these are only approximate,
1670 because the amount of data in the pool and the other workloads on the system
1672 .Bl -tag -width indent
1674 Only display status for pools that are exhibiting errors or are otherwise
1676 Warnings about pools not using the latest on-disk format, having non-native
1677 block size or disabled features will not be included.
1679 Displays verbose data error information, printing out a complete list of all
1680 data errors since the last complete pool scrub.
1681 .It Fl T Cm d Ns | Ns Cm u
1686 for standard date format. See
1691 .Pq equals Qq Ic date +%s .
1699 Displays pools which do not have all supported features enabled and pools
1700 formatted using a legacy
1703 These pools can continue to be used, but some features may not be available.
1706 to enable all features on all pools.
1707 .Bl -tag -width indent
1711 versions supported by the current software.
1713 .Xr zpool-features 7
1714 for a description of feature flags features supported by the current software.
1723 Enables all supported features on the given pool.
1724 Once this is done, the pool will no longer be accessible on systems that do
1725 not support feature flags.
1727 .Xr zpool-features 7
1728 for details on compatibility with systems that support feature flags, but do
1729 not support all features enabled on the pool.
1730 .Bl -tag -width indent
1732 Enables all supported features on all pools.
1734 Upgrade to the specified legacy version. If the
1736 flag is specified, no features will be enabled on the pool.
1737 This option can only be used to increase version number up to the last
1738 supported legacy version number.
1742 The following exit values are returned:
1743 .Bl -tag -offset 2n -width 2n
1745 Successful completion.
1749 Invalid command line options were specified.
1753 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1755 The following command creates a pool with a single
1759 that consists of six disks.
1760 .Bd -literal -offset 2n
1761 .Li # Ic zpool create tank raidz da0 da1 da2 da3 da4 da5
1763 .It Sy Example 2 No Creating a Mirrored Storage Pool
1765 The following command creates a pool with two mirrors, where each mirror
1767 .Bd -literal -offset 2n
1768 .Li # Ic zpool create tank mirror da0 da1 mirror da2 da3
1770 .It Sy Example 3 No Creating a Tn ZFS No Storage Pool by Using Partitions
1772 The following command creates an unmirrored pool using two GPT partitions.
1773 .Bd -literal -offset 2n
1774 .Li # Ic zpool create tank da0p3 da1p3
1776 .It Sy Example 4 No Creating a Tn ZFS No Storage Pool by Using Files
1778 The following command creates an unmirrored pool using files. While not
1779 recommended, a pool based on files can be useful for experimental purposes.
1780 .Bd -literal -offset 2n
1781 .Li # Ic zpool create tank /path/to/file/a /path/to/file/b
1783 .It Sy Example 5 No Adding a Mirror to a Tn ZFS No Storage Pool
1785 The following command adds two mirrored disks to the pool
1787 assuming the pool is already made up of two-way mirrors. The additional space
1788 is immediately available to any datasets within the pool.
1789 .Bd -literal -offset 2n
1790 .Li # Ic zpool add tank mirror da2 da3
1792 .It Sy Example 6 No Listing Available Tn ZFS No Storage Pools
1794 The following command lists all available pools on the system.
1795 .Bd -literal -offset 2n
1797 NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT
1798 pool 2.70T 473G 2.24T - 17% 1.00x ONLINE -
1799 test 1.98G 89.5K 1.98G - 0% 1.00x ONLINE -
1801 .It Sy Example 7 No Listing All Properties for a Pool
1803 The following command lists all the properties for a pool.
1804 .Bd -literal -offset 2n
1805 .Li # Ic zpool get all pool
1808 pool altroot - default
1809 pool health ONLINE -
1810 pool guid 2501120270416322443 default
1811 pool version 28 default
1812 pool bootfs pool/root local
1813 pool delegation on default
1814 pool autoreplace off default
1815 pool cachefile - default
1816 pool failmode wait default
1817 pool listsnapshots off default
1818 pool autoexpand off default
1819 pool dedupditto 0 default
1820 pool dedupratio 1.00x -
1822 pool allocated 473G -
1825 .It Sy Example 8 No Destroying a Tn ZFS No Storage Pool
1827 The following command destroys the pool
1829 and any datasets contained within.
1830 .Bd -literal -offset 2n
1831 .Li # Ic zpool destroy -f tank
1833 .It Sy Example 9 No Exporting a Tn ZFS No Storage Pool
1835 The following command exports the devices in pool
1837 so that they can be relocated or later imported.
1838 .Bd -literal -offset 2n
1839 .Li # Ic zpool export tank
1841 .It Sy Example 10 No Importing a Tn ZFS No Storage Pool
1843 The following command displays available pools, and then imports the pool
1845 for use on the system.
1847 The results from this command are similar to the following:
1848 .Bd -literal -offset 2n
1849 .Li # Ic zpool import
1852 id: 15451357997522795478
1854 action: The pool can be imported using its name or numeric identifier.
1866 Storage Pools to the Current Version
1869 The following command upgrades all
1871 Storage pools to the current version of
1873 .Bd -literal -offset 2n
1874 .Li # Ic zpool upgrade -a
1875 This system is currently running ZFS pool version 28.
1877 .It Sy Example 12 No Managing Hot Spares
1879 The following command creates a new pool with an available hot spare:
1880 .Bd -literal -offset 2n
1881 .Li # Ic zpool create tank mirror da0 da1 spare da2
1884 If one of the disks were to fail, the pool would be reduced to the degraded
1885 state. The failed device can be replaced using the following command:
1886 .Bd -literal -offset 2n
1887 .Li # Ic zpool replace tank da0 da2
1890 Once the data has been resilvered, the spare is automatically removed and is
1891 made available should another device fails. The hot spare can be permanently
1892 removed from the pool using the following command:
1893 .Bd -literal -offset 2n
1894 .Li # Ic zpool remove tank da2
1900 Pool with Mirrored Separate Intent Logs
1903 The following command creates a
1905 storage pool consisting of two, two-way
1906 mirrors and mirrored log devices:
1907 .Bd -literal -offset 2n
1908 .Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5
1910 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
1912 The following command adds two disks for use as cache devices to a
1915 .Bd -literal -offset 2n
1916 .Li # Ic zpool add pool cache da2 da3
1919 Once added, the cache devices gradually fill with content from main memory.
1920 Depending on the size of your cache devices, it could take over an hour for
1921 them to fill. Capacity and reads can be monitored using the
1923 subcommand as follows:
1924 .Bd -literal -offset 2n
1925 .Li # Ic zpool iostat -v pool 5
1927 .It Sy Example 15 No Removing a Mirrored Log Device
1929 The following command removes the mirrored log device
1932 Given this configuration:
1933 .Bd -literal -offset 2n
1936 scrub: none requested
1939 NAME STATE READ WRITE CKSUM
1941 mirror-0 ONLINE 0 0 0
1944 mirror-1 ONLINE 0 0 0
1948 mirror-2 ONLINE 0 0 0
1953 The command to remove the mirrored log
1956 .Bd -literal -offset 2n
1957 .Li # Ic zpool remove tank mirror-2
1959 .It Sy Example 16 No Recovering a Faulted Tn ZFS No Pool
1961 If a pool is faulted but recoverable, a message indicating this state is
1964 if the pool was cached (see the
1966 argument above), or as part of the error output from a failed
1970 Recover a cached pool with the
1973 .Bd -literal -offset 2n
1974 .Li # Ic zpool clear -F data
1975 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
1976 Discarded approximately 29 seconds of transactions.
1979 If the pool configuration was not cached, use
1981 with the recovery mode flag:
1982 .Bd -literal -offset 2n
1983 .Li # Ic zpool import -F data
1984 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
1985 Discarded approximately 29 seconds of transactions.
1989 .Xr zpool-features 7 ,
1992 This manual page is a
1994 reimplementation of the
1998 modified and customized for
2000 and licensed under the Common Development and Distribution License
2005 implementation of this manual page was initially written by
2006 .An Martin Matuska Aq mm@FreeBSD.org .
2010 feature requires a utility to detect zpool degradation and initiate
2011 disk replacement within the zpool. FreeBSD does not provide such a
2012 utility at this time.