2 .\" Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>.
3 .\" All Rights Reserved.
5 .\" The contents of this file are subject to the terms of the
6 .\" Common Development and Distribution License (the "License").
7 .\" You may not use this file except in compliance with the License.
9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 .\" or http://www.opensolaris.org/os/licensing.
11 .\" See the License for the specific language governing permissions
12 .\" and limitations under the License.
14 .\" When distributing Covered Code, include this CDDL HEADER in each
15 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 .\" If applicable, add the following below this CDDL HEADER, with the
17 .\" fields enclosed by brackets "[]" replaced with your own identifying
18 .\" information: Portions Copyright [yyyy] [name of copyright owner]
20 .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved.
21 .\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved.
22 .\" Copyright (c) 2011, Justin T. Gibbs <gibbs@FreeBSD.org>
23 .\" Copyright (c) 2012 by Delphix. All Rights Reserved.
24 .\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
33 .Nd configures ZFS storage pools
44 .Ar pool device new_device
53 .Op Fl o Ar property Ns = Ns Ar value
55 .Op Fl O Ar file-system-property Ns = Ns Ar value
57 .Op Fl m Ar mountpoint
73 .Ar all | property Ns Op , Ns Ar ...
82 .Op Fl d Ar dir | Fl c Ar cachefile
87 .Op Fl o Ar property Ns = Ns Ar value
89 .Op Fl d Ar dir | Fl c Ar cachefile
100 .Op Fl o Ar property Ns = Ns Ar value
102 .Op Fl d Ar dir | Fl c Ar cachefile
113 .Op Fl T Cm d Ns | Ns Cm u
124 .Op Fl o Ar property Ns Op , Ns Ar ...
125 .Op Fl T Cm d Ns | Ns Cm u
128 .Op Ar inverval Op Ar count
154 .Ar property Ns = Ns Ar value pool
160 .Op Fl o Ar property Ns = Ns Ar value
166 .Op Fl T Cm d Ns | Ns Cm u
169 .Op Ar interval Op Ar count
182 storage pools. A storage pool is a collection of devices that provides physical
183 storage and data replication for
187 All datasets within a storage pool share the same space. See
189 for information on managing datasets.
190 .Ss Virtual Devices (vdevs)
194 describes a single device or a collection of devices organized according to
195 certain performance and fault characteristics. The following virtual devices
197 .Bl -tag -width "XXXXXX"
199 A block device, typically located under
202 can use individual slices or partitions, though the recommended mode of
203 operation is to use whole disks. A disk can be specified by a full path to the
206 provider name. When given a whole disk,
208 automatically labels the disk, if necessary.
210 A regular file. The use of files as a backing store is strongly discouraged. It
211 is designed primarily for experimental purposes, as the fault tolerance of a
212 file is only as good the file system of which it is a part. A file must be
213 specified by a full path.
215 A mirror of two or more devices. Data is replicated in an identical fashion
216 across all components of a mirror. A mirror with
222 bytes and can withstand
224 devices failing before data integrity is compromised.
227 .Sy raidz1 raidz2 raidz3 ) .
230 that allows for better distribution of parity and eliminates the
232 write hole (in which data and parity become inconsistent after a power loss).
233 Data and parity is striped across all disks within a
239 group can have single-, double- , or triple parity, meaning that the
241 group can sustain one, two, or three failures, respectively, without
244 type specifies a single-parity
248 type specifies a double-parity
252 type specifies a triple-parity
267 parity disks can hold approximately
272 bytes and can withstand
274 device(s) failing before data integrity is compromised. The minimum number of
277 group is one more than the number of parity disks. The
278 recommended number is between 3 and 9 to help increase performance.
281 .No pseudo- Ns No vdev
282 which keeps track of available hot spares for a pool.
283 For more information, see the
287 A separate-intent log device. If more than one log device is specified, then
288 writes are load-balanced between devices. Log devices can be mirrored. However,
291 types are not supported for the intent log. For more information,
296 A device used to cache storage pool data. A cache device cannot be configured
299 group. For more information, see the
304 Virtual devices cannot be nested, so a mirror or
306 virtual device can only
307 contain files or disks. Mirrors of mirrors (or other combinations) are not
310 A pool can have any number of virtual devices at the top of the configuration
314 Data is dynamically distributed across all top-level devices to balance data
315 among devices. As new virtual devices are added,
317 automatically places data on the newly available devices.
319 Virtual devices are specified one at a time on the command line, separated by
320 whitespace. The keywords
324 are used to distinguish where a group ends and another begins. For example, the
325 following creates two root
327 each a mirror of two disks:
328 .Bd -literal -offset 2n
329 .Li # Ic zpool create mypool mirror da0 da1 mirror da2 da3
331 .Ss Device Failure and Recovery
333 supports a rich set of mechanisms for handling device failure and data
334 corruption. All metadata and data is checksummed, and
336 automatically repairs bad data from a good copy when corruption is detected.
338 In order to take advantage of these features, a pool must make use of some form
339 of redundancy, using either mirrored or
343 supports running in a non-redundant configuration, where each root
345 is simply a disk or file, this is strongly discouraged. A single case of bit
346 corruption can render some or all of your data unavailable.
348 A pool's health status is described by one of three states: online, degraded,
349 or faulted. An online pool has all devices operating normally. A degraded pool
350 is one in which one or more devices have failed, but the data is still
351 available due to a redundant configuration. A faulted pool has corrupted
352 metadata, or one or more faulted devices, and insufficient replicas to continue
355 The health of the top-level
360 potentially impacted by the state of its associated
362 or component devices. A top-level
364 or component device is in one of the following states:
365 .Bl -tag -width "DEGRADED"
367 One or more top-level
369 is in the degraded state because one or more
370 component devices are offline. Sufficient replicas exist to continue
373 One or more component devices is in the degraded or faulted state, but
374 sufficient replicas exist to continue functioning. The underlying conditions
376 .Bl -bullet -offset 2n
378 The number of checksum errors exceeds acceptable levels and the device is
379 degraded as an indication that something may be wrong.
381 continues to use the device as necessary.
385 errors exceeds acceptable levels. The device could not be
386 marked as faulted because there are insufficient replicas to continue
390 One or more top-level
392 is in the faulted state because one or more
393 component devices are offline. Insufficient replicas exist to continue
396 One or more component devices is in the faulted state, and insufficient
397 replicas exist to continue functioning. The underlying conditions are as
399 .Bl -bullet -offset 2n
401 The device could be opened, but the contents did not match expected values.
405 errors exceeds acceptable levels and the device is faulted to
406 prevent further use of the device.
409 The device was explicitly taken offline by the
413 The device is online and functioning.
415 The device was physically removed while the system was running. Device removal
416 detection is hardware-dependent and may not be supported on all platforms.
418 The device could not be opened. If a pool is imported when a device was
419 unavailable, then the device will be identified by a unique identifier instead
420 of its path since the path was never correct in the first place.
423 If a device is removed and later reattached to the system,
425 attempts to put the device online automatically. Device attach detection is
426 hardware-dependent and might not be supported on all platforms.
429 allows devices to be associated with pools as
431 These devices are not actively used in the pool, but when an active device
432 fails, it is automatically replaced by a hot spare. To create a pool with hot
436 with any number of devices. For example,
437 .Bd -literal -offset 2n
438 .Li # Ic zpool create pool mirror da0 da1 spare da2 da3
441 Spares can be shared across multiple pools, and can be added with the
443 command and removed with the
445 command. Once a spare replacement is initiated, a new "spare"
448 within the configuration that will remain there until the original device is
449 replaced. At this point, the hot spare becomes available again if another
452 If a pool has a shared spare that is currently being used, the pool can not be
453 exported since other pools may use this shared spare, which may lead to
454 potential data corruption.
456 An in-progress spare replacement can be cancelled by detaching the hot spare.
457 If the original faulted device is detached, then the hot spare assumes its
458 place in the configuration, and is removed from the spare list of all active
461 Spares cannot replace log devices.
469 requirements for synchronous transactions. For instance, databases often
470 require their transactions to be on stable storage devices when returning from
473 and other applications can also use
475 to ensure data stability. By default, the intent log is allocated from blocks
476 within the main pool. However, it might be possible to get better performance
477 using separate intent log devices such as
479 or a dedicated disk. For example:
480 .Bd -literal -offset 2n
481 .Li # Ic zpool create pool da0 da1 log da2
484 Multiple log devices can also be specified, and they can be mirrored. See the
486 section for an example of mirroring multiple log devices.
488 Log devices can be added, replaced, attached, detached, imported and exported
489 as part of the larger pool. Mirrored log devices can be removed by specifying
490 the top-level mirror for the log.
492 Devices can be added to a storage pool as "cache devices." These devices
493 provide an additional layer of caching between main memory and disk. For
494 read-heavy workloads, where the working set size is much larger than what can
495 be cached in main memory, using cache devices allow much more of this working
496 set to be served from low latency media. Using cache devices provides the
497 greatest performance improvement for random read-workloads of mostly static
500 To create a pool with cache devices, specify a "cache"
502 with any number of devices. For example:
503 .Bd -literal -offset 2n
504 .Li # Ic zpool create pool da0 da1 cache da2 da3
507 Cache devices cannot be mirrored or part of a
509 configuration. If a read
510 error is encountered on a cache device, that read
512 is reissued to the original storage pool device, which might be part of a
517 The content of the cache devices is considered volatile, as is the case with
520 Each pool has several properties associated with it. Some properties are
521 read-only statistics while others are configurable and change the behavior of
522 the pool. The following are read-only properties:
523 .Bl -tag -width "dedupratio"
525 Amount of storage space within the pool that has been physically allocated.
527 Percentage of pool space used. This property can also be referred to by its
528 shortened column name, "cap".
530 A text string consisting of printable ASCII characters that will be stored
531 such that it is available even if the pool becomes faulted. An administrator
532 can provide additional information about a pool using this property.
534 The deduplication ratio specified for a pool, expressed as a multiplier.
537 value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See
539 for a description of the deduplication feature.
541 Number of blocks within the pool that are not allocated.
543 After a file system or snapshot is destroyed, the space it was using is
544 returned to the pool asynchronously.
546 is the amount of space remaining to be reclaimed.
553 This property has currently no value on FreeBSD.
555 A unique identifier for the pool.
557 The current health of the pool. Health can be
566 Total size of the storage pool.
567 .It Sy unsupported@ Ns Ar feature_guid
568 Information about unsupported features that are enabled on the pool.
573 Amount of storage space used within the pool.
576 The space usage properties report actual physical space available to the
577 storage pool. The physical space can be different from the total amount of
578 space that any contained datasets can actually use. The amount of space used in
581 configuration depends on the characteristics of the data being written.
584 reserves some space for internal accounting that the
586 command takes into account, but the
588 command does not. For non-full pools of a reasonable size, these effects should
589 be invisible. For small pools, or pools that are close to being completely
590 full, these discrepancies may become more noticeable.
592 The following property can be set at creation time and import time:
595 Alternate root directory. If set, this directory is prepended to any mount
596 points within the pool. This can be used when examining an unknown pool where
597 the mount points cannot be trusted, or in an alternate boot environment, where
598 the typical paths are not valid.
600 is not a persistent property. It is valid only while the system is up.
605 though this may be overridden using an explicit setting.
608 The following property can only be set at import time:
610 .It Sy readonly Ns = Ns Cm on No | Cm off
613 pool will be imported in read-only mode with the following restrictions:
614 .Bl -bullet -offset 2n
616 Synchronous data in the intent log will not be accessible
618 Properties of the pool can not be changed
620 Datasets of this pool can only be mounted read-only
622 To write to a read-only pool, a export and import of the pool is required.
626 The following properties can be set at creation time and import time, and later
631 .It Sy autoexpand Ns = Ns Cm on No | Cm off
632 Controls automatic pool expansion when the underlying LUN is grown. If set to
634 the pool will be resized according to the size of the expanded
635 device. If the device is part of a mirror or
637 then all devices within that
638 .No mirror/ Ns No raidz
639 group must be expanded before the new space is made available to
640 the pool. The default behavior is
642 This property can also be referred to by its shortened column name,
644 .It Sy autoreplace Ns = Ns Cm on No | Cm off
645 Controls automatic device replacement. If set to
647 device replacement must be initiated by the administrator by using the
651 any new device, found in the same
652 physical location as a device that previously belonged to the pool, is
653 automatically formatted and replaced. The default behavior is
655 This property can also be referred to by its shortened column name, "replace".
656 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
657 Identifies the default bootable dataset for the root pool. This property is
658 expected to be set mainly by the installation and upgrade programs.
659 .It Sy cachefile Ns = Ns Ar path No | Cm none
660 Controls the location of where the pool configuration is cached. Discovering
661 all pools on system startup requires a cached copy of the configuration data
662 that is stored on the root file system. All pools in this cache are
663 automatically imported when the system boots. Some environments, such as
664 install and clustering, need to cache this information in a different location
665 so that pools are not automatically imported. Setting this property caches the
666 pool configuration in a different location that can later be imported with
667 .Qq Nm Cm import Fl c .
668 Setting it to the special value
670 creates a temporary pool that is never cached, and the special value
672 (empty string) uses the default location.
673 .It Sy comment Ns = Ns Ar text
674 A text string consisting of printable ASCII characters that will be stored
675 such that it is available even if the pool becomes faulted.
676 An administrator can provide additional information about a pool using this
678 .It Sy dedupditto Ns = Ns Ar number
679 Threshold for the number of block ditto copies. If the reference count for a
680 deduplicated block increases above this number, a new ditto copy of this block
681 is automatically stored. Default setting is
683 .It Sy delegation Ns = Ns Cm on No | Cm off
684 Controls whether a non-privileged user is granted access based on the dataset
685 permissions defined on the dataset. See
687 for more information on
689 delegated administration.
690 .It Sy failmode Ns = Ns Cm wait No | Cm continue No | Cm panic
691 Controls the system behavior in the event of catastrophic pool failure. This
692 condition is typically a result of a loss of connectivity to the underlying
693 storage device(s) or a failure of all devices within the pool. The behavior of
694 such an event is determined as follows:
695 .Bl -tag -width indent
699 access until the device connectivity is recovered and the errors are cleared.
700 This is the default behavior.
706 requests but allows reads to any of the remaining healthy devices. Any write
707 requests that have yet to be committed to disk would be blocked.
709 Prints out a message to the console and generates a system crash dump.
711 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
712 The value of this property is the current state of
714 The only valid value when setting this property is
718 to the enabled state.
721 for details on feature states.
722 .It Sy listsnaps Ns = Ns Cm on No | Cm off
723 Controls whether information about snapshots associated with this pool is
728 option. The default value is
730 .It Sy version Ns = Ns Ar version
731 The current on-disk version of the pool. This can be increased, but never
732 decreased. The preferred method of updating pools is with the
734 command, though this property can be used when a specific version is needed
735 for backwards compatibility.
736 Once feature flags is enabled on a pool this property will no longer have a
740 All subcommands that modify state are logged persistently to the pool in their
745 command provides subcommands to create and destroy storage pools, add capacity
746 to storage pools, and provide information about the storage pools. The following
747 subcommands are supported:
754 Displays a help message.
762 Adds the specified virtual devices to the given pool. The
764 specification is described in the
765 .Qq Sx Virtual Devices
766 section. The behavior of the
768 option, and the device checks performed are described in the
771 .Bl -tag -width indent
775 even if they appear in use or specify a conflicting replication level.
776 Not all devices can be overridden in this manner.
778 Displays the configuration that would be used without actually adding the
780 The actual pool creation can still fail due to insufficient privileges or device
783 Do not add a disk that is currently configured as a quorum device to a zpool.
784 After a disk is in the pool, that disk can then be configured as a quorum
791 .Ar pool device new_device
798 device. The existing device cannot be part of a
802 is not currently part of a mirrored configuration,
804 automatically transforms into a two-way mirror of
805 .Ar device No and Ar new_device .
808 is part of a two-way mirror, attaching
810 creates a three-way mirror, and so on. In either case,
812 begins to resilver immediately.
813 .Bl -tag -width indent
817 even if its appears to be in use. Not all devices can be overridden in this
828 Clears device errors in a pool. If no arguments are specified, all device
829 errors within the pool are cleared. If one or more devices is specified, only
830 those errors associated with the specified device or devices are cleared.
831 .Bl -tag -width indent
833 Initiates recovery mode for an unopenable pool. Attempts to discard the last
834 few transactions in the pool to return it to an openable state. Not all damaged
835 pools can be recovered by using this option. If successful, the data from the
836 discarded transactions is irretrievably lost.
838 Used in combination with the
840 flag. Check whether discarding transactions would make the pool openable, but
841 do not actually discard any transactions.
847 .Op Fl o Ar property Ns = Ns Ar value
849 .Op Fl O Ar file-system-property Ns = Ns Ar value
851 .Op Fl m Ar mountpoint
856 Creates a new storage pool containing the virtual devices specified on the
857 command line. The pool name must begin with a letter, and can only contain
858 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
859 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
860 names beginning with the pattern "c[0-9]". The
862 specification is described in the
863 .Qq Sx Virtual Devices
866 The command verifies that each device specified is accessible and not currently
867 in use by another subsystem. There are some uses, such as being currently
868 mounted, or specified as the dedicated dump device, that prevents a device from
871 Other uses, such as having a preexisting
873 file system, can be overridden with the
877 The command also checks that the replication strategy for the pool is
878 consistent. An attempt to combine redundant and non-redundant storage in a
879 single pool, or to mix disks and files, results in an error unless
881 is specified. The use of differently sized devices within a single
883 or mirror group is also flagged as an error unless
889 option is specified, the default mount point is
891 The mount point must not exist or must be empty, or else the
892 root dataset cannot be mounted. This can be overridden with the
896 By default all supported features are enabled on the new pool unless the
899 .Bl -tag -width indent
903 even if they appear in use or specify a conflicting replication level.
904 Not all devices can be overridden in this manner.
906 Displays the configuration that would be used without actually creating the
907 pool. The actual pool creation can still fail due to insufficient privileges or
910 Do not enable any features on the new pool.
911 Individual features can be enabled by setting their corresponding properties
919 for details about feature properties.
921 .Fl o Ar property Ns = Ns Ar value
922 .Op Fl o Ar property Ns = Ns Ar value
925 Sets the given pool properties. See the
927 section for a list of valid properties that can be set.
930 .Ar file-system-property Ns = Ns Ar value
931 .Op Fl O Ar file-system-property Ns = Ns Ar value
934 Sets the given file system properties in the root file system of the pool. See
936 for a list of valid properties that
940 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
941 .It Fl m Ar mountpoint
942 Sets the mount point for the root dataset. The default mount point is
945 .Qq Cm altroot Ns Pa /pool
948 is specified. The mount point must be an absolute path,
952 For more information on dataset mount points, see
962 Destroys the given pool, freeing up any devices for other use. This command
963 tries to unmount any active datasets before destroying the pool.
964 .Bl -tag -width indent
966 Forces any active datasets contained within the pool to be unmounted.
976 from a mirror. The operation is refused if there are no other valid replicas
985 Exports the given pools from the system. All devices are marked as exported,
986 but are still considered in use by other subsystems. The devices can be moved
987 between systems (even those of different endianness) and imported as long as a
988 sufficient number of devices are present.
990 Before exporting the pool, all datasets within the pool are unmounted. A pool
991 can not be exported if it has a shared spare that is currently being used.
993 For pools to be portable, you must give the
995 command whole disks, not just slices, so that
997 can label the disks with portable
999 labels. Otherwise, disk drivers on platforms of different endianness will not
1000 recognize the disks.
1001 .Bl -tag -width indent
1003 Forcefully unmount all datasets, using the
1007 This command will forcefully export the pool even if it has a shared spare that
1008 is currently being used. This may lead to potential data corruption.
1013 .Ar all | property Ns Op , Ns Ar ...
1017 Retrieves the given list of properties (or all properties if
1019 is used) for the specified storage pool(s). These properties are displayed with
1020 the following fields:
1021 .Bl -column -offset indent "property"
1022 .It name Ta Name of storage pool
1023 .It property Ta Property name
1024 .It value Ta Property value
1025 .It source Ta Property source, either 'default' or 'local'.
1030 section for more information on the available pool properties.
1039 Displays the command history of the specified pools or all pools if no pool is
1041 .Bl -tag -width indent
1043 Displays internally logged
1045 events in addition to user initiated events.
1047 Displays log records in long format, which in addition to standard format
1048 includes, the user name, the hostname, and the zone in which the operation was
1054 .Op Fl d Ar dir | Fl c Ar cachefile
1058 Lists pools available to import. If the
1060 option is not specified, this command searches for devices in
1064 option can be specified multiple times, and all directories are searched. If
1065 the device appears to be part of an exported pool, this command displays a
1066 summary of the pool with the name of the pool, a numeric identifier, as well as
1069 layout and current health of the device for each device or file.
1070 Destroyed pools, pools that were previously destroyed with the
1072 command, are not listed unless the
1074 option is specified.
1076 The numeric identifier is unique, and can be used instead of the pool name when
1077 multiple exported pools of the same name are available.
1078 .Bl -tag -width indent
1079 .It Fl c Ar cachefile
1080 Reads configuration from the given
1082 that was created with the
1086 is used instead of searching for devices.
1088 Searches for devices or files in
1092 option can be specified multiple times.
1094 Lists destroyed pools only.
1100 .Op Fl o Ar property Ns = Ns Ar value
1102 .Op Fl d Ar dir | Fl c Ar cachefile
1112 Imports all pools found in the search directories. Identical to the previous
1113 command, except that all pools with a sufficient number of devices available
1114 are imported. Destroyed pools, pools that were previously destroyed with the
1116 command, will not be imported unless the
1118 option is specified.
1119 .Bl -tag -width indent
1121 Comma-separated list of mount options to use when mounting datasets within the
1124 for a description of dataset properties and mount options.
1125 .It Fl o Ar property Ns = Ns Ar value
1126 Sets the specified property on the imported pool. See the
1128 section for more information on the available pool properties.
1129 .It Fl c Ar cachefile
1130 Reads configuration from the given
1132 that was created with the
1136 is used instead of searching for devices.
1138 Searches for devices or files in
1142 option can be specified multiple times. This option is incompatible with the
1146 Imports destroyed pools only. The
1148 option is also required.
1150 Forces import, even if the pool appears to be potentially active.
1152 Enables import with missing log devices.
1154 Do not mount any filesystems from the imported pool.
1165 Recovery mode for a non-importable pool. Attempt to return the pool to an
1166 importable state by discarding the last few transactions. Not all damaged pools
1167 can be recovered by using this option. If successful, the data from the
1168 discarded transactions is irretrievably lost. This option is ignored if the
1169 pool is importable or already imported.
1173 recovery option. Determines whether a non-importable pool can be made
1174 importable again, but does not actually perform the pool recovery. For more
1175 details about pool recovery mode, see the
1179 Searches for and imports all pools found.
1185 .Op Fl o Ar property Ns = Ns Ar value
1187 .Op Fl d Ar dir | Fl c Ar cachefile
1198 Imports a specific pool. A pool can be identified by its name or the numeric
1201 is specified, the pool is imported using the name
1203 Otherwise, it is imported with the same name as its exported name.
1205 If a device is removed from a system without running
1207 first, the device appears as potentially active. It cannot be determined if
1208 this was a failed export, or whether the device is really in use from another
1209 host. To import a pool in this state, the
1212 .Bl -tag -width indent
1214 Comma-separated list of mount options to use when mounting datasets within the
1217 for a description of dataset properties and mount options.
1218 .It Fl o Ar property Ns = Ns Ar value
1219 Sets the specified property on the imported pool. See the
1221 section for more information on the available pool properties.
1222 .It Fl c Ar cachefile
1223 Reads configuration from the given
1225 that was created with the
1229 is used instead of searching for devices.
1231 Searches for devices or files in
1235 option can be specified multiple times. This option is incompatible with the
1239 Imports destroyed pools only. The
1241 option is also required.
1243 Forces import, even if the pool appears to be potentially active.
1245 Enables import with missing log devices.
1247 Do not mount any filesystems from the imported pool.
1250 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1252 Recovery mode for a non-importable pool. Attempt to return the pool to an
1253 importable state by discarding the last few transactions. Not all damaged pools
1254 can be recovered by using this option. If successful, the data from the
1255 discarded transactions is irretrievably lost. This option is ignored if the
1256 pool is importable or already imported.
1260 recovery option. Determines whether a non-importable pool can be made
1261 importable again, but does not actually perform the pool recovery. For more
1262 details about pool recovery mode, see the
1269 .Op Fl T Cm d Ns | Ns Cm u
1273 .Op Ar interval Op Ar count
1278 statistics for the given pools. When given an interval, the statistics are
1285 are specified, statistics for every pool in the system is shown. If
1287 is specified, the command exits after
1289 reports are printed.
1290 .Bl -tag -width indent
1291 .It Fl T Cm d Ns | Ns Cm u
1296 for standard date format. See
1301 .Pq equals Qq Ic date +%s .
1303 Verbose statistics. Reports usage statistics for individual
1305 within the pool, in addition to the pool-wide statistics.
1316 label information from the specified
1320 must not be part of an active pool configuration.
1321 .Bl -tag -width indent
1323 Treat exported or foreign devices as inactive.
1329 .Op Fl o Ar property Ns Op , Ns Ar ...
1330 .Op Fl T Cm d Ns | Ns Cm u
1333 .Op Ar inverval Op Ar count
1336 Lists the given pools along with a health status and space usage. When given no
1337 arguments, all pools in the system are listed.
1339 When given an interval, the output is printed every
1345 is specified, the command exits after
1347 reports are printed.
1348 .Bl -tag -width indent
1350 Scripted mode. Do not display headers, and separate fields by a single tab
1351 instead of arbitrary space.
1353 Show more detailed information.
1354 .It Fl o Ar property Ns Op , Ns Ar ...
1355 Comma-separated list of properties to display. See the
1357 section for a list of valid properties. The default list is
1365 .It Fl T Cm d Ns | Ns Cm u
1370 for standard date format. See
1375 .Pq equals Qq Ic date +%s .
1384 Takes the specified physical device offline. While the
1386 is offline, no attempt is made to read or write to the device.
1387 .Bl -tag -width indent
1389 Temporary. Upon reboot, the specified physical device reverts to its previous
1399 Brings the specified physical device online.
1401 This command is not applicable to spares or cache devices.
1402 .Bl -tag -width indent
1404 Expand the device to use all available space. If the device is part of a mirror
1407 then all devices must be expanded before the new space will become
1408 available to the pool.
1416 Generates a new unique identifier for the pool. You must ensure that all
1417 devices in this pool are online and healthy before performing this action.
1424 Removes the specified device from the pool. This command currently only
1425 supports removing hot spares, cache, and log devices. A mirrored log device can
1426 be removed by specifying the top-level mirror for the log. Non-log devices that
1427 are part of a mirrored configuration can be removed using the
1429 command. Non-redundant and
1431 devices cannot be removed from a pool.
1444 This is equivalent to attaching
1446 waiting for it to resilver, and then detaching
1451 must be greater than or equal to the minimum size
1452 of all the devices in a mirror or
1457 is required if the pool is not redundant. If
1459 is not specified, it defaults to
1461 This form of replacement is useful after an existing disk has failed and has
1462 been physically replaced. In this case, the new disk may have the same
1464 path as the old device, even though it is actually a different disk.
1467 .Bl -tag -width indent
1471 even if its appears to be in use. Not all devices can be overridden in this
1481 Begins a scrub. The scrub examines all data in the specified pools to verify
1482 that it checksums correctly. For replicated (mirror or
1486 automatically repairs any damage discovered during the scrub. The
1488 command reports the progress of the scrub and summarizes the results of the
1489 scrub upon completion.
1491 Scrubbing and resilvering are very similar operations. The difference is that
1492 resilvering only examines data that
1494 knows to be out of date (for example, when attaching a new device to a mirror
1495 or replacing an existing device), whereas scrubbing examines all data to
1496 discover silent errors due to hardware faults or disk failure.
1498 Because scrubbing and resilvering are
1499 .Tn I/O Ns -intensive
1502 only allows one at a time. If a scrub is already in progress, the
1504 command returns an error. To start a new scrub, you have to stop the old scrub
1506 .Qq Nm Cm scrub Fl s
1507 command first. If a resilver is in progress,
1509 does not allow a scrub to be started until the resilver completes.
1510 .Bl -tag -width indent
1517 .Ar property Ns = Ns Ar value pool
1520 Sets the given property on the specified pool. See the
1522 section for more information on what properties can be set and acceptable
1530 .Op Fl o Ar property Ns = Ns Ar value
1535 Splits off one disk from each mirrored top-level
1537 in a pool and creates a new pool from the split-off disks. The original pool
1538 must be made up of one or more mirrors and must not be in the process of
1541 subcommand chooses the last device in each mirror
1543 unless overridden by a device specification on the command line.
1549 includes the specified device(s) in a new pool and, should any devices remain
1550 unspecified, assigns the last device in each mirror
1552 to that pool, as it does normally. If you are uncertain about the outcome of a
1556 ("dry-run") option to ensure your command will have the effect you intend.
1557 .Bl -tag -width indent
1559 Automatically import the newly created pool after splitting, using the
1562 parameter for the new pool's alternate root. See the
1568 Displays the configuration that would be created without actually splitting the
1569 pool. The actual pool split could still fail due to insufficient privileges or
1572 Comma-separated list of mount options to use when mounting datasets within the
1575 for a description of dataset properties and mount options. Valid only in
1576 conjunction with the
1579 .It Fl o Ar property Ns = Ns Ar value
1580 Sets the specified property on the new pool. See the
1582 section, above, for more information on the available pool properties.
1588 .Op Fl T Cm d Ns | Ns Cm u
1591 .Op Ar interval Op Ar count
1594 Displays the detailed health status for the given pools. If no
1596 is specified, then the status of each pool in the system is displayed. For more
1597 information on pool and device health, see the
1598 .Qq Sx Device Failure and Recovery
1601 When given an interval, the output is printed every
1607 is specified, the command exits after
1609 reports are printed.
1611 If a scrub or resilver is in progress, this command reports the percentage
1612 done and the estimated time to completion. Both of these are only approximate,
1613 because the amount of data in the pool and the other workloads on the system
1615 .Bl -tag -width indent
1617 Only display status for pools that are exhibiting errors or are otherwise
1619 Warnings about pools not using the latest on-disk format will not be included.
1621 Displays verbose data error information, printing out a complete list of all
1622 data errors since the last complete pool scrub.
1623 .It Fl T Cm d Ns | Ns Cm u
1628 for standard date format. See
1633 .Pq equals Qq Ic date +%s .
1641 Displays pools which do not have all supported features enabled and pools
1642 formatted using a legacy
1645 These pools can continue to be used, but some features may not be available.
1648 to enable all features on all pools.
1649 .Bl -tag -width indent
1653 versions supported by the current software.
1655 .Xr zpool-features 7
1656 for a description of feature flags features supported by the current software.
1665 Enables all supported features on the given pool.
1666 Once this is done, the pool will no longer be accessible on systems that do
1667 not support feature flags.
1669 .Xr zpool-features 7
1670 for details on compatability with system sthat support feature flags, but do
1671 not support all features enabled on the pool.
1672 .Bl -tag -width indent
1674 Enables all supported features on all pools.
1676 Upgrade to the specified legacy version. If the
1678 flag is specified, no features will be enabled on the pool.
1679 This option can only be used to increase version number up to the last
1680 supported legacy version number.
1684 The following exit values are returned:
1685 .Bl -tag -offset 2n -width 2n
1687 Successful completion.
1691 Invalid command line options were specified.
1695 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1697 The following command creates a pool with a single
1701 that consists of six disks.
1702 .Bd -literal -offset 2n
1703 .Li # Ic zpool create tank raidz da0 da1 da2 da3 da4 da5
1705 .It Sy Example 2 No Creating a Mirrored Storage Pool
1707 The following command creates a pool with two mirrors, where each mirror
1709 .Bd -literal -offset 2n
1710 .Li # Ic zpool create tank mirror da0 da1 mirror da2 da3
1712 .It Sy Example 3 No Creating a Tn ZFS No Storage Pool by Using Partitions
1714 The following command creates an unmirrored pool using two GPT partitions.
1715 .Bd -literal -offset 2n
1716 .Li # Ic zpool create tank da0p3 da1p3
1718 .It Sy Example 4 No Creating a Tn ZFS No Storage Pool by Using Files
1720 The following command creates an unmirrored pool using files. While not
1721 recommended, a pool based on files can be useful for experimental purposes.
1722 .Bd -literal -offset 2n
1723 .Li # Ic zpool create tank /path/to/file/a /path/to/file/b
1725 .It Sy Example 5 No Adding a Mirror to a Tn ZFS No Storage Pool
1727 The following command adds two mirrored disks to the pool
1729 assuming the pool is already made up of two-way mirrors. The additional space
1730 is immediately available to any datasets within the pool.
1731 .Bd -literal -offset 2n
1732 .Li # Ic zpool add tank mirror da2 da3
1734 .It Sy Example 6 No Listing Available Tn ZFS No Storage Pools
1736 The following command lists all available pools on the system.
1737 .Bd -literal -offset 2n
1739 NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
1740 pool 2.70T 473G 2.24T 17% 1.00x ONLINE -
1741 test 1.98G 89.5K 1.98G 0% 1.00x ONLINE -
1743 .It Sy Example 7 No Listing All Properties for a Pool
1745 The following command lists all the properties for a pool.
1746 .Bd -literal -offset 2n
1747 .Li # Ic zpool get all pool
1750 pool altroot - default
1751 pool health ONLINE -
1752 pool guid 2501120270416322443 default
1753 pool version 28 default
1754 pool bootfs pool/root local
1755 pool delegation on default
1756 pool autoreplace off default
1757 pool cachefile - default
1758 pool failmode wait default
1759 pool listsnapshots off default
1760 pool autoexpand off default
1761 pool dedupditto 0 default
1762 pool dedupratio 1.00x -
1764 pool allocated 473G -
1767 .It Sy Example 8 No Destroying a Tn ZFS No Storage Pool
1769 The following command destroys the pool
1771 and any datasets contained within.
1772 .Bd -literal -offset 2n
1773 .Li # Ic zpool destroy -f tank
1775 .It Sy Example 9 No Exporting a Tn ZFS No Storage Pool
1777 The following command exports the devices in pool
1779 so that they can be relocated or later imported.
1780 .Bd -literal -offset 2n
1781 .Li # Ic zpool export tank
1783 .It Sy Example 10 No Importing a Tn ZFS No Storage Pool
1785 The following command displays available pools, and then imports the pool
1787 for use on the system.
1789 The results from this command are similar to the following:
1790 .Bd -literal -offset 2n
1791 .Li # Ic zpool import
1794 id: 15451357997522795478
1796 action: The pool can be imported using its name or numeric identifier.
1808 Storage Pools to the Current Version
1811 The following command upgrades all
1813 Storage pools to the current version of
1815 .Bd -literal -offset 2n
1816 .Li # Ic zpool upgrade -a
1817 This system is currently running ZFS pool version 28.
1819 .It Sy Example 12 No Managing Hot Spares
1821 The following command creates a new pool with an available hot spare:
1822 .Bd -literal -offset 2n
1823 .Li # Ic zpool create tank mirror da0 da1 spare da2
1826 If one of the disks were to fail, the pool would be reduced to the degraded
1827 state. The failed device can be replaced using the following command:
1828 .Bd -literal -offset 2n
1829 .Li # Ic zpool replace tank da0 da2
1832 Once the data has been resilvered, the spare is automatically removed and is
1833 made available should another device fails. The hot spare can be permanently
1834 removed from the pool using the following command:
1835 .Bd -literal -offset 2n
1836 .Li # Ic zpool remove tank da2
1842 Pool with Mirrored Separate Intent Logs
1845 The following command creates a
1847 storage pool consisting of two, two-way
1848 mirrors and mirrored log devices:
1849 .Bd -literal -offset 2n
1850 .Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5
1852 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
1854 The following command adds two disks for use as cache devices to a
1857 .Bd -literal -offset 2n
1858 .Li # Ic zpool add pool cache da2 da3
1861 Once added, the cache devices gradually fill with content from main memory.
1862 Depending on the size of your cache devices, it could take over an hour for
1863 them to fill. Capacity and reads can be monitored using the
1865 subcommand as follows:
1866 .Bd -literal -offset 2n
1867 .Li # Ic zpool iostat -v pool 5
1869 .It Sy Example 15 No Removing a Mirrored Log Device
1871 The following command removes the mirrored log device
1874 Given this configuration:
1875 .Bd -literal -offset 2n
1878 scrub: none requested
1881 NAME STATE READ WRITE CKSUM
1883 mirror-0 ONLINE 0 0 0
1886 mirror-1 ONLINE 0 0 0
1890 mirror-2 ONLINE 0 0 0
1895 The command to remove the mirrored log
1898 .Bd -literal -offset 2n
1899 .Li # Ic zpool remove tank mirror-2
1901 .It Sy Example 16 No Recovering a Faulted Tn ZFS No Pool
1903 If a pool is faulted but recoverable, a message indicating this state is
1906 if the pool was cached (see the
1908 argument above), or as part of the error output from a failed
1912 Recover a cached pool with the
1915 .Bd -literal -offset 2n
1916 .Li # Ic zpool clear -F data
1917 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
1918 Discarded approximately 29 seconds of transactions.
1921 If the pool configuration was not cached, use
1923 with the recovery mode flag:
1924 .Bd -literal -offset 2n
1925 .Li # Ic zpool import -F data
1926 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
1927 Discarded approximately 29 seconds of transactions.
1931 .Xr zpool-features 7 ,
1934 This manual page is a
1936 reimplementation of the
1940 modified and customized for
1942 and licensed under the Common Development and Distribution License
1947 implementation of this manual page was initially written by
1948 .An Martin Matuska Aq mm@FreeBSD.org .