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) 2013 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
76 .Op Fl o Ar field Ns Op , Ns Ar ...
77 .Ar all | property Ns Op , Ns Ar ...
86 .Op Fl d Ar dir | Fl c Ar cachefile
91 .Op Fl o Ar property Ns = Ns Ar value
93 .Op Fl d Ar dir | Fl c Ar cachefile
104 .Op Fl o Ar property Ns = Ns Ar value
106 .Op Fl d Ar dir | Fl c Ar cachefile
118 .Op Fl T Cm d Ns | Ns Cm u
129 .Op Fl o Ar property Ns Op , Ns Ar ...
130 .Op Fl T Cm d Ns | Ns Cm u
133 .Op Ar inverval Op Ar count
162 .Ar property Ns = Ns Ar value pool
168 .Op Fl o Ar property Ns = Ns Ar value
174 .Op Fl T Cm d Ns | Ns Cm u
177 .Op Ar interval Op Ar count
190 storage pools. A storage pool is a collection of devices that provides physical
191 storage and data replication for
195 All datasets within a storage pool share the same space. See
197 for information on managing datasets.
198 .Ss Virtual Devices (vdevs)
202 describes a single device or a collection of devices organized according to
203 certain performance and fault characteristics. The following virtual devices
205 .Bl -tag -width "XXXXXX"
207 A block device, typically located under
210 can use individual slices or partitions, though the recommended mode of
211 operation is to use whole disks. A disk can be specified by a full path to the
214 provider name. When given a whole disk,
216 automatically labels the disk, if necessary.
218 A regular file. The use of files as a backing store is strongly discouraged. It
219 is designed primarily for experimental purposes, as the fault tolerance of a
220 file is only as good the file system of which it is a part. A file must be
221 specified by a full path.
223 A mirror of two or more devices. Data is replicated in an identical fashion
224 across all components of a mirror. A mirror with
230 bytes and can withstand
232 devices failing before data integrity is compromised.
235 .Sy raidz1 raidz2 raidz3 ) .
238 that allows for better distribution of parity and eliminates the
240 write hole (in which data and parity become inconsistent after a power loss).
241 Data and parity is striped across all disks within a
247 group can have single-, double- , or triple parity, meaning that the
249 group can sustain one, two, or three failures, respectively, without
252 type specifies a single-parity
256 type specifies a double-parity
260 type specifies a triple-parity
275 parity disks can hold approximately
280 bytes and can withstand
282 device(s) failing before data integrity is compromised. The minimum number of
285 group is one more than the number of parity disks. The
286 recommended number is between 3 and 9 to help increase performance.
289 .No pseudo- Ns No vdev
290 which keeps track of available hot spares for a pool.
291 For more information, see the
295 A separate-intent log device. If more than one log device is specified, then
296 writes are load-balanced between devices. Log devices can be mirrored. However,
299 types are not supported for the intent log. For more information,
304 A device used to cache storage pool data. A cache device cannot be configured
307 group. For more information, see the
312 Virtual devices cannot be nested, so a mirror or
314 virtual device can only
315 contain files or disks. Mirrors of mirrors (or other combinations) are not
318 A pool can have any number of virtual devices at the top of the configuration
322 Data is dynamically distributed across all top-level devices to balance data
323 among devices. As new virtual devices are added,
325 automatically places data on the newly available devices.
327 Virtual devices are specified one at a time on the command line, separated by
328 whitespace. The keywords
332 are used to distinguish where a group ends and another begins. For example, the
333 following creates two root
335 each a mirror of two disks:
336 .Bd -literal -offset 2n
337 .Li # Ic zpool create mypool mirror da0 da1 mirror da2 da3
339 .Ss Device Failure and Recovery
341 supports a rich set of mechanisms for handling device failure and data
342 corruption. All metadata and data is checksummed, and
344 automatically repairs bad data from a good copy when corruption is detected.
346 In order to take advantage of these features, a pool must make use of some form
347 of redundancy, using either mirrored or
351 supports running in a non-redundant configuration, where each root
353 is simply a disk or file, this is strongly discouraged. A single case of bit
354 corruption can render some or all of your data unavailable.
356 A pool's health status is described by one of three states: online, degraded,
357 or faulted. An online pool has all devices operating normally. A degraded pool
358 is one in which one or more devices have failed, but the data is still
359 available due to a redundant configuration. A faulted pool has corrupted
360 metadata, or one or more faulted devices, and insufficient replicas to continue
363 The health of the top-level
368 potentially impacted by the state of its associated
370 or component devices. A top-level
372 or component device is in one of the following states:
373 .Bl -tag -width "DEGRADED"
375 One or more top-level
377 is in the degraded state because one or more
378 component devices are offline. Sufficient replicas exist to continue
381 One or more component devices is in the degraded or faulted state, but
382 sufficient replicas exist to continue functioning. The underlying conditions
384 .Bl -bullet -offset 2n
386 The number of checksum errors exceeds acceptable levels and the device is
387 degraded as an indication that something may be wrong.
389 continues to use the device as necessary.
393 errors exceeds acceptable levels. The device could not be
394 marked as faulted because there are insufficient replicas to continue
398 One or more top-level
400 is in the faulted state because one or more
401 component devices are offline. Insufficient replicas exist to continue
404 One or more component devices is in the faulted state, and insufficient
405 replicas exist to continue functioning. The underlying conditions are as
407 .Bl -bullet -offset 2n
409 The device could be opened, but the contents did not match expected values.
413 errors exceeds acceptable levels and the device is faulted to
414 prevent further use of the device.
417 The device was explicitly taken offline by the
421 The device is online and functioning.
423 The device was physically removed while the system was running. Device removal
424 detection is hardware-dependent and may not be supported on all platforms.
426 The device could not be opened. If a pool is imported when a device was
427 unavailable, then the device will be identified by a unique identifier instead
428 of its path since the path was never correct in the first place.
431 If a device is removed and later reattached to the system,
433 attempts to put the device online automatically. Device attach detection is
434 hardware-dependent and might not be supported on all platforms.
437 allows devices to be associated with pools as
439 These devices are not actively used in the pool, but when an active device
440 fails, it is automatically replaced by a hot spare. To create a pool with hot
444 with any number of devices. For example,
445 .Bd -literal -offset 2n
446 .Li # Ic zpool create pool mirror da0 da1 spare da2 da3
449 Spares can be shared across multiple pools, and can be added with the
451 command and removed with the
453 command. Once a spare replacement is initiated, a new "spare"
456 within the configuration that will remain there until the original device is
457 replaced. At this point, the hot spare becomes available again if another
460 If a pool has a shared spare that is currently being used, the pool can not be
461 exported since other pools may use this shared spare, which may lead to
462 potential data corruption.
464 An in-progress spare replacement can be cancelled by detaching the hot spare.
465 If the original faulted device is detached, then the hot spare assumes its
466 place in the configuration, and is removed from the spare list of all active
469 Spares cannot replace log devices.
477 requirements for synchronous transactions. For instance, databases often
478 require their transactions to be on stable storage devices when returning from
481 and other applications can also use
483 to ensure data stability. By default, the intent log is allocated from blocks
484 within the main pool. However, it might be possible to get better performance
485 using separate intent log devices such as
487 or a dedicated disk. For example:
488 .Bd -literal -offset 2n
489 .Li # Ic zpool create pool da0 da1 log da2
492 Multiple log devices can also be specified, and they can be mirrored. See the
494 section for an example of mirroring multiple log devices.
496 Log devices can be added, replaced, attached, detached, imported and exported
497 as part of the larger pool. Mirrored log devices can be removed by specifying
498 the top-level mirror for the log.
500 Devices can be added to a storage pool as "cache devices." These devices
501 provide an additional layer of caching between main memory and disk. For
502 read-heavy workloads, where the working set size is much larger than what can
503 be cached in main memory, using cache devices allow much more of this working
504 set to be served from low latency media. Using cache devices provides the
505 greatest performance improvement for random read-workloads of mostly static
508 To create a pool with cache devices, specify a "cache"
510 with any number of devices. For example:
511 .Bd -literal -offset 2n
512 .Li # Ic zpool create pool da0 da1 cache da2 da3
515 Cache devices cannot be mirrored or part of a
517 configuration. If a read
518 error is encountered on a cache device, that read
520 is reissued to the original storage pool device, which might be part of a
525 The content of the cache devices is considered volatile, as is the case with
528 Each pool has several properties associated with it. Some properties are
529 read-only statistics while others are configurable and change the behavior of
530 the pool. The following are read-only properties:
531 .Bl -tag -width "dedupratio"
533 Amount of storage space within the pool that has been physically allocated.
535 Percentage of pool space used. This property can also be referred to by its
536 shortened column name, "cap".
538 A text string consisting of printable ASCII characters that will be stored
539 such that it is available even if the pool becomes faulted. An administrator
540 can provide additional information about a pool using this property.
542 The deduplication ratio specified for a pool, expressed as a multiplier.
545 value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See
547 for a description of the deduplication feature.
549 Amount of uninitialized space within the pool or device that can be used to
550 increase the total capacity of the pool.
551 Uninitialized space consists of
552 any space on an EFI labeled vdev which has not been brought online
553 .Pq i.e. zpool online -e .
554 This space occurs when a LUN is dynamically expanded.
556 The amount of fragmentation in the pool.
558 Number of blocks within the pool that are not allocated.
560 After a file system or snapshot is destroyed, the space it was using is
561 returned to the pool asynchronously.
563 is the amount of space remaining to be reclaimed.
570 A unique identifier for the pool.
572 The current health of the pool. Health can be
581 Total size of the storage pool.
582 .It Sy unsupported@ Ns Ar feature_guid
583 Information about unsupported features that are enabled on the pool.
588 Amount of storage space used within the pool.
591 The space usage properties report actual physical space available to the
592 storage pool. The physical space can be different from the total amount of
593 space that any contained datasets can actually use. The amount of space used in
596 configuration depends on the characteristics of the data being written.
599 reserves some space for internal accounting that the
601 command takes into account, but the
603 command does not. For non-full pools of a reasonable size, these effects should
604 be invisible. For small pools, or pools that are close to being completely
605 full, these discrepancies may become more noticeable.
607 The following property can be set at creation time and import time:
610 Alternate root directory. If set, this directory is prepended to any mount
611 points within the pool. This can be used when examining an unknown pool where
612 the mount points cannot be trusted, or in an alternate boot environment, where
613 the typical paths are not valid.
615 is not a persistent property. It is valid only while the system is up.
620 though this may be overridden using an explicit setting.
623 The following property can only be set at import time:
625 .It Sy readonly Ns = Ns Cm on No | Cm off
628 pool will be imported in read-only mode with the following restrictions:
629 .Bl -bullet -offset 2n
631 Synchronous data in the intent log will not be accessible
633 Properties of the pool can not be changed
635 Datasets of this pool can only be mounted read-only
637 To write to a read-only pool, a export and import of the pool is required.
640 This property can also be referred to by its shortened column name,
644 The following properties can be set at creation time and import time, and later
649 .It Sy autoexpand Ns = Ns Cm on No | Cm off
650 Controls automatic pool expansion when the underlying LUN is grown. If set to
652 the pool will be resized according to the size of the expanded
653 device. If the device is part of a mirror or
655 then all devices within that
656 .No mirror/ Ns No raidz
657 group must be expanded before the new space is made available to
658 the pool. The default behavior is
660 This property can also be referred to by its shortened column name,
662 .It Sy autoreplace Ns = Ns Cm on No | Cm off
663 Controls automatic device replacement. If set to
665 device replacement must be initiated by the administrator by using the
669 any new device, found in the same
670 physical location as a device that previously belonged to the pool, is
671 automatically formatted and replaced. The default behavior is
673 This property can also be referred to by its shortened column name, "replace".
674 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
675 Identifies the default bootable dataset for the root pool. This property is
676 expected to be set mainly by the installation and upgrade programs.
677 .It Sy cachefile Ns = Ns Ar path No | Cm none
678 Controls the location of where the pool configuration is cached. Discovering
679 all pools on system startup requires a cached copy of the configuration data
680 that is stored on the root file system. All pools in this cache are
681 automatically imported when the system boots. Some environments, such as
682 install and clustering, need to cache this information in a different location
683 so that pools are not automatically imported. Setting this property caches the
684 pool configuration in a different location that can later be imported with
685 .Qq Nm Cm import Fl c .
686 Setting it to the special value
688 creates a temporary pool that is never cached, and the special value
690 (empty string) uses the default location.
691 .It Sy comment Ns = Ns Ar text
692 A text string consisting of printable ASCII characters that will be stored
693 such that it is available even if the pool becomes faulted.
694 An administrator can provide additional information about a pool using this
696 .It Sy dedupditto Ns = Ns Ar number
697 Threshold for the number of block ditto copies. If the reference count for a
698 deduplicated block increases above this number, a new ditto copy of this block
699 is automatically stored. Default setting is
701 which causes no ditto copies to be created for deduplicated blocks.
702 The miniumum legal nonzero setting is 100.
703 .It Sy delegation Ns = Ns Cm on No | Cm off
704 Controls whether a non-privileged user is granted access based on the dataset
705 permissions defined on the dataset. See
707 for more information on
709 delegated administration.
710 .It Sy failmode Ns = Ns Cm wait No | Cm continue No | Cm panic
711 Controls the system behavior in the event of catastrophic pool failure. This
712 condition is typically a result of a loss of connectivity to the underlying
713 storage device(s) or a failure of all devices within the pool. The behavior of
714 such an event is determined as follows:
715 .Bl -tag -width indent
719 access until the device connectivity is recovered and the errors are cleared.
720 This is the default behavior.
726 requests but allows reads to any of the remaining healthy devices. Any write
727 requests that have yet to be committed to disk would be blocked.
729 Prints out a message to the console and generates a system crash dump.
731 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
732 The value of this property is the current state of
734 The only valid value when setting this property is
738 to the enabled state.
741 for details on feature states.
742 .It Sy listsnaps Ns = Ns Cm on No | Cm off
743 Controls whether information about snapshots associated with this pool is
748 option. The default value is
750 .It Sy version Ns = Ns Ar version
751 The current on-disk version of the pool. This can be increased, but never
752 decreased. The preferred method of updating pools is with the
754 command, though this property can be used when a specific version is needed
755 for backwards compatibility.
756 Once feature flags is enabled on a pool this property will no longer have a
760 All subcommands that modify state are logged persistently to the pool in their
765 command provides subcommands to create and destroy storage pools, add capacity
766 to storage pools, and provide information about the storage pools. The following
767 subcommands are supported:
774 Displays a help message.
782 Adds the specified virtual devices to the given pool. The
784 specification is described in the
785 .Qq Sx Virtual Devices
786 section. The behavior of the
788 option, and the device checks performed are described in the
791 .Bl -tag -width indent
795 even if they appear in use or specify a conflicting replication level.
796 Not all devices can be overridden in this manner.
798 Displays the configuration that would be used without actually adding the
800 The actual pool creation can still fail due to insufficient privileges or device
803 Do not add a disk that is currently configured as a quorum device to a zpool.
804 After a disk is in the pool, that disk can then be configured as a quorum
811 .Ar pool device new_device
818 device. The existing device cannot be part of a
822 is not currently part of a mirrored configuration,
824 automatically transforms into a two-way mirror of
825 .Ar device No and Ar new_device .
828 is part of a two-way mirror, attaching
830 creates a three-way mirror, and so on. In either case,
832 begins to resilver immediately.
833 .Bl -tag -width indent
837 even if its appears to be in use. Not all devices can be overridden in this
848 Clears device errors in a pool. If no arguments are specified, all device
849 errors within the pool are cleared. If one or more devices is specified, only
850 those errors associated with the specified device or devices are cleared.
851 .Bl -tag -width indent
853 Initiates recovery mode for an unopenable pool. Attempts to discard the last
854 few transactions in the pool to return it to an openable state. Not all damaged
855 pools can be recovered by using this option. If successful, the data from the
856 discarded transactions is irretrievably lost.
858 Used in combination with the
860 flag. Check whether discarding transactions would make the pool openable, but
861 do not actually discard any transactions.
867 .Op Fl o Ar property Ns = Ns Ar value
869 .Op Fl O Ar file-system-property Ns = Ns Ar value
871 .Op Fl m Ar mountpoint
877 Creates a new storage pool containing the virtual devices specified on the
878 command line. The pool name must begin with a letter, and can only contain
879 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
880 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
881 names beginning with the pattern "c[0-9]". The
883 specification is described in the
884 .Qq Sx Virtual Devices
887 The command verifies that each device specified is accessible and not currently
888 in use by another subsystem. There are some uses, such as being currently
889 mounted, or specified as the dedicated dump device, that prevents a device from
892 Other uses, such as having a preexisting
894 file system, can be overridden with the
898 The command also checks that the replication strategy for the pool is
899 consistent. An attempt to combine redundant and non-redundant storage in a
900 single pool, or to mix disks and files, results in an error unless
902 is specified. The use of differently sized devices within a single
904 or mirror group is also flagged as an error unless
910 option is specified, the default mount point is
912 The mount point must not exist or must be empty, or else the
913 root dataset cannot be mounted. This can be overridden with the
917 By default all supported features are enabled on the new pool unless the
920 .Bl -tag -width indent
924 even if they appear in use or specify a conflicting replication level.
925 Not all devices can be overridden in this manner.
927 Displays the configuration that would be used without actually creating the
928 pool. The actual pool creation can still fail due to insufficient privileges or
931 Do not enable any features on the new pool.
932 Individual features can be enabled by setting their corresponding properties
940 for details about feature properties.
942 .Fl o Ar property Ns = Ns Ar value
943 .Op Fl o Ar property Ns = Ns Ar value
946 Sets the given pool properties. See the
948 section for a list of valid properties that can be set.
951 .Ar file-system-property Ns = Ns Ar value
952 .Op Fl O Ar file-system-property Ns = Ns Ar value
955 Sets the given file system properties in the root file system of the pool. See
957 for a list of valid properties that
961 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
962 .It Fl m Ar mountpoint
963 Sets the mount point for the root dataset. The default mount point is
966 .Qq Cm altroot Ns Pa /pool
969 is specified. The mount point must be an absolute path,
973 For more information on dataset mount points, see
976 Sets the in-core pool name to
978 while the on-disk name will be the name specified as the pool name
980 This will set the default
984 This is intended to handle name space collisions when creating pools
985 for other systems, such as virtual machines or physical machines
986 whose pools live on network block devices.
995 Destroys the given pool, freeing up any devices for other use. This command
996 tries to unmount any active datasets before destroying the pool.
997 .Bl -tag -width indent
999 Forces any active datasets contained within the pool to be unmounted.
1009 from a mirror. The operation is refused if there are no other valid replicas
1018 Exports the given pools from the system. All devices are marked as exported,
1019 but are still considered in use by other subsystems. The devices can be moved
1020 between systems (even those of different endianness) and imported as long as a
1021 sufficient number of devices are present.
1023 Before exporting the pool, all datasets within the pool are unmounted. A pool
1024 can not be exported if it has a shared spare that is currently being used.
1026 For pools to be portable, you must give the
1028 command whole disks, not just slices, so that
1030 can label the disks with portable
1032 labels. Otherwise, disk drivers on platforms of different endianness will not
1033 recognize the disks.
1034 .Bl -tag -width indent
1036 Forcefully unmount all datasets, using the
1040 This command will forcefully export the pool even if it has a shared spare that
1041 is currently being used. This may lead to potential data corruption.
1047 .Op Fl o Ar field Ns Op , Ns Ar ...
1048 .Ar all | property Ns Op , Ns Ar ...
1052 Retrieves the given list of properties (or all properties if
1054 is used) for the specified storage pool(s). These properties are displayed with
1055 the following fields:
1056 .Bl -column -offset indent "property"
1057 .It name Ta Name of storage pool
1058 .It property Ta Property name
1059 .It value Ta Property value
1060 .It source Ta Property source, either 'default' or 'local'.
1065 section for more information on the available pool properties.
1067 Scripted mode. Do not display headers, and separate fields by a single tab
1068 instead of arbitrary space.
1070 Display numbers in parsable (exact) values.
1072 A comma-separated list of columns to display.
1074 .Sy property Ns , Ns
1077 is the default value.
1086 Displays the command history of the specified pools or all pools if no pool is
1088 .Bl -tag -width indent
1090 Displays internally logged
1092 events in addition to user initiated events.
1094 Displays log records in long format, which in addition to standard format
1095 includes, the user name, the hostname, and the zone in which the operation was
1101 .Op Fl d Ar dir | Fl c Ar cachefile
1105 Lists pools available to import. If the
1107 option is not specified, this command searches for devices in
1111 option can be specified multiple times, and all directories are searched. If
1112 the device appears to be part of an exported pool, this command displays a
1113 summary of the pool with the name of the pool, a numeric identifier, as well as
1116 layout and current health of the device for each device or file.
1117 Destroyed pools, pools that were previously destroyed with the
1119 command, are not listed unless the
1121 option is specified.
1123 The numeric identifier is unique, and can be used instead of the pool name when
1124 multiple exported pools of the same name are available.
1125 .Bl -tag -width indent
1126 .It Fl c Ar cachefile
1127 Reads configuration from the given
1129 that was created with the
1133 is used instead of searching for devices.
1135 Searches for devices or files in
1139 option can be specified multiple times.
1141 Lists destroyed pools only.
1147 .Op Fl o Ar property Ns = Ns Ar value
1149 .Op Fl d Ar dir | Fl c Ar cachefile
1159 Imports all pools found in the search directories. Identical to the previous
1160 command, except that all pools with a sufficient number of devices available
1161 are imported. Destroyed pools, pools that were previously destroyed with the
1163 command, will not be imported unless the
1165 option is specified.
1166 .Bl -tag -width indent
1168 Comma-separated list of mount options to use when mounting datasets within the
1171 for a description of dataset properties and mount options.
1172 .It Fl o Ar property Ns = Ns Ar value
1173 Sets the specified property on the imported pool. See the
1175 section for more information on the available pool properties.
1176 .It Fl c Ar cachefile
1177 Reads configuration from the given
1179 that was created with the
1183 is used instead of searching for devices.
1185 Searches for devices or files in
1189 option can be specified multiple times. This option is incompatible with the
1193 Imports destroyed pools only. The
1195 option is also required.
1197 Forces import, even if the pool appears to be potentially active.
1199 Allows a pool to import when there is a missing log device. Recent transactions
1200 can be lost because the log device will be discarded.
1202 Import the pool without mounting any file systems.
1213 Recovery mode for a non-importable pool. Attempt to return the pool to an
1214 importable state by discarding the last few transactions. Not all damaged pools
1215 can be recovered by using this option. If successful, the data from the
1216 discarded transactions is irretrievably lost. This option is ignored if the
1217 pool is importable or already imported.
1221 recovery option. Determines whether a non-importable pool can be made
1222 importable again, but does not actually perform the pool recovery. For more
1223 details about pool recovery mode, see the
1227 Searches for and imports all pools found.
1233 .Op Fl o Ar property Ns = Ns Ar value
1235 .Op Fl d Ar dir | Fl c Ar cachefile
1247 Imports a specific pool. A pool can be identified by its name or the numeric
1250 is specified, the pool is imported using the name
1252 Otherwise, it is imported with the same name as its exported name.
1254 If a device is removed from a system without running
1256 first, the device appears as potentially active. It cannot be determined if
1257 this was a failed export, or whether the device is really in use from another
1258 host. To import a pool in this state, the
1261 .Bl -tag -width indent
1263 Comma-separated list of mount options to use when mounting datasets within the
1266 for a description of dataset properties and mount options.
1267 .It Fl o Ar property Ns = Ns Ar value
1268 Sets the specified property on the imported pool. See the
1270 section for more information on the available pool properties.
1271 .It Fl c Ar cachefile
1272 Reads configuration from the given
1274 that was created with the
1278 is used instead of searching for devices.
1280 Searches for devices or files in
1284 option can be specified multiple times. This option is incompatible with the
1288 Imports destroyed pools only. The
1290 option is also required.
1292 Forces import, even if the pool appears to be potentially active.
1294 Allows a pool to import when there is a missing log device. Recent transactions
1295 can be lost because the log device will be discarded.
1297 Import the pool without mounting any file systems.
1300 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1307 Temporary pool names last until export.
1308 Ensures that the original pool name will be used in all label updates and
1309 therefore is retained upon export.
1314 when not explicitly specified.
1316 Recovery mode for a non-importable pool. Attempt to return the pool to an
1317 importable state by discarding the last few transactions. Not all damaged pools
1318 can be recovered by using this option. If successful, the data from the
1319 discarded transactions is irretrievably lost. This option is ignored if the
1320 pool is importable or already imported.
1324 recovery option. Determines whether a non-importable pool can be made
1325 importable again, but does not actually perform the pool recovery. For more
1326 details about pool recovery mode, see the
1333 .Op Fl T Cm d Ns | Ns Cm u
1337 .Op Ar interval Op Ar count
1342 statistics for the given pools. When given an interval, the statistics are
1349 are specified, statistics for every pool in the system is shown. If
1351 is specified, the command exits after
1353 reports are printed.
1354 .Bl -tag -width indent
1355 .It Fl T Cm d Ns | Ns Cm u
1360 for standard date format. See
1365 .Pq equals Qq Ic date +%s .
1367 Verbose statistics. Reports usage statistics for individual
1369 within the pool, in addition to the pool-wide statistics.
1380 label information from the specified
1384 must not be part of an active pool configuration.
1385 .Bl -tag -width indent
1387 Treat exported or foreign devices as inactive.
1393 .Op Fl o Ar property Ns Op , Ns Ar ...
1394 .Op Fl T Cm d Ns | Ns Cm u
1397 .Op Ar inverval Op Ar count
1400 Lists the given pools along with a health status and space usage. If no
1402 are specified, all pools in the system are listed.
1404 When given an interval, the output is printed every
1410 is specified, the command exits after
1412 reports are printed.
1413 .Bl -tag -width indent
1414 .It Fl T Cm d Ns | Ns Cm u
1419 for standard date format. See
1424 .Pq equals Qq Ic date +%s .
1426 Scripted mode. Do not display headers, and separate fields by a single tab
1427 instead of arbitrary space.
1429 Display numbers in parsable (exact) values.
1431 Verbose statistics. Reports usage statistics for individual
1434 the pool, in addition to the pool-wide statistics.
1435 .It Fl o Ar property Ns Op , Ns Ar ...
1436 Comma-separated list of properties to display. See the
1438 section for a list of valid properties. The default list is
1448 .It Fl T Cm d Ns | Ns Cm u
1453 for standard date format. See
1458 .Pq equals Qq Ic date +%s .
1467 Takes the specified physical device offline. While the
1469 is offline, no attempt is made to read or write to the device.
1470 .Bl -tag -width indent
1472 Temporary. Upon reboot, the specified physical device reverts to its previous
1482 Brings the specified physical device online.
1484 This command is not applicable to spares or cache devices.
1485 .Bl -tag -width indent
1487 Expand the device to use all available space. If the device is part of a mirror
1490 then all devices must be expanded before the new space will become
1491 available to the pool.
1499 Generates a new unique identifier for the pool. You must ensure that all
1500 devices in this pool are online and healthy before performing this action.
1507 Removes the specified device from the pool. This command currently only
1508 supports removing hot spares, cache, and log devices. A mirrored log device can
1509 be removed by specifying the top-level mirror for the log. Non-log devices that
1510 are part of a mirrored configuration can be removed using the
1512 command. Non-redundant and
1514 devices cannot be removed from a pool.
1521 Reopen all the vdevs associated with the pool.
1534 This is equivalent to attaching
1536 waiting for it to resilver, and then detaching
1541 must be greater than or equal to the minimum size
1542 of all the devices in a mirror or
1547 is required if the pool is not redundant. If
1549 is not specified, it defaults to
1551 This form of replacement is useful after an existing disk has failed and has
1552 been physically replaced. In this case, the new disk may have the same
1554 path as the old device, even though it is actually a different disk.
1557 .Bl -tag -width indent
1561 even if its appears to be in use. Not all devices can be overridden in this
1571 Begins a scrub. The scrub examines all data in the specified pools to verify
1572 that it checksums correctly. For replicated (mirror or
1576 automatically repairs any damage discovered during the scrub. The
1578 command reports the progress of the scrub and summarizes the results of the
1579 scrub upon completion.
1581 Scrubbing and resilvering are very similar operations. The difference is that
1582 resilvering only examines data that
1584 knows to be out of date (for example, when attaching a new device to a mirror
1585 or replacing an existing device), whereas scrubbing examines all data to
1586 discover silent errors due to hardware faults or disk failure.
1588 Because scrubbing and resilvering are
1589 .Tn I/O Ns -intensive
1592 only allows one at a time. If a scrub is already in progress, the
1594 command returns an error. To start a new scrub, you have to stop the old scrub
1596 .Qq Nm Cm scrub Fl s
1597 command first. If a resilver is in progress,
1599 does not allow a scrub to be started until the resilver completes.
1600 .Bl -tag -width indent
1607 .Ar property Ns = Ns Ar value pool
1610 Sets the given property on the specified pool. See the
1612 section for more information on what properties can be set and acceptable
1620 .Op Fl o Ar property Ns = Ns Ar value
1625 Splits off one disk from each mirrored top-level
1627 in a pool and creates a new pool from the split-off disks. The original pool
1628 must be made up of one or more mirrors and must not be in the process of
1631 subcommand chooses the last device in each mirror
1633 unless overridden by a device specification on the command line.
1639 includes the specified device(s) in a new pool and, should any devices remain
1640 unspecified, assigns the last device in each mirror
1642 to that pool, as it does normally. If you are uncertain about the outcome of a
1646 ("dry-run") option to ensure your command will have the effect you intend.
1647 .Bl -tag -width indent
1649 Automatically import the newly created pool after splitting, using the
1652 parameter for the new pool's alternate root. See the
1658 Displays the configuration that would be created without actually splitting the
1659 pool. The actual pool split could still fail due to insufficient privileges or
1662 Comma-separated list of mount options to use when mounting datasets within the
1665 for a description of dataset properties and mount options. Valid only in
1666 conjunction with the
1669 .It Fl o Ar property Ns = Ns Ar value
1670 Sets the specified property on the new pool. See the
1672 section, above, for more information on the available pool properties.
1678 .Op Fl T Cm d Ns | Ns Cm u
1681 .Op Ar interval Op Ar count
1684 Displays the detailed health status for the given pools. If no
1686 is specified, then the status of each pool in the system is displayed. For more
1687 information on pool and device health, see the
1688 .Qq Sx Device Failure and Recovery
1691 When given an interval, the output is printed every
1697 is specified, the command exits after
1699 reports are printed.
1701 If a scrub or resilver is in progress, this command reports the percentage
1702 done and the estimated time to completion. Both of these are only approximate,
1703 because the amount of data in the pool and the other workloads on the system
1705 .Bl -tag -width indent
1707 Only display status for pools that are exhibiting errors or are otherwise
1709 Warnings about pools not using the latest on-disk format, having non-native
1710 block size or disabled features will not be included.
1712 Displays verbose data error information, printing out a complete list of all
1713 data errors since the last complete pool scrub.
1714 .It Fl T Cm d Ns | Ns Cm u
1719 for standard date format. See
1724 .Pq equals Qq Ic date +%s .
1732 Displays pools which do not have all supported features enabled and pools
1733 formatted using a legacy
1736 These pools can continue to be used, but some features may not be available.
1739 to enable all features on all pools.
1740 .Bl -tag -width indent
1744 versions supported by the current software.
1746 .Xr zpool-features 7
1747 for a description of feature flags features supported by the current software.
1756 Enables all supported features on the given pool.
1757 Once this is done, the pool will no longer be accessible on systems that do
1758 not support feature flags.
1760 .Xr zpool-features 7
1761 for details on compatibility with systems that support feature flags, but do
1762 not support all features enabled on the pool.
1763 .Bl -tag -width indent
1765 Enables all supported features on all pools.
1767 Upgrade to the specified legacy version. If the
1769 flag is specified, no features will be enabled on the pool.
1770 This option can only be used to increase version number up to the last
1771 supported legacy version number.
1775 The following exit values are returned:
1776 .Bl -tag -offset 2n -width 2n
1778 Successful completion.
1782 Invalid command line options were specified.
1786 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1788 The following command creates a pool with a single
1792 that consists of six disks.
1793 .Bd -literal -offset 2n
1794 .Li # Ic zpool create tank raidz da0 da1 da2 da3 da4 da5
1796 .It Sy Example 2 No Creating a Mirrored Storage Pool
1798 The following command creates a pool with two mirrors, where each mirror
1800 .Bd -literal -offset 2n
1801 .Li # Ic zpool create tank mirror da0 da1 mirror da2 da3
1803 .It Sy Example 3 No Creating a Tn ZFS No Storage Pool by Using Partitions
1805 The following command creates an unmirrored pool using two GPT partitions.
1806 .Bd -literal -offset 2n
1807 .Li # Ic zpool create tank da0p3 da1p3
1809 .It Sy Example 4 No Creating a Tn ZFS No Storage Pool by Using Files
1811 The following command creates an unmirrored pool using files. While not
1812 recommended, a pool based on files can be useful for experimental purposes.
1813 .Bd -literal -offset 2n
1814 .Li # Ic zpool create tank /path/to/file/a /path/to/file/b
1816 .It Sy Example 5 No Adding a Mirror to a Tn ZFS No Storage Pool
1818 The following command adds two mirrored disks to the pool
1820 assuming the pool is already made up of two-way mirrors. The additional space
1821 is immediately available to any datasets within the pool.
1822 .Bd -literal -offset 2n
1823 .Li # Ic zpool add tank mirror da2 da3
1825 .It Sy Example 6 No Listing Available Tn ZFS No Storage Pools
1827 The following command lists all available pools on the system.
1828 .Bd -literal -offset 2n
1830 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1831 pool 2.70T 473G 2.24T 33% - 17% 1.00x ONLINE -
1832 test 1.98G 89.5K 1.98G 48% - 0% 1.00x ONLINE -
1834 .It Sy Example 7 No Listing All Properties for a Pool
1836 The following command lists all the properties for a pool.
1837 .Bd -literal -offset 2n
1838 .Li # Ic zpool get all pool
1841 pool altroot - default
1842 pool health ONLINE -
1843 pool guid 2501120270416322443 default
1844 pool version 28 default
1845 pool bootfs pool/root local
1846 pool delegation on default
1847 pool autoreplace off default
1848 pool cachefile - default
1849 pool failmode wait default
1850 pool listsnapshots off default
1851 pool autoexpand off default
1852 pool dedupditto 0 default
1853 pool dedupratio 1.00x -
1855 pool allocated 473G -
1858 .It Sy Example 8 No Destroying a Tn ZFS No Storage Pool
1860 The following command destroys the pool
1862 and any datasets contained within.
1863 .Bd -literal -offset 2n
1864 .Li # Ic zpool destroy -f tank
1866 .It Sy Example 9 No Exporting a Tn ZFS No Storage Pool
1868 The following command exports the devices in pool
1870 so that they can be relocated or later imported.
1871 .Bd -literal -offset 2n
1872 .Li # Ic zpool export tank
1874 .It Sy Example 10 No Importing a Tn ZFS No Storage Pool
1876 The following command displays available pools, and then imports the pool
1878 for use on the system.
1880 The results from this command are similar to the following:
1881 .Bd -literal -offset 2n
1882 .Li # Ic zpool import
1885 id: 15451357997522795478
1887 action: The pool can be imported using its name or numeric identifier.
1899 Storage Pools to the Current Version
1902 The following command upgrades all
1904 Storage pools to the current version of
1906 .Bd -literal -offset 2n
1907 .Li # Ic zpool upgrade -a
1908 This system is currently running ZFS pool version 28.
1910 .It Sy Example 12 No Managing Hot Spares
1912 The following command creates a new pool with an available hot spare:
1913 .Bd -literal -offset 2n
1914 .Li # Ic zpool create tank mirror da0 da1 spare da2
1917 If one of the disks were to fail, the pool would be reduced to the degraded
1918 state. The failed device can be replaced using the following command:
1919 .Bd -literal -offset 2n
1920 .Li # Ic zpool replace tank da0 da2
1923 Once the data has been resilvered, the spare is automatically removed and is
1924 made available should another device fails. The hot spare can be permanently
1925 removed from the pool using the following command:
1926 .Bd -literal -offset 2n
1927 .Li # Ic zpool remove tank da2
1933 Pool with Mirrored Separate Intent Logs
1936 The following command creates a
1938 storage pool consisting of two, two-way
1939 mirrors and mirrored log devices:
1940 .Bd -literal -offset 2n
1941 .Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5
1943 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
1945 The following command adds two disks for use as cache devices to a
1948 .Bd -literal -offset 2n
1949 .Li # Ic zpool add pool cache da2 da3
1952 Once added, the cache devices gradually fill with content from main memory.
1953 Depending on the size of your cache devices, it could take over an hour for
1954 them to fill. Capacity and reads can be monitored using the
1956 subcommand as follows:
1957 .Bd -literal -offset 2n
1958 .Li # Ic zpool iostat -v pool 5
1962 Displaying expanded space on a device
1965 The following command dipslays the detailed information for the
1968 This pool is comprised of a single
1970 vdev where one of its
1971 devices increased its capacity by 10GB.
1972 In this example, the pool will not
1973 be able to utilized this extra capacity until all the devices under the
1975 vdev have been expanded.
1976 .Bd -literal -offset 2n
1977 .Li # Ic zpool list -v data
1978 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1979 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
1980 raidz1 23.9G 14.6G 9.30G 48% -
1987 Removing a Mirrored Log Device
1990 The following command removes the mirrored log device
1993 Given this configuration:
1994 .Bd -literal -offset 2n
1997 scrub: none requested
2000 NAME STATE READ WRITE CKSUM
2002 mirror-0 ONLINE 0 0 0
2005 mirror-1 ONLINE 0 0 0
2009 mirror-2 ONLINE 0 0 0
2014 The command to remove the mirrored log
2017 .Bd -literal -offset 2n
2018 .Li # Ic zpool remove tank mirror-2
2022 Recovering a Faulted
2027 If a pool is faulted but recoverable, a message indicating this state is
2030 if the pool was cached (see the
2032 argument above), or as part of the error output from a failed
2036 Recover a cached pool with the
2039 .Bd -literal -offset 2n
2040 .Li # Ic zpool clear -F data
2041 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
2042 Discarded approximately 29 seconds of transactions.
2045 If the pool configuration was not cached, use
2047 with the recovery mode flag:
2048 .Bd -literal -offset 2n
2049 .Li # Ic zpool import -F data
2050 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
2051 Discarded approximately 29 seconds of transactions.
2055 .Xr zpool-features 7 ,
2058 This manual page is a
2060 reimplementation of the
2064 modified and customized for
2066 and licensed under the Common Development and Distribution License
2071 implementation of this manual page was initially written by
2072 .An Martin Matuska Aq mm@FreeBSD.org .
2076 feature requires a utility to detect zpool degradation and initiate
2077 disk replacement within the zpool. FreeBSD does not provide such a
2078 utility at this time.