2 .\" Copyright (c) 2011, 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>
31 .Nd configures ZFS storage pools
42 .Ar pool device new_device
51 .Op Fl o Ar property Ns = Ns Ar value
53 .Op Fl O Ar file-system-property Ns = Ns Ar value
55 .Op Fl m Ar mountpoint
71 .Ar all | property Ns Op , Ns Ar ...
80 .Op Fl d Ar dir | Fl c Ar cachefile
85 .Op Fl o Ar property Ns = Ns Ar value
87 .Op Fl d Ar dir | Fl c Ar cachefile
98 .Op Fl o Ar property Ns = Ns Ar value
100 .Op Fl d Ar dir | Fl c Ar cachefile
111 .Op Fl T Cm d Ns | Ns Cm u
122 .Op Fl o Ar property Ns Op , Ns Ar ...
123 .Op Fl T Cm d Ns | Ns Cm u
126 .Op Ar inverval Op Ar count
152 .Ar property Ns = Ns Ar value pool
158 .Op Fl o Ar property Ns = Ns Ar value
164 .Op Fl T Cm d Ns | Ns Cm u
167 .Op Ar interval Op Ar count
180 storage pools. A storage pool is a collection of devices that provides physical
181 storage and data replication for
185 All datasets within a storage pool share the same space. See
187 for information on managing datasets.
188 .Ss Virtual Devices (vdevs)
192 describes a single device or a collection of devices organized according to
193 certain performance and fault characteristics. The following virtual devices
197 A block device, typically located under
200 can use individual slices or partitions, though the recommended mode of
201 operation is to use whole disks. A disk can be specified by a full path to the
204 provider name. When given a whole disk,
206 automatically labels the disk, if necessary.
208 A regular file. The use of files as a backing store is strongly discouraged. It
209 is designed primarily for experimental purposes, as the fault tolerance of a
210 file is only as good the file system of which it is a part. A file must be
211 specified by a full path.
213 A mirror of two or more devices. Data is replicated in an identical fashion
214 across all components of a mirror. A mirror with
220 bytes and can withstand
222 devices failing before data integrity is compromised.
224 .No ( or Sy raidz1 raidz2 raidz3 Ns ).
227 that allows for better distribution of parity and eliminates the
228 .Qq Sy RAID-5 No write hole
229 (in which data and parity become inconsistent after a power loss). Data and
230 parity is striped across all disks within a
236 group can have single-, double- , or triple parity, meaning that the
238 group can sustain one, two, or three failures, respectively, without
241 type specifies a single-parity
245 type specifies a double-parity
249 type specifies a triple-parity
264 parity disks can hold approximately
269 bytes and can withstand
271 device(s) failing before data integrity is compromised. The minimum number of
274 group is one more than the number of parity disks. The
275 recommended number is between 3 and 9 to help increase performance.
278 .No pseudo- Ns No vdev
279 which keeps track of available hot spares for a pool.
280 For more information, see the
284 A separate-intent log device. If more than one log device is specified, then
285 writes are load-balanced between devices. Log devices can be mirrored. However,
288 types are not supported for the intent log. For more information,
293 A device used to cache storage pool data. A cache device cannot be configured
296 group. For more information, see the
301 Virtual devices cannot be nested, so a mirror or
303 virtual device can only
304 contain files or disks. Mirrors of mirrors (or other combinations) are not
307 A pool can have any number of virtual devices at the top of the configuration
311 Data is dynamically distributed across all top-level devices to balance data
312 among devices. As new virtual devices are added,
314 automatically places data on the newly available devices.
316 Virtual devices are specified one at a time on the command line, separated by
317 whitespace. The keywords
321 are used to distinguish where a group ends and another begins. For example, the
322 following creates two root
324 each a mirror of two disks:
325 .Ss Device Failure and Recovery
327 supports a rich set of mechanisms for handling device failure and data
328 corruption. All metadata and data is checksummed, and
330 automatically repairs bad data from a good copy when corruption is detected.
332 In order to take advantage of these features, a pool must make use of some form
333 of redundancy, using either mirrored or
337 supports running in a non-redundant configuration, where each root
339 is simply a disk or file, this is strongly discouraged. A single case of bit
340 corruption can render some or all of your data unavailable.
342 A pool's health status is described by one of three states: online, degraded,
343 or faulted. An online pool has all devices operating normally. A degraded pool
344 is one in which one or more devices have failed, but the data is still
345 available due to a redundant configuration. A faulted pool has corrupted
346 metadata, or one or more faulted devices, and insufficient replicas to continue
349 The health of the top-level
354 potentially impacted by the state of its associated
356 or component devices. A top-level
358 or component device is in one of the following states:
359 .Bl -tag -width "DEGRADED"
361 One or more top-level
363 is in the degraded state because one or more
364 component devices are offline. Sufficient replicas exist to continue
367 One or more component devices is in the degraded or faulted state, but
368 sufficient replicas exist to continue functioning. The underlying conditions
370 .Bl -bullet -offset 2n
372 The number of checksum errors exceeds acceptable levels and the device is
373 degraded as an indication that something may be wrong.
375 continues to use the device as necessary.
379 errors exceeds acceptable levels. The device could not be
380 marked as faulted because there are insufficient replicas to continue
384 One or more top-level
386 is in the faulted state because one or more
387 component devices are offline. Insufficient replicas exist to continue
390 One or more component devices is in the faulted state, and insufficient
391 replicas exist to continue functioning. The underlying conditions are as
393 .Bl -bullet -offset 2n
395 The device could be opened, but the contents did not match expected values.
399 errors exceeds acceptable levels and the device is faulted to
400 prevent further use of the device.
403 The device was explicitly taken offline by the
407 The device is online and functioning.
409 The device was physically removed while the system was running. Device removal
410 detection is hardware-dependent and may not be supported on all platforms.
412 The device could not be opened. If a pool is imported when a device was
413 unavailable, then the device will be identified by a unique identifier instead
414 of its path since the path was never correct in the first place.
417 If a device is removed and later reattached to the system,
419 attempts to put the device online automatically. Device attach detection is
420 hardware-dependent and might not be supported on all platforms.
423 allows devices to be associated with pools as
425 These devices are not actively used in the pool, but when an active device
426 fails, it is automatically replaced by a hot spare. To create a pool with hot
430 with any number of devices. For example,
431 .Bd -literal -offset 2n
432 .Li # Ic zpool create pool mirror da0 da1 spare da2 da3
435 Spares can be shared across multiple pools, and can be added with the
437 command and removed with the
439 command. Once a spare replacement is initiated, a new "spare"
442 within the configuration that will remain there until the original device is
443 replaced. At this point, the hot spare becomes available again if another
446 If a pool has a shared spare that is currently being used, the pool can not be
447 exported since other pools may use this shared spare, which may lead to
448 potential data corruption.
450 An in-progress spare replacement can be cancelled by detaching the hot spare.
451 If the original faulted device is detached, then the hot spare assumes its
452 place in the configuration, and is removed from the spare list of all active
455 Spares cannot replace log devices.
463 requirements for synchronous transactions. For instance, databases often
464 require their transactions to be on stable storage devices when returning from
467 and other applications can also use
469 to ensure data stability. By default, the intent log is allocated from blocks
470 within the main pool. However, it might be possible to get better performance
471 using separate intent log devices such as
473 or a dedicated disk. For example:
474 .Bd -literal -offset 2n
475 .Li # Ic zpool create pool da0 da1 log da2
478 Multiple log devices can also be specified, and they can be mirrored. See the
480 section for an example of mirroring multiple log devices.
482 Log devices can be added, replaced, attached, detached, imported and exported
483 as part of the larger pool. Mirrored log devices can be removed by specifying
484 the top-level mirror for the log.
486 Devices can be added to a storage pool as "cache devices." These devices
487 provide an additional layer of caching between main memory and disk. For
488 read-heavy workloads, where the working set size is much larger than what can
489 be cached in main memory, using cache devices allow much more of this working
490 set to be served from low latency media. Using cache devices provides the
491 greatest performance improvement for random read-workloads of mostly static
494 To create a pool with cache devices, specify a "cache"
496 with any number of devices. For example:
497 .Bd -literal -offset 2n
498 .Li # Ic zpool create pool da0 da1 cache da2 da3
501 Cache devices cannot be mirrored or part of a
503 configuration. If a read
504 error is encountered on a cache device, that read
506 is reissued to the original storage pool device, which might be part of a
511 The content of the cache devices is considered volatile, as is the case with
514 Each pool has several properties associated with it. Some properties are
515 read-only statistics while others are configurable and change the behavior of
516 the pool. The following are read-only properties:
517 .Bl -tag -width "dedupratio"
519 Amount of storage space within the pool that has been physically allocated.
521 Percentage of pool space used. This property can also be referred to by its
522 shortened column name, "cap".
524 A text string consisting of printable ASCII characters that will be stored
525 such that it is available even if the pool becomes faulted. An administrator
526 can provide additional information about a pool using this property.
528 The deduplication ratio specified for a pool, expressed as a multiplier.
531 value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See
533 for a description of the deduplication feature.
535 Number of blocks within the pool that are not allocated.
537 A unique identifier for the pool.
539 The current health of the pool. Health can be
544 .Qq Sy REMOVED Ns , or
547 Total size of the storage pool.
549 Amount of storage space used within the pool.
552 These space usage properties report actual physical space available to the
553 storage pool. The physical space can be different from the total amount of
554 space that any contained datasets can actually use. The amount of space used in
557 configuration depends on the characteristics of the data being written.
560 reserves some space for internal accounting that the
562 command takes into account, but the
564 command does not. For non-full pools of a reasonable size, these effects should
565 be invisible. For small pools, or pools that are close to being completely
566 full, these discrepancies may become more noticeable.
568 The following property can be set at creation time and import time:
571 Alternate root directory. If set, this directory is prepended to any mount
572 points within the pool. This can be used when examining an unknown pool where
573 the mount points cannot be trusted, or in an alternate boot environment, where
574 the typical paths are not valid.
576 is not a persistent property. It is valid only while the system is up.
580 .Cm cachefile=none Ns ,
581 though this may be overridden using an explicit setting.
584 The following property can only be set at import time:
586 .It Sy readonly Ns = Ns Cm on No | Cm off
589 pool will be imported in read-only mode with the following restrictions:
590 .Bl -bullet -offset 2n
592 Synchronous data in the intent log will not be accessible
594 Properties of the pool can not be changed
596 Datasets of this pool can only be mounted read-only
598 To write to a read-only pool, a export and import of the pool is required.
602 The following properties can be set at creation time and import time, and later
607 .It Sy autoexpand Ns = Ns Cm on No | Cm off
608 Controls automatic pool expansion when the underlying LUN is grown. If set to
610 the pool will be resized according to the size of the expanded
611 device. If the device is part of a mirror or
613 then all devices within that
614 .No mirror/ Ns No raidz
615 group must be expanded before the new space is made available to
616 the pool. The default behavior is
618 This property can also be referred to by its shortened column name,
620 .It Sy autoreplace Ns = Ns Cm on No | Cm off
621 Controls automatic device replacement. If set to
623 device replacement must be initiated by the administrator by using the
627 any new device, found in the same
628 physical location as a device that previously belonged to the pool, is
629 automatically formatted and replaced. The default behavior is
631 This property can also be referred to by its shortened column name, "replace".
632 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
633 Identifies the default bootable dataset for the root pool. This property is
634 expected to be set mainly by the installation and upgrade programs.
635 .It Sy cachefile Ns = Ns Ar path No | Cm none
636 Controls the location of where the pool configuration is cached. Discovering
637 all pools on system startup requires a cached copy of the configuration data
638 that is stored on the root file system. All pools in this cache are
639 automatically imported when the system boots. Some environments, such as
640 install and clustering, need to cache this information in a different location
641 so that pools are not automatically imported. Setting this property caches the
642 pool configuration in a different location that can later be imported with
643 .Qq Nm Cm import Fl c .
644 Setting it to the special value
646 creates a temporary pool that is never cached, and the special value
648 (empty string) uses the default location.
649 .It Sy dedupditto Ns = Ns Ar number
650 Threshold for the number of block ditto copies. If the reference count for a
651 deduplicated block increases above this number, a new ditto copy of this block
652 is automatically stored. Deafult setting is
654 .It Sy delegation Ns = Ns Cm on No | Cm off
655 Controls whether a non-privileged user is granted access based on the dataset
656 permissions defined on the dataset. See
658 for more information on
660 delegated administration.
661 .It Sy failmode Ns = Ns Cm wait No | Cm continue No | Cm panic
662 Controls the system behavior in the event of catastrophic pool failure. This
663 condition is typically a result of a loss of connectivity to the underlying
664 storage device(s) or a failure of all devices within the pool. The behavior of
665 such an event is determined as follows:
666 .Bl -tag -width indent
670 access until the device connectivity is recovered and the errors are cleared.
671 This is the default behavior.
677 requests but allows reads to any of the remaining healthy devices. Any write
678 requests that have yet to be committed to disk would be blocked.
680 Prints out a message to the console and generates a system crash dump.
682 .It Sy listsnaps Ns = Ns Cm on No | Cm off
683 Controls whether information about snapshots associated with this pool is
688 option. The default value is
690 .It Sy version Ns = Ns Ar version
691 The current on-disk version of the pool. This can be increased, but never
692 decreased. The preferred method of updating pools is with the
694 command, though this property can be used when a specific version is needed
695 for backwards compatibility. This property can be any number between 1 and the
696 current version reported by
697 .Qo Ic zpool upgrade -v Qc Ns .
700 All subcommands that modify state are logged persistently to the pool in their
705 command provides subcommands to create and destroy storage pools, add capacity
706 to storage pools, and provide information about the storage pools. The following
707 subcommands are supported:
714 Displays a help message.
722 Adds the specified virtual devices to the given pool. The
724 specification is described in the
725 .Qq Sx Virtual Devices
726 section. The behavior of the
728 option, and the device checks performed are described in the
731 .Bl -tag -width indent
735 even if they appear in use or specify a conflicting replication level.
736 Not all devices can be overridden in this manner.
738 Displays the configuration that would be used without actually adding the
740 The actual pool creation can still fail due to insufficient privileges or device
743 Do not add a disk that is currently configured as a quorum device to a zpool.
744 After a disk is in the pool, that disk can then be configured as a quorum
751 .Ar pool device new_device
758 device. The existing device cannot be part of a
762 is not currently part of a mirrored configuration,
764 automatically transforms into a two-way mirror of
765 .Ar device No and Ar new_device Ns . If
767 is part of a two-way mirror, attaching
769 creates a three-way mirror, and so on. In either case,
771 begins to resilver immediately.
772 .Bl -tag -width indent
776 even if its appears to be in use. Not all devices can be overridden in this
787 Clears device errors in a pool. If no arguments are specified, all device
788 errors within the pool are cleared. If one or more devices is specified, only
789 those errors associated with the specified device or devices are cleared.
790 .Bl -tag -width indent
792 Initiates recovery mode for an unopenable pool. Attempts to discard the last
793 few transactions in the pool to return it to an openable state. Not all damaged
794 pools can be recovered by using this option. If successful, the data from the
795 discarded transactions is irretrievably lost.
797 Used in combination with the
799 flag. Check whether discarding transactions would make the pool openable, but
800 do not actually discard any transactions.
806 .Op Fl o Ar property Ns = Ns Ar value
808 .Op Fl O Ar file-system-property Ns = Ns Ar value
810 .Op Fl m Ar mountpoint
815 Creates a new storage pool containing the virtual devices specified on the
816 command line. The pool name must begin with a letter, and can only contain
817 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
818 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
819 names beginning with the pattern "c[0-9]". The
821 specification is described in the
822 .Qq Sx Virtual Devices
825 The command verifies that each device specified is accessible and not currently
826 in use by another subsystem. There are some uses, such as being currently
827 mounted, or specified as the dedicated dump device, that prevents a device from
830 Other uses, such as having a preexisting
832 file system, can be overridden with the
836 The command also checks that the replication strategy for the pool is
837 consistent. An attempt to combine redundant and non-redundant storage in a
838 single pool, or to mix disks and files, results in an error unless
840 is specified. The use of differently sized devices within a single
842 or mirror group is also flagged as an error unless
848 option is specified, the default mount point is
850 The mount point must not exist or must be empty, or else the
851 root dataset cannot be mounted. This can be overridden with the
854 .Bl -tag -width indent
858 even if they appear in use or specify a conflicting replication level.
859 Not all devices can be overridden in this manner.
861 Displays the configuration that would be used without actually creating the
862 pool. The actual pool creation can still fail due to insufficient privileges or
865 .Fl o Ar property Ns = Ns Ar value
866 .Op Fl o Ar property Ns = Ns Ar value
869 Sets the given pool properties. See the
871 section for a list of valid properties that can be set.
874 .Ar file-system-property Ns = Ns Ar value
875 .Op Fl O Ar file-system-property Ns = Ns Ar value
878 Sets the given file system properties in the root file system of the pool. See
880 for a list of valid properties that
884 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
885 .It Fl m Ar mountpoint
886 Sets the mount point for the root dataset. The default mount point is
889 .Qq Cm altroot Ns Pa /pool
892 is specified. The mount point must be an absolute path,
893 .Qq Cm legacy Ns , or Qq Cm none Ns .
894 For more information on dataset mount points, see
904 Destroys the given pool, freeing up any devices for other use. This command
905 tries to unmount any active datasets before destroying the pool.
906 .Bl -tag -width indent
908 Forces any active datasets contained within the pool to be unmounted.
918 from a mirror. The operation is refused if there are no other valid replicas
927 Exports the given pools from the system. All devices are marked as exported,
928 but are still considered in use by other subsystems. The devices can be moved
929 between systems (even those of different endianness) and imported as long as a
930 sufficient number of devices are present.
932 Before exporting the pool, all datasets within the pool are unmounted. A pool
933 can not be exported if it has a shared spare that is currently being used.
935 For pools to be portable, you must give the
937 command whole disks, not just slices, so that
939 can label the disks with portable
941 labels. Otherwise, disk drivers on platforms of different endianness will not
943 .Bl -tag -width indent
945 Forcefully unmount all datasets, using the
949 This command will forcefully export the pool even if it has a shared spare that
950 is currently being used. This may lead to potential data corruption.
955 .Ar all | property Ns Op , Ns Ar ...
959 Retrieves the given list of properties (or all properties if
961 is used) for the specified storage pool(s). These properties are displayed with
962 the following fields:
963 .Bl -column -offset indent "property"
964 .It name Ta Name of storage pool
965 .It property Ta Property name
966 .It value Ta Property value
967 .It source Ta Property source, either 'default' or 'local'.
972 section for more information on the available pool properties.
981 Displays the command history of the specified pools or all pools if no pool is
983 .Bl -tag -width indent
985 Displays internally logged
987 events in addition to user initiated events.
989 Displays log records in long format, which in addition to standard format
990 includes, the user name, the hostname, and the zone in which the operation was
996 .Op Fl d Ar dir | Fl c Ar cachefile
1000 Lists pools available to import. If the
1002 option is not specified, this command searches for devices in
1006 option can be specified multiple times, and all directories are searched. If
1007 the device appears to be part of an exported pool, this command displays a
1008 summary of the pool with the name of the pool, a numeric identifier, as well as
1011 layout and current health of the device for each device or file.
1012 Destroyed pools, pools that were previously destroyed with the
1014 command, are not listed unless the
1016 option is specified.
1018 The numeric identifier is unique, and can be used instead of the pool name when
1019 multiple exported pools of the same name are available.
1020 .Bl -tag -width indent
1021 .It Fl c Ar cachefile
1022 Reads configuration from the given
1024 that was created with the
1028 is used instead of searching for devices.
1030 Searches for devices or files in
1034 option can be specified multiple times.
1036 Lists destroyed pools only.
1042 .Op Fl o Ar property Ns = Ns Ar value
1044 .Op Fl d Ar dir | Fl c Ar cachefile
1054 Imports all pools found in the search directories. Identical to the previous
1055 command, except that all pools with a sufficient number of devices available
1056 are imported. Destroyed pools, pools that were previously destroyed with the
1058 command, will not be imported unless the
1060 option is specified.
1061 .Bl -tag -width indent
1063 Comma-separated list of mount options to use when mounting datasets within the
1066 for a description of dataset properties and mount options.
1067 .It Fl o Ar property Ns = Ns Ar value
1068 Sets the specified property on the imported pool. See the
1070 section for more information on the available pool properties.
1071 .It Fl c Ar cachefile
1072 Reads configuration from the given
1074 that was created with the
1078 is used instead of searching for devices.
1080 Searches for devices or files in
1084 option can be specified multiple times. This option is incompatible with the
1088 Imports destroyed pools only. The
1090 option is also required.
1092 Forces import, even if the pool appears to be potentially active.
1094 Enables import with missing log devices.
1096 Do not mount any filesystems from the imported pool.
1107 Recovery mode for a non-importable pool. Attempt to return the pool to an
1108 importable state by discarding the last few transactions. Not all damaged pools
1109 can be recovered by using this option. If successful, the data from the
1110 discarded transactions is irretrievably lost. This option is ignored if the
1111 pool is importable or already imported.
1115 recovery option. Determines whether a non-importable pool can be made
1116 importable again, but does not actually perform the pool recovery. For more
1117 details about pool recovery mode, see the
1121 Searches for and imports all pools found.
1127 .Op Fl o Ar property Ns = Ns Ar value
1129 .Op Fl d Ar dir | Fl c Ar cachefile
1140 Imports a specific pool. A pool can be identified by its name or the numeric
1143 is specified, the pool is imported using the name
1145 Otherwise, it is imported with the same name as its exported name.
1147 If a device is removed from a system without running
1149 first, the device appears as potentially active. It cannot be determined if
1150 this was a failed export, or whether the device is really in use from another
1151 host. To import a pool in this state, the
1154 .Bl -tag -width indent
1156 Comma-separated list of mount options to use when mounting datasets within the
1159 for a description of dataset properties and mount options.
1160 .It Fl o Ar property Ns = Ns Ar value
1161 Sets the specified property on the imported pool. See the
1163 section for more information on the available pool properties.
1164 .It Fl c Ar cachefile
1165 Reads configuration from the given
1167 that was created with the
1171 is used instead of searching for devices.
1173 Searches for devices or files in
1177 option can be specified multiple times. This option is incompatible with the
1181 Imports destroyed pools only. The
1183 option is also required.
1185 Forces import, even if the pool appears to be potentially active.
1187 Enables import with missing log devices.
1189 Do not mount any filesystems from the imported pool.
1192 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1194 Recovery mode for a non-importable pool. Attempt to return the pool to an
1195 importable state by discarding the last few transactions. Not all damaged pools
1196 can be recovered by using this option. If successful, the data from the
1197 discarded transactions is irretrievably lost. This option is ignored if the
1198 pool is importable or already imported.
1202 recovery option. Determines whether a non-importable pool can be made
1203 importable again, but does not actually perform the pool recovery. For more
1204 details about pool recovery mode, see the
1211 .Op Fl T Cm d Ns | Ns Cm u
1215 .Op Ar interval Op Ar count
1220 statistics for the given pools. When given an interval, the statistics are
1227 are specified, statistics for every pool in the system is shown. If
1229 is specified, the command exits after
1231 reports are printed.
1232 .Bl -tag -width indent
1233 .It Fl T Cm d Ns | Ns Cm u
1238 for standard date format. See
1243 .Pq equals Qq Ic date +%s Ns .
1245 Verbose statistics. Reports usage statistics for individual
1247 within the pool, in addition to the pool-wide statistics.
1258 label information from the specified
1262 must not be part of an active pool configuration.
1263 .Bl -tag -width indent
1265 Treat exported or foreign devices as inactive.
1271 .Op Fl o Ar property Ns Op , Ns Ar ...
1272 .Op Fl T Cm d Ns | Ns Cm u
1275 .Op Ar inverval Op Ar count
1278 Lists the given pools along with a health status and space usage. When given no
1279 arguments, all pools in the system are listed.
1281 When given an interval, the output is printed every
1287 is specified, the command exits after
1289 reports are printed.
1290 .Bl -tag -width indent
1292 Scripted mode. Do not display headers, and separate fields by a single tab
1293 instead of arbitrary space.
1294 .It Fl o Ar property Ns Op , Ns Ar ...
1295 Comma-separated list of properties to display. See the
1297 section for a list of valid properties. The default list is
1305 .It Fl T Cm d Ns | Ns Cm u
1310 for standard date format. See
1315 .Pq equals Qq Ic date +%s Ns .
1324 Takes the specified physical device offline. While the
1326 is offline, no attempt is made to read or write to the device.
1327 .Bl -tag -width indent
1329 Temporary. Upon reboot, the specified physical device reverts to its previous
1339 Brings the specified physical device online.
1341 This command is not applicable to spares or cache devices.
1342 .Bl -tag -width indent
1344 Expand the device to use all available space. If the device is part of a mirror
1347 then all devices must be expanded before the new space will become
1348 available to the pool.
1356 Generates a new unique identifier for the pool. You must ensure that all
1357 devices in this pool are online and healthy before performing this action.
1364 Removes the specified device from the pool. This command currently only
1365 supports removing hot spares, cache, and log devices. A mirrored log device can
1366 be removed by specifying the top-level mirror for the log. Non-log devices that
1367 are part of a mirrored configuration can be removed using the
1369 command. Non-redundant and
1371 devices cannot be removed from a pool.
1384 This is equivalent to attaching
1386 waiting for it to resilver, and then detaching
1391 must be greater than or equal to the minimum size
1392 of all the devices in a mirror or
1397 is required if the pool is not redundant. If
1399 is not specified, it defaults to
1401 This form of replacement is useful after an existing disk has failed and has
1402 been physically replaced. In this case, the new disk may have the same
1404 path as the old device, even though it is actually a different disk.
1407 .Bl -tag -width indent
1411 even if its appears to be in use. Not all devices can be overridden in this
1421 Begins a scrub. The scrub examines all data in the specified pools to verify
1422 that it checksums correctly. For replicated (mirror or
1426 automatically repairs any damage discovered during the scrub. The
1428 command reports the progress of the scrub and summarizes the results of the
1429 scrub upon completion.
1431 Scrubbing and resilvering are very similar operations. The difference is that
1432 resilvering only examines data that
1434 knows to be out of date (for example, when attaching a new device to a mirror
1435 or replacing an existing device), whereas scrubbing examines all data to
1436 discover silent errors due to hardware faults or disk failure.
1438 Because scrubbing and resilvering are
1439 .Tn I/O Ns -intensive
1442 only allows one at a time. If a scrub is already in progress, the
1444 command returns an error. To start a new scrub, you have to stop the old scrub
1446 .Qq Nm Cm scrub Fl s
1447 command first. If a resilver is in progress,
1449 does not allow a scrub to be started until the resilver completes.
1450 .Bl -tag -width indent
1457 .Ar property Ns = Ns Ar value pool
1460 Sets the given property on the specified pool. See the
1462 section for more information on what properties can be set and acceptable
1470 .Op Fl o Ar property Ns = Ns Ar value
1475 Splits off one disk from each mirrored top-level
1477 in a pool and creates a new pool from the split-off disks. The original pool
1478 must be made up of one or more mirrors and must not be in the process of
1481 subcommand chooses the last device in each mirror
1483 unless overridden by a device specification on the command line.
1489 includes the specified device(s) in a new pool and, should any devices remain
1490 unspecified, assigns the last device in each mirror
1492 to that pool, as it does normally. If you are uncertain about the outcome of a
1496 ("dry-run") option to ensure your command will have the effect you intend.
1497 .Bl -tag -width indent
1499 Automatically import the newly created pool after splitting, using the
1502 parameter for the new pool's alternate root. See the
1508 Displays the configuration that would be created without actually splitting the
1509 pool. The actual pool split could still fail due to insufficient privileges or
1512 Comma-separated list of mount options to use when mounting datasets within the
1515 for a description of dataset properties and mount options. Valid only in
1516 conjunction with the
1519 .It Fl o Ar property Ns = Ns Ar value
1520 Sets the specified property on the new pool. See the
1522 section, above, for more information on the available pool properties.
1528 .Op Fl T Cm d Ns | Ns Cm u
1531 .Op Ar interval Op Ar count
1534 Displays the detailed health status for the given pools. If no
1536 is specified, then the status of each pool in the system is displayed. For more
1537 information on pool and device health, see the
1538 .Qq Sx Device Failure and Recovery
1541 When given an interval, the output is printed every
1547 is specified, the command exits after
1549 reports are printed.
1551 If a scrub or resilver is in progress, this command reports the percentage done
1552 and the estimated time to completion. Both of these are only approximate,
1553 because the amount of data in the pool and the other workloads on the system
1555 .Bl -tag -width indent
1557 Only display status for pools that are exhibiting errors or are otherwise
1560 Displays verbose data error information, printing out a complete list of all
1561 data errors since the last complete pool scrub.
1562 .It Fl T Cm d Ns | Ns Cm u
1567 for standard date format. See
1572 .Pq equals Qq Ic date +%s Ns .
1580 Displays all pools formatted using a different
1582 pool on-disk version. Older versions can continue to be used, but some
1583 features may not be available. These pools can be upgraded using
1584 .Qq Nm Cm upgrade Fl a .
1585 Pools that are formatted with a more recent version are also displayed,
1586 although these pools will be inaccessible on the system.
1587 .Bl -tag -width indent
1591 pool versions supported by the current software. The current
1593 pool version and all previous supported versions are displayed, along
1594 with an explanation of the features provided with each version.
1603 Upgrades the given pool to the latest on-disk pool version. Once this is done,
1604 the pool will no longer be accessible on systems running older versions of the
1606 .Bl -tag -width indent
1610 Upgrade to the specified version. If the
1612 flag is not specified, the pool is upgraded to the most recent version. This
1613 option can only be used to increase the version number, and only up to the most
1614 recent version supported by this software.
1619 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1621 The following command creates a pool with a single
1625 that consists of six disks.
1626 .Bd -literal -offset 2n
1627 .Li # Ic zpool create tank raidz da0 da1 da2 da3 da4 da5
1629 .It Sy Example 2 No Creating a Mirrored Storage Pool
1631 The following command creates a pool with two mirrors, where each mirror
1633 .Bd -literal -offset 2n
1634 .Li # Ic zpool create tank mirror da0 da1 mirror da2 da3
1636 .It Sy Example 3 No Creating a Tn ZFS No Storage Pool by Using Partitions
1638 The following command creates an unmirrored pool using two GPT partitions.
1639 .Bd -literal -offset 2n
1640 .Li # Ic zpool create tank da0p3 da1p3
1642 .It Sy Example 4 No Creating a Tn ZFS No Storage Pool by Using Files
1644 The following command creates an unmirrored pool using files. While not
1645 recommended, a pool based on files can be useful for experimental purposes.
1646 .Bd -literal -offset 2n
1647 .Li # Ic zpool create tank /path/to/file/a /path/to/file/b
1649 .It Sy Example 5 No Adding a Mirror to a Tn ZFS No Storage Pool
1651 The following command adds two mirrored disks to the pool
1653 assuming the pool is already made up of two-way mirrors. The additional space
1654 is immediately available to any datasets within the pool.
1655 .Bd -literal -offset 2n
1656 .Li # Ic zpool add tank mirror da2 da3
1658 .It Sy Example 6 No Listing Available Tn ZFS No Storage Pools
1660 The following command lists all available pools on the system.
1661 .Bd -literal -offset 2n
1663 NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
1664 pool 2.70T 473G 2.24T 17% 1.00x ONLINE -
1665 test 1.98G 89.5K 1.98G 0% 1.00x ONLINE -
1667 .It Sy Example 7 No Listing All Properties for a Pool
1669 The following command lists all the properties for a pool.
1670 .Bd -literal -offset 2n
1671 .Li # Ic zpool get all pool
1674 pool altroot - default
1675 pool health ONLINE -
1676 pool guid 2501120270416322443 default
1677 pool version 28 default
1678 pool bootfs pool/root local
1679 pool delegation on default
1680 pool autoreplace off default
1681 pool cachefile - default
1682 pool failmode wait default
1683 pool listsnapshots off default
1684 pool autoexpand off default
1685 pool dedupditto 0 default
1686 pool dedupratio 1.00x -
1688 pool allocated 473G -
1691 .It Sy Example 8 No Destroying a Tn ZFS No Storage Pool
1693 The following command destroys the pool
1695 and any datasets contained within.
1696 .Bd -literal -offset 2n
1697 .Li # Ic zpool destroy -f tank
1699 .It Sy Example 9 No Exporting a Tn ZFS No Storage Pool
1701 The following command exports the devices in pool
1703 so that they can be relocated or later imported.
1704 .Bd -literal -offset 2n
1705 .Li # Ic zpool export tank
1707 .It Sy Example 10 No Importing a Tn ZFS No Storage Pool
1709 The following command displays available pools, and then imports the pool
1711 for use on the system.
1713 The results from this command are similar to the following:
1714 .Bd -literal -offset 2n
1715 .Li # Ic zpool import
1718 id: 15451357997522795478
1720 action: The pool can be imported using its name or numeric identifier.
1732 Storage Pools to the Current Version
1735 The following command upgrades all
1737 Storage pools to the current version of
1739 .Bd -literal -offset 2n
1740 .Li # Ic zpool upgrade -a
1741 This system is currently running ZFS pool version 28.
1743 .It Sy Example 12 No Managing Hot Spares
1745 The following command creates a new pool with an available hot spare:
1746 .Bd -literal -offset 2n
1747 .Li # Ic zpool create tank mirror da0 da1 spare da2
1750 If one of the disks were to fail, the pool would be reduced to the degraded
1751 state. The failed device can be replaced using the following command:
1752 .Bd -literal -offset 2n
1753 .Li # Ic zpool replace tank da0 da2
1756 Once the data has been resilvered, the spare is automatically removed and is
1757 made available should another device fails. The hot spare can be permanently
1758 removed from the pool using the following command:
1759 .Bd -literal -offset 2n
1760 .Li # Ic zpool remove tank da2
1766 Pool with Mirrored Separate Intent Logs
1769 The following command creates a
1771 storage pool consisting of two, two-way
1772 mirrors and mirrored log devices:
1773 .Bd -literal -offset 2n
1774 .Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log miror da4 da5
1776 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
1778 The following command adds two disks for use as cache devices to a
1781 .Bd -literal -offset 2n
1782 .Li # Ic zpool add pool cache da2 da3
1785 Once added, the cache devices gradually fill with content from main memory.
1786 Depending on the size of your cache devices, it could take over an hour for
1787 them to fill. Capacity and reads can be monitored using the
1789 subcommand as follows:
1790 .Bd -literal -offset 2n
1791 .Li # Ic zpool iostat -v pool 5
1793 .It Sy Example 15 No Removing a Mirrored Log Device
1795 The following command removes the mirrored log device
1798 Given this configuration:
1799 .Bd -literal -offset 2n
1802 scrub: none requested
1805 NAME STATE READ WRITE CKSUM
1807 mirror-0 ONLINE 0 0 0
1810 mirror-1 ONLINE 0 0 0
1814 mirror-2 ONLINE 0 0 0
1819 The command to remove the mirrored log
1822 .Bd -literal -offset 2n
1823 .Li # Ic zpool remove tank mirror-2
1825 .It Sy Example 16 No Recovering a Faulted Tn ZFS No Pool
1827 If a pool is faulted but recoverable, a message indicating this state is
1830 if the pool was cached (see the
1832 argument above), or as part of the error output from a failed
1836 Recover a cached pool with the
1839 .Bd -literal -offset 2n
1840 .Li # Ic zpool clear -F data
1841 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
1842 Discarded approximately 29 seconds of transactions.
1845 If the pool configuration was not cached, use
1847 with the recovery mode flag:
1848 .Bd -literal -offset 2n
1849 .Li # Ic zpool import -F data
1850 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
1851 Discarded approximately 29 seconds of transactions.
1855 The following exit values are returned:
1856 .Bl -tag -offset 2n -width 2n
1858 Successful completion.
1862 Invalid command line options were specified.
1867 This manual page is a
1869 reimplementation of the
1873 modified and customized for
1875 and licensed under the Common Development and Distribution License
1880 implementation of this manual page was initially written by
1881 .An Martin Matuska Aq mm@FreeBSD.org .