]> git.proxmox.com Git - mirror_zfs-debian.git/blame - man/man8/zpool.8
New upstream version 0.7.9
[mirror_zfs-debian.git] / man / man8 / zpool.8
CommitLineData
cae5b340
AX
1.\"
2.\" CDDL HEADER START
3.\"
4.\" The contents of this file are subject to the terms of the
5.\" Common Development and Distribution License (the "License").
6.\" You may not use this file except in compliance with the License.
7.\"
8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9.\" or http://www.opensolaris.org/os/licensing.
10.\" See the License for the specific language governing permissions
11.\" and limitations under the License.
12.\"
13.\" When distributing Covered Code, include this CDDL HEADER in each
14.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15.\" If applicable, add the following below this CDDL HEADER, with the
16.\" fields enclosed by brackets "[]" replaced with your own identifying
17.\" information: Portions Copyright [yyyy] [name of copyright owner]
18.\"
19.\" CDDL HEADER END
20.\"
21.\"
058ac9ba 22.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
ea04106b 23.\" Copyright (c) 2013 by Delphix. All rights reserved.
cae5b340 24.\" Copyright 2016 Nexenta Systems, Inc.
df831108 25.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
cae5b340 26.\" Copyright (c) 2017 Datto Inc.
42f7b73b 27.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
cae5b340 28.\" Copyright (c) 2017 Datto Inc.
9ae529ec 29.\"
42f7b73b 30.Dd April 27, 2018
cae5b340
AX
31.Dt ZPOOL 8 SMM
32.Os Linux
33.Sh NAME
34.Nm zpool
35.Nd configure ZFS storage pools
36.Sh SYNOPSIS
37.Nm
38.Fl ?
39.Nm
40.Cm add
41.Op Fl fgLnP
42.Oo Fl o Ar property Ns = Ns Ar value Oc
43.Ar pool vdev Ns ...
44.Nm
45.Cm attach
46.Op Fl f
47.Oo Fl o Ar property Ns = Ns Ar value Oc
48.Ar pool device new_device
49.Nm
50.Cm clear
51.Ar pool
52.Op Ar device
53.Nm
54.Cm create
55.Op Fl dfn
56.Op Fl m Ar mountpoint
57.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
58.Oo Fl o Ar feature@feature Ns = Ns Ar value Oc
59.Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
60.Op Fl R Ar root
61.Ar pool vdev Ns ...
62.Nm
63.Cm destroy
64.Op Fl f
65.Ar pool
66.Nm
67.Cm detach
68.Ar pool device
69.Nm
70.Cm events
71.Op Fl vHfc
72.Op Ar pool
73.Nm
74.Cm export
75.Op Fl a
76.Op Fl f
77.Ar pool Ns ...
78.Nm
79.Cm get
80.Op Fl Hp
81.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
82.Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
83.Ar pool Ns ...
84.Nm
85.Cm history
86.Op Fl il
87.Oo Ar pool Oc Ns ...
88.Nm
89.Cm import
90.Op Fl D
91.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
92.Nm
93.Cm import
94.Fl a
95.Op Fl DfmN
96.Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
97.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
98.Op Fl o Ar mntopts
99.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
100.Op Fl R Ar root
101.Nm
102.Cm import
103.Op Fl Dfm
104.Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
105.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
106.Op Fl o Ar mntopts
107.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
108.Op Fl R Ar root
109.Op Fl s
110.Ar pool Ns | Ns Ar id
111.Op Ar newpool Oo Fl t Oc
112.Nm
113.Cm iostat
114.Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
115.Op Fl T Sy u Ns | Ns Sy d
116.Op Fl ghHLpPvy
117.Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
118.Op Ar interval Op Ar count
119.Nm
120.Cm labelclear
121.Op Fl f
122.Ar device
123.Nm
124.Cm list
125.Op Fl HgLpPv
126.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
127.Op Fl T Sy u Ns | Ns Sy d
128.Oo Ar pool Oc Ns ...
129.Op Ar interval Op Ar count
130.Nm
131.Cm offline
132.Op Fl f
133.Op Fl t
134.Ar pool Ar device Ns ...
135.Nm
136.Cm online
137.Op Fl e
138.Ar pool Ar device Ns ...
139.Nm
140.Cm reguid
141.Ar pool
142.Nm
143.Cm reopen
144.Ar pool
145.Nm
146.Cm remove
147.Ar pool Ar device Ns ...
148.Nm
149.Cm replace
150.Op Fl f
151.Oo Fl o Ar property Ns = Ns Ar value Oc
152.Ar pool Ar device Op Ar new_device
153.Nm
154.Cm scrub
155.Op Fl s | Fl p
156.Ar pool Ns ...
157.Nm
158.Cm set
159.Ar property Ns = Ns Ar value
160.Ar pool
161.Nm
162.Cm split
163.Op Fl gLnP
164.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
165.Op Fl R Ar root
166.Ar pool newpool
167.Oo Ar device Oc Ns ...
168.Nm
169.Cm status
170.Oo Fl c Ar SCRIPT Oc
171.Op Fl gLPvxD
172.Op Fl T Sy u Ns | Ns Sy d
173.Oo Ar pool Oc Ns ...
174.Op Ar interval Op Ar count
175.Nm
176.Cm sync
177.Oo Ar pool Oc Ns ...
178.Nm
179.Cm upgrade
180.Nm
181.Cm upgrade
182.Fl v
183.Nm
184.Cm upgrade
185.Op Fl V Ar version
186.Fl a Ns | Ns Ar pool Ns ...
187.Sh DESCRIPTION
188The
189.Nm
190command configures ZFS storage pools.
191A storage pool is a collection of devices that provides physical storage and
192data replication for ZFS datasets.
193All datasets within a storage pool share the same space.
194See
195.Xr zfs 8
196for information on managing datasets.
197.Ss Virtual Devices (vdevs)
198A "virtual device" describes a single device or a collection of devices
199organized according to certain performance and fault characteristics.
200The following virtual devices are supported:
201.Bl -tag -width Ds
202.It Sy disk
203A block device, typically located under
204.Pa /dev .
205ZFS can use individual slices or partitions, though the recommended mode of
206operation is to use whole disks.
207A disk can be specified by a full path, or it can be a shorthand name
208.Po the relative portion of the path under
209.Pa /dev
210.Pc .
211A whole disk can be specified by omitting the slice or partition designation.
212For example,
213.Pa sda
214is equivalent to
215.Pa /dev/sda .
216When given a whole disk, ZFS automatically labels the disk, if necessary.
217.It Sy file
218A regular file.
219The use of files as a backing store is strongly discouraged.
220It is designed primarily for experimental purposes, as the fault tolerance of a
221file is only as good as the file system of which it is a part.
222A file must be specified by a full path.
223.It Sy mirror
224A mirror of two or more devices.
225Data is replicated in an identical fashion across all components of a mirror.
226A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
227failing before data integrity is compromised.
228.It Sy raidz , raidz1 , raidz2 , raidz3
229A variation on RAID-5 that allows for better distribution of parity and
230eliminates the RAID-5
231.Qq write hole
232.Pq in which data and parity become inconsistent after a power loss .
233Data and parity is striped across all disks within a raidz group.
234.Pp
235A raidz group can have single-, double-, or triple-parity, meaning that the
236raidz group can sustain one, two, or three failures, respectively, without
237losing any data.
238The
239.Sy raidz1
240vdev type specifies a single-parity raidz group; the
241.Sy raidz2
242vdev type specifies a double-parity raidz group; and the
243.Sy raidz3
244vdev type specifies a triple-parity raidz group.
245The
246.Sy raidz
247vdev type is an alias for
248.Sy raidz1 .
249.Pp
250A raidz group with N disks of size X with P parity disks can hold approximately
251(N-P)*X bytes and can withstand P device(s) failing before data integrity is
252compromised.
253The minimum number of devices in a raidz group is one more than the number of
254parity disks.
255The recommended number is between 3 and 9 to help increase performance.
256.It Sy spare
257A special pseudo-vdev which keeps track of available hot spares for a pool.
258For more information, see the
259.Sx Hot Spares
260section.
261.It Sy log
262A separate intent log device.
263If more than one log device is specified, then writes are load-balanced between
264devices.
265Log devices can be mirrored.
266However, raidz vdev types are not supported for the intent log.
267For more information, see the
268.Sx Intent Log
269section.
270.It Sy cache
271A device used to cache storage pool data.
272A cache device cannot be configured as a mirror or raidz group.
273For more information, see the
274.Sx Cache Devices
275section.
276.El
277.Pp
278Virtual devices cannot be nested, so a mirror or raidz virtual device can only
279contain files or disks.
280Mirrors of mirrors
281.Pq or other combinations
282are not allowed.
283.Pp
284A pool can have any number of virtual devices at the top of the configuration
285.Po known as
286.Qq root vdevs
287.Pc .
288Data is dynamically distributed across all top-level devices to balance data
289among devices.
290As new virtual devices are added, ZFS automatically places data on the newly
291available devices.
292.Pp
293Virtual devices are specified one at a time on the command line, separated by
294whitespace.
295The keywords
296.Sy mirror
297and
298.Sy raidz
299are used to distinguish where a group ends and another begins.
300For example, the following creates two root vdevs, each a mirror of two disks:
301.Bd -literal
302# zpool create mypool mirror sda sdb mirror sdc sdd
303.Ed
304.Ss Device Failure and Recovery
305ZFS supports a rich set of mechanisms for handling device failure and data
306corruption.
307All metadata and data is checksummed, and ZFS automatically repairs bad data
308from a good copy when corruption is detected.
309.Pp
310In order to take advantage of these features, a pool must make use of some form
311of redundancy, using either mirrored or raidz groups.
312While ZFS supports running in a non-redundant configuration, where each root
313vdev is simply a disk or file, this is strongly discouraged.
314A single case of bit corruption can render some or all of your data unavailable.
315.Pp
316A pool's health status is described by one of three states: online, degraded,
317or faulted.
318An online pool has all devices operating normally.
319A degraded pool is one in which one or more devices have failed, but the data is
320still available due to a redundant configuration.
321A faulted pool has corrupted metadata, or one or more faulted devices, and
322insufficient replicas to continue functioning.
323.Pp
324The health of the top-level vdev, such as mirror or raidz device, is
325potentially impacted by the state of its associated vdevs, or component
326devices.
327A top-level vdev or component device is in one of the following states:
328.Bl -tag -width "DEGRADED"
329.It Sy DEGRADED
330One or more top-level vdevs is in the degraded state because one or more
331component devices are offline.
332Sufficient replicas exist to continue functioning.
333.Pp
334One or more component devices is in the degraded or faulted state, but
335sufficient replicas exist to continue functioning.
336The underlying conditions are as follows:
337.Bl -bullet
338.It
339The number of checksum errors exceeds acceptable levels and the device is
340degraded as an indication that something may be wrong.
341ZFS continues to use the device as necessary.
342.It
343The number of I/O errors exceeds acceptable levels.
344The device could not be marked as faulted because there are insufficient
345replicas to continue functioning.
346.El
347.It Sy FAULTED
348One or more top-level vdevs is in the faulted state because one or more
349component devices are offline.
350Insufficient replicas exist to continue functioning.
351.Pp
352One or more component devices is in the faulted state, and insufficient
353replicas exist to continue functioning.
354The underlying conditions are as follows:
355.Bl -bullet
356.It
357The device could be opened, but the contents did not match expected values.
358.It
359The number of I/O errors exceeds acceptable levels and the device is faulted to
360prevent further use of the device.
361.El
362.It Sy OFFLINE
363The device was explicitly taken offline by the
364.Nm zpool Cm offline
365command.
366.It Sy ONLINE
058ac9ba 367The device is online and functioning.
cae5b340
AX
368.It Sy REMOVED
369The device was physically removed while the system was running.
370Device removal detection is hardware-dependent and may not be supported on all
371platforms.
372.It Sy UNAVAIL
373The device could not be opened.
374If a pool is imported when a device was unavailable, then the device will be
375identified by a unique identifier instead of its path since the path was never
376correct in the first place.
377.El
378.Pp
379If a device is removed and later re-attached to the system, ZFS attempts
380to put the device online automatically.
381Device attach detection is hardware-dependent and might not be supported on all
382platforms.
383.Ss Hot Spares
384ZFS allows devices to be associated with pools as
385.Qq hot spares .
386These devices are not actively used in the pool, but when an active device
387fails, it is automatically replaced by a hot spare.
388To create a pool with hot spares, specify a
389.Sy spare
390vdev with any number of devices.
391For example,
392.Bd -literal
54e5f226 393# zpool create pool mirror sda sdb spare sdc sdd
cae5b340
AX
394.Ed
395.Pp
396Spares can be shared across multiple pools, and can be added with the
397.Nm zpool Cm add
398command and removed with the
399.Nm zpool Cm remove
400command.
401Once a spare replacement is initiated, a new
402.Sy spare
403vdev is created within the configuration that will remain there until the
404original device is replaced.
405At this point, the hot spare becomes available again if another device fails.
406.Pp
407If a pool has a shared spare that is currently being used, the pool can not be
408exported since other pools may use this shared spare, which may lead to
409potential data corruption.
410.Pp
411An in-progress spare replacement can be canceled by detaching the hot spare.
412If the original faulted device is detached, then the hot spare assumes its
413place in the configuration, and is removed from the spare list of all active
414pools.
415.Pp
058ac9ba 416Spares cannot replace log devices.
cae5b340
AX
417.Ss Intent Log
418The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
419transactions.
420For instance, databases often require their transactions to be on stable storage
421devices when returning from a system call.
422NFS and other applications can also use
423.Xr fsync 2
424to ensure data stability.
425By default, the intent log is allocated from blocks within the main pool.
426However, it might be possible to get better performance using separate intent
427log devices such as NVRAM or a dedicated disk.
428For example:
429.Bd -literal
430# zpool create pool sda sdb log sdc
431.Ed
432.Pp
433Multiple log devices can also be specified, and they can be mirrored.
434See the
435.Sx EXAMPLES
436section for an example of mirroring multiple log devices.
437.Pp
438Log devices can be added, replaced, attached, detached, and imported and
439exported as part of the larger pool.
440Mirrored log devices can be removed by specifying the top-level mirror for the
441log.
442.Ss Cache Devices
443Devices can be added to a storage pool as
444.Qq cache devices .
445These devices provide an additional layer of caching between main memory and
446disk.
447For read-heavy workloads, where the working set size is much larger than what
448can be cached in main memory, using cache devices allow much more of this
449working set to be served from low latency media.
450Using cache devices provides the greatest performance improvement for random
451read-workloads of mostly static content.
452.Pp
453To create a pool with cache devices, specify a
454.Sy cache
455vdev with any number of devices.
456For example:
457.Bd -literal
458# zpool create pool sda sdb cache sdc sdd
459.Ed
460.Pp
461Cache devices cannot be mirrored or part of a raidz configuration.
462If a read error is encountered on a cache device, that read I/O is reissued to
463the original storage pool device, which might be part of a mirrored or raidz
464configuration.
465.Pp
466The content of the cache devices is considered volatile, as is the case with
467other system caches.
468.Ss Properties
469Each pool has several properties associated with it.
470Some properties are read-only statistics while others are configurable and
471change the behavior of the pool.
472.Pp
473The following are read-only properties:
474.Bl -tag -width Ds
475.It Sy available
476Amount of storage available within the pool.
477This property can also be referred to by its shortened column name,
478.Sy avail .
479.It Sy capacity
480Percentage of pool space used.
481This property can also be referred to by its shortened column name,
482.Sy cap .
483.It Sy expandsize
9ae529ec 484Amount of uninitialized space within the pool or device that can be used to
cae5b340
AX
485increase the total capacity of the pool.
486Uninitialized space consists of any space on an EFI labeled vdev which has not
487been brought online
488.Po e.g, using
489.Nm zpool Cm online Fl e
490.Pc .
491This space occurs when a LUN is dynamically expanded.
492.It Sy fragmentation
ea04106b 493The amount of fragmentation in the pool.
cae5b340 494.It Sy free
9ae529ec 495The amount of free space available in the pool.
cae5b340 496.It Sy freeing
9ae529ec 497After a file system or snapshot is destroyed, the space it was using is
cae5b340
AX
498returned to the pool asynchronously.
499.Sy freeing
500is the amount of space remaining to be reclaimed.
501Over time
502.Sy freeing
503will decrease while
504.Sy free
505increases.
506.It Sy health
507The current health of the pool.
508Health can be one of
509.Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
510.It Sy guid
058ac9ba 511A unique identifier for the pool.
cae5b340 512.It Sy size
058ac9ba 513Total size of the storage pool.
cae5b340
AX
514.It Sy unsupported@ Ns Em feature_guid
515Information about unsupported features that are enabled on the pool.
516See
517.Xr zpool-features 5
518for details.
519.It Sy used
058ac9ba 520Amount of storage space used within the pool.
cae5b340
AX
521.El
522.Pp
523The space usage properties report actual physical space available to the
524storage pool.
525The physical space can be different from the total amount of space that any
526contained datasets can actually use.
527The amount of space used in a raidz configuration depends on the characteristics
528of the data being written.
529In addition, ZFS reserves some space for internal accounting that the
530.Xr zfs 8
531command takes into account, but the
532.Nm
533command does not.
534For non-full pools of a reasonable size, these effects should be invisible.
535For small pools, or pools that are close to being completely full, these
536discrepancies may become more noticeable.
537.Pp
058ac9ba 538The following property can be set at creation time and import time:
cae5b340
AX
539.Bl -tag -width Ds
540.It Sy altroot
541Alternate root directory.
542If set, this directory is prepended to any mount points within the pool.
543This can be used when examining an unknown pool where the mount points cannot be
544trusted, or in an alternate boot environment, where the typical paths are not
545valid.
546.Sy altroot
547is not a persistent property.
548It is valid only while the system is up.
549Setting
550.Sy altroot
551defaults to using
552.Sy cachefile Ns = Ns Sy none ,
553though this may be overridden using an explicit setting.
554.El
555.Pp
556The following property can be set only at import time:
557.Bl -tag -width Ds
558.It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
559If set to
560.Sy on ,
561the pool will be imported in read-only mode.
562This property can also be referred to by its shortened column name,
563.Sy rdonly .
564.El
565.Pp
566The following properties can be set at creation time and import time, and later
567changed with the
568.Nm zpool Cm set
569command:
570.Bl -tag -width Ds
571.It Sy ashift Ns = Ns Sy ashift
572Pool sector size exponent, to the power of
573.Sy 2
574(internally referred to as
575.Sy ashift
576). Values from 9 to 16, inclusive, are valid; also, the special
577value 0 (the default) means to auto-detect using the kernel's block
578layer and a ZFS internal exception list. I/O operations will be aligned
579to the specified size boundaries. Additionally, the minimum (disk)
580write size will be set to the specified size, so this represents a
581space vs. performance trade-off. For optimal performance, the pool
582sector size should be greater than or equal to the sector size of the
583underlying disks. The typical case for setting this property is when
584performance is important and the underlying disks use 4KiB sectors but
585report 512B sectors to the OS (for compatibility reasons); in that
586case, set
587.Sy ashift=12
588(which is 1<<12 = 4096). When set, this property is
589used as the default hint value in subsequent vdev operations (add,
590attach and replace). Changing this value will not modify any existing
591vdev, not even on disk replacement; however it can be used, for
592instance, to replace a dying 512B sectors disk with a newer 4KiB
593sectors device: this will probably result in bad performance but at the
594same time could prevent loss of data.
595.It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
596Controls automatic pool expansion when the underlying LUN is grown.
597If set to
598.Sy on ,
599the pool will be resized according to the size of the expanded device.
600If the device is part of a mirror or raidz then all devices within that
601mirror/raidz group must be expanded before the new space is made available to
602the pool.
603The default behavior is
604.Sy off .
605This property can also be referred to by its shortened column name,
606.Sy expand .
607.It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
608Controls automatic device replacement.
609If set to
610.Sy off ,
611device replacement must be initiated by the administrator by using the
612.Nm zpool Cm replace
613command.
614If set to
615.Sy on ,
616any new device, found in the same physical location as a device that previously
617belonged to the pool, is automatically formatted and replaced.
618The default behavior is
619.Sy off .
620This property can also be referred to by its shortened column name,
621.Sy replace .
622Autoreplace can also be used with virtual disks (like device
623mapper) provided that you use the /dev/disk/by-vdev paths setup by
624vdev_id.conf. See the
625.Xr vdev_id 8
626man page for more details.
627Autoreplace and autoonline require the ZFS Event Daemon be configured and
628running. See the
629.Xr zed 8
630man page for more details.
631.It Sy bootfs Ns = Ns Sy (unset) Ns | Ns Ar pool Ns / Ns Ar dataset
632Identifies the default bootable dataset for the root pool. This property is
633expected to be set mainly by the installation and upgrade programs.
634Not all Linux distribution boot processes use the bootfs property.
635.It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
636Controls the location of where the pool configuration is cached.
637Discovering all pools on system startup requires a cached copy of the
638configuration data that is stored on the root file system.
639All pools in this cache are automatically imported when the system boots.
640Some environments, such as install and clustering, need to cache this
641information in a different location so that pools are not automatically
642imported.
643Setting this property caches the pool configuration in a different location that
644can later be imported with
645.Nm zpool Cm import Fl c .
646Setting it to the special value
647.Sy none
648creates a temporary pool that is never cached, and the special value
649.Qq
650.Pq empty string
651uses the default location.
652.Pp
653Multiple pools can share the same cache file.
654Because the kernel destroys and recreates this file when pools are added and
655removed, care should be taken when attempting to access this file.
656When the last pool using a
657.Sy cachefile
42f7b73b 658is exported or destroyed, the file will be empty.
cae5b340
AX
659.It Sy comment Ns = Ns Ar text
660A text string consisting of printable ASCII characters that will be stored
661such that it is available even if the pool becomes faulted.
662An administrator can provide additional information about a pool using this
663property.
664.It Sy dedupditto Ns = Ns Ar number
665Threshold for the number of block ditto copies.
666If the reference count for a deduplicated block increases above this number, a
667new ditto copy of this block is automatically stored.
668The default setting is
669.Sy 0
670which causes no ditto copies to be created for deduplicated blocks.
671The minimum legal nonzero setting is
672.Sy 100 .
673.It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
674Controls whether a non-privileged user is granted access based on the dataset
675permissions defined on the dataset.
676See
677.Xr zfs 8
678for more information on ZFS delegated administration.
679.It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
680Controls the system behavior in the event of catastrophic pool failure.
681This condition is typically a result of a loss of connectivity to the underlying
682storage device(s) or a failure of all devices within the pool.
683The behavior of such an event is determined as follows:
684.Bl -tag -width "continue"
685.It Sy wait
686Blocks all I/O access until the device connectivity is recovered and the errors
687are cleared.
688This is the default behavior.
689.It Sy continue
690Returns
691.Er EIO
692to any new write I/O requests but allows reads to any of the remaining healthy
693devices.
694Any write requests that have yet to be committed to disk would be blocked.
695.It Sy panic
058ac9ba 696Prints out a message to the console and generates a system crash dump.
cae5b340
AX
697.El
698.It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
699The value of this property is the current state of
700.Ar feature_name .
701The only valid value when setting this property is
702.Sy enabled
703which moves
704.Ar feature_name
705to the enabled state.
706See
707.Xr zpool-features 5
708for details on feature states.
709.It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
710Controls whether information about snapshots associated with this pool is
711output when
712.Nm zfs Cm list
713is run without the
714.Fl t
715option.
716The default value is
717.Sy off .
718This property can also be referred to by its shortened name,
719.Sy listsnaps .
720.It Sy multihost Ns = Ns Sy on Ns | Ns Sy off
721Controls whether a pool activity check should be performed during
722.Nm zpool Cm import .
723When a pool is determined to be active it cannot be imported, even with the
724.Fl f
725option. This property is intended to be used in failover configurations
726where multiple hosts have access to a pool on shared storage. When this
727property is on, periodic writes to storage occur to show the pool is in use.
728See
729.Sy zfs_multihost_interval
730in the
731.Xr zfs-module-parameters 5
732man page. In order to enable this property each host must set a unique hostid.
733See
734.Xr genhostid 1
735.Xr zgenhostid 8
42f7b73b 736.Xr spl-module-parameters 5
cae5b340
AX
737for additional details. The default value is
738.Sy off .
739.It Sy version Ns = Ns Ar version
740The current on-disk version of the pool.
741This can be increased, but never decreased.
742The preferred method of updating pools is with the
743.Nm zpool Cm upgrade
744command, though this property can be used when a specific version is needed for
745backwards compatibility.
746Once feature flags are enabled on a pool this property will no longer have a
747value.
748.El
749.Ss Subcommands
750All subcommands that modify state are logged persistently to the pool in their
751original form.
752.Pp
753The
754.Nm
755command provides subcommands to create and destroy storage pools, add capacity
756to storage pools, and provide information about the storage pools.
757The following subcommands are supported:
758.Bl -tag -width Ds
759.It Xo
760.Nm
761.Fl ?
762.Xc
058ac9ba 763Displays a help message.
cae5b340
AX
764.It Xo
765.Nm
766.Cm add
767.Op Fl fgLnP
768.Oo Fl o Ar property Ns = Ns Ar value Oc
769.Ar pool vdev Ns ...
770.Xc
771Adds the specified virtual devices to the given pool.
772The
773.Ar vdev
774specification is described in the
775.Sx Virtual Devices
776section.
777The behavior of the
778.Fl f
779option, and the device checks performed are described in the
780.Nm zpool Cm create
781subcommand.
782.Bl -tag -width Ds
783.It Fl f
784Forces use of
785.Ar vdev Ns s ,
786even if they appear in use or specify a conflicting replication level.
787Not all devices can be overridden in this manner.
788.It Fl g
789Display
790.Ar vdev ,
791GUIDs instead of the normal device names. These GUIDs can be used in place of
792device names for the zpool detach/offline/remove/replace commands.
793.It Fl L
794Display real paths for
795.Ar vdev Ns s
796resolving all symbolic links. This can be used to look up the current block
797device name regardless of the /dev/disk/ path used to open it.
798.It Fl n
799Displays the configuration that would be used without actually adding the
800.Ar vdev Ns s .
801The actual pool creation can still fail due to insufficient privileges or
802device sharing.
803.It Fl P
804Display real paths for
805.Ar vdev Ns s
806instead of only the last component of the path. This can be used in
807conjunction with the -L flag.
808.It Fl o Ar property Ns = Ns Ar value
809Sets the given pool properties. See the
810.Sx Properties
811section for a list of valid properties that can be set. The only property
812supported at the moment is ashift.
813.El
814.It Xo
815.Nm
816.Cm attach
817.Op Fl f
818.Oo Fl o Ar property Ns = Ns Ar value Oc
819.Ar pool device new_device
820.Xc
821Attaches
822.Ar new_device
823to the existing
824.Ar device .
825The existing device cannot be part of a raidz configuration.
826If
827.Ar device
828is not currently part of a mirrored configuration,
829.Ar device
830automatically transforms into a two-way mirror of
831.Ar device
832and
833.Ar new_device .
834If
835.Ar device
836is part of a two-way mirror, attaching
837.Ar new_device
838creates a three-way mirror, and so on.
839In either case,
840.Ar new_device
841begins to resilver immediately.
842.Bl -tag -width Ds
843.It Fl f
844Forces use of
845.Ar new_device ,
846even if its appears to be in use.
847Not all devices can be overridden in this manner.
848.It Fl o Ar property Ns = Ns Ar value
849Sets the given pool properties. See the
850.Sx Properties
851section for a list of valid properties that can be set. The only property
852supported at the moment is ashift.
853.El
854.It Xo
855.Nm
856.Cm clear
857.Ar pool
858.Op Ar device
859.Xc
860Clears device errors in a pool.
861If no arguments are specified, all device errors within the pool are cleared.
862If one or more devices is specified, only those errors associated with the
863specified device or devices are cleared.
864.It Xo
865.Nm
866.Cm create
867.Op Fl dfn
868.Op Fl m Ar mountpoint
869.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
870.Oo Fl o Ar feature@feature Ns = Ns Ar value Oc Ns ...
871.Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
872.Op Fl R Ar root
873.Op Fl t Ar tname
874.Ar pool vdev Ns ...
875.Xc
876Creates a new storage pool containing the virtual devices specified on the
877command line.
878The pool name must begin with a letter, and can only contain
879alphanumeric characters as well as underscore
880.Pq Qq Sy _ ,
881dash
882.Pq Qq Sy \&. ,
883colon
884.Pq Qq Sy \&: ,
885space
886.Pq Qq Sy - ,
887and period
888.Pq Qq Sy \&. .
889The pool names
890.Sy mirror ,
891.Sy raidz ,
892.Sy spare
893and
894.Sy log
895are reserved, as are names beginning with the pattern
896.Sy c[0-9] .
897The
898.Ar vdev
899specification is described in the
900.Sx Virtual Devices
901section.
902.Pp
903The command verifies that each device specified is accessible and not currently
904in use by another subsystem.
905There are some uses, such as being currently mounted, or specified as the
906dedicated dump device, that prevents a device from ever being used by ZFS.
907Other uses, such as having a preexisting UFS file system, can be overridden with
908the
909.Fl f
910option.
911.Pp
912The command also checks that the replication strategy for the pool is
913consistent.
914An attempt to combine redundant and non-redundant storage in a single pool, or
915to mix disks and files, results in an error unless
916.Fl f
917is specified.
918The use of differently sized devices within a single raidz or mirror group is
919also flagged as an error unless
920.Fl f
921is specified.
922.Pp
923Unless the
924.Fl R
925option is specified, the default mount point is
926.Pa / Ns Ar pool .
927The mount point must not exist or must be empty, or else the root dataset
928cannot be mounted.
929This can be overridden with the
930.Fl m
931option.
932.Pp
933By default all supported features are enabled on the new pool unless the
934.Fl d
935option is specified.
936.Bl -tag -width Ds
937.It Fl d
938Do not enable any features on the new pool.
939Individual features can be enabled by setting their corresponding properties to
940.Sy enabled
941with the
942.Fl o
943option.
944See
945.Xr zpool-features 5
946for details about feature properties.
947.It Fl f
948Forces use of
949.Ar vdev Ns s ,
950even if they appear in use or specify a conflicting replication level.
951Not all devices can be overridden in this manner.
952.It Fl m Ar mountpoint
953Sets the mount point for the root dataset.
954The default mount point is
955.Pa /pool
956or
957.Pa altroot/pool
958if
959.Ar altroot
960is specified.
961The mount point must be an absolute path,
962.Sy legacy ,
963or
964.Sy none .
965For more information on dataset mount points, see
966.Xr zfs 8 .
967.It Fl n
968Displays the configuration that would be used without actually creating the
969pool.
970The actual pool creation can still fail due to insufficient privileges or
971device sharing.
972.It Fl o Ar property Ns = Ns Ar value
973Sets the given pool properties.
974See the
975.Sx Properties
976section for a list of valid properties that can be set.
977.It Fl o Ar feature@feature Ns = Ns Ar value
978Sets the given pool feature. See the
979.Xr zpool-features 5
980section for a list of valid features that can be set.
981Value can be either disabled or enabled.
982.It Fl O Ar file-system-property Ns = Ns Ar value
983Sets the given file system properties in the root file system of the pool.
984See the
985.Sx Properties
986section of
987.Xr zfs 8
988for a list of valid properties that can be set.
989.It Fl R Ar root
990Equivalent to
991.Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
992.It Fl t Ar tname
993Sets the in-core pool name to
994.Sy tname
995while the on-disk name will be the name specified as the pool name
996.Sy pool .
997This will set the default cachefile property to none. This is intended
998to handle name space collisions when creating pools for other systems,
999such as virtual machines or physical machines whose pools live on network
1000block devices.
1001.El
1002.It Xo
1003.Nm
1004.Cm destroy
1005.Op Fl f
1006.Ar pool
1007.Xc
1008Destroys the given pool, freeing up any devices for other use.
1009This command tries to unmount any active datasets before destroying the pool.
1010.Bl -tag -width Ds
1011.It Fl f
058ac9ba 1012Forces any active datasets contained within the pool to be unmounted.
cae5b340
AX
1013.El
1014.It Xo
1015.Nm
1016.Cm detach
1017.Ar pool device
1018.Xc
1019Detaches
1020.Ar device
1021from a mirror.
1022The operation is refused if there are no other valid replicas of the data.
1023If device may be re-added to the pool later on then consider the
1024.Sy zpool offline
1025command instead.
1026.It Xo
1027.Nm
1028.Cm events
1029.Op Fl cfHv
1030.Op Ar pool Ns ...
1031.Xc
1032Lists all recent events generated by the ZFS kernel modules. These events
1033are consumed by the
1034.Xr zed 8
1035and used to automate administrative tasks such as replacing a failed device
1036with a hot spare. For more information about the subclasses and event payloads
1037that can be generated see the
1038.Xr zfs-events 5
1039man page.
1040.Bl -tag -width Ds
1041.It Fl c
e10b0808 1042Clear all previous events.
cae5b340
AX
1043.It Fl f
1044Follow mode.
1045.It Fl H
1046Scripted mode. Do not display headers, and separate fields by a
1047single tab instead of arbitrary space.
1048.It Fl v
1049Print the entire payload for each event.
1050.El
1051.It Xo
1052.Nm
1053.Cm export
1054.Op Fl a
1055.Op Fl f
1056.Ar pool Ns ...
1057.Xc
1058Exports the given pools from the system.
1059All devices are marked as exported, but are still considered in use by other
1060subsystems.
1061The devices can be moved between systems
1062.Pq even those of different endianness
1063and imported as long as a sufficient number of devices are present.
1064.Pp
1065Before exporting the pool, all datasets within the pool are unmounted.
1066A pool can not be exported if it has a shared spare that is currently being
1067used.
1068.Pp
1069For pools to be portable, you must give the
1070.Nm
1071command whole disks, not just partitions, so that ZFS can label the disks with
1072portable EFI labels.
1073Otherwise, disk drivers on platforms of different endianness will not recognize
1074the disks.
1075.Bl -tag -width Ds
1076.It Fl a
e10b0808 1077Exports all pools imported on the system.
cae5b340
AX
1078.It Fl f
1079Forcefully unmount all datasets, using the
1080.Nm unmount Fl f
1081command.
1082.Pp
1083This command will forcefully export the pool even if it has a shared spare that
1084is currently being used.
1085This may lead to potential data corruption.
1086.El
1087.It Xo
1088.Nm
1089.Cm get
1090.Op Fl Hp
1091.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1092.Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1093.Ar pool Ns ...
1094.Xc
1095Retrieves the given list of properties
1096.Po
1097or all properties if
1098.Sy all
1099is used
1100.Pc
1101for the specified storage pool(s).
1102These properties are displayed with the following fields:
1103.Bd -literal
1104 name Name of storage pool
058ac9ba
BB
1105 property Property name
1106 value Property value
1107 source Property source, either 'default' or 'local'.
cae5b340
AX
1108.Ed
1109.Pp
1110See the
1111.Sx Properties
1112section for more information on the available pool properties.
1113.Bl -tag -width Ds
1114.It Fl H
1115Scripted mode.
1116Do not display headers, and separate fields by a single tab instead of arbitrary
1117space.
1118.It Fl o Ar field
1119A comma-separated list of columns to display.
1120.Sy name Ns , Ns Sy property Ns , Ns Sy value Ns , Ns Sy source
1121is the default value.
1122.It Fl p
1123Display numbers in parsable (exact) values.
1124.El
1125.It Xo
1126.Nm
1127.Cm history
1128.Op Fl il
1129.Oo Ar pool Oc Ns ...
1130.Xc
1131Displays the command history of the specified pool(s) or all pools if no pool is
1132specified.
1133.Bl -tag -width Ds
1134.It Fl i
1135Displays internally logged ZFS events in addition to user initiated events.
1136.It Fl l
1137Displays log records in long format, which in addition to standard format
1138includes, the user name, the hostname, and the zone in which the operation was
1139performed.
1140.El
1141.It Xo
1142.Nm
1143.Cm import
1144.Op Fl D
1145.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1146.Xc
1147Lists pools available to import.
1148If the
1149.Fl d
1150option is not specified, this command searches for devices in
1151.Pa /dev .
1152The
1153.Fl d
1154option can be specified multiple times, and all directories are searched.
1155If the device appears to be part of an exported pool, this command displays a
1156summary of the pool with the name of the pool, a numeric identifier, as well as
1157the vdev layout and current health of the device for each device or file.
1158Destroyed pools, pools that were previously destroyed with the
1159.Nm zpool Cm destroy
1160command, are not listed unless the
1161.Fl D
1162option is specified.
1163.Pp
1164The numeric identifier is unique, and can be used instead of the pool name when
1165multiple exported pools of the same name are available.
1166.Bl -tag -width Ds
1167.It Fl c Ar cachefile
1168Reads configuration from the given
1169.Ar cachefile
1170that was created with the
1171.Sy cachefile
1172pool property.
1173This
1174.Ar cachefile
1175is used instead of searching for devices.
1176.It Fl d Ar dir
1177Searches for devices or files in
1178.Ar dir .
1179The
1180.Fl d
1181option can be specified multiple times.
1182.It Fl D
058ac9ba 1183Lists destroyed pools only.
cae5b340
AX
1184.El
1185.It Xo
1186.Nm
1187.Cm import
1188.Fl a
1189.Op Fl DfmN
1190.Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
1191.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1192.Op Fl o Ar mntopts
1193.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1194.Op Fl R Ar root
1195.Op Fl s
1196.Xc
1197Imports all pools found in the search directories.
1198Identical to the previous command, except that all pools with a sufficient
1199number of devices available are imported.
1200Destroyed pools, pools that were previously destroyed with the
1201.Nm zpool Cm destroy
1202command, will not be imported unless the
1203.Fl D
1204option is specified.
1205.Bl -tag -width Ds
1206.It Fl a
1207Searches for and imports all pools found.
1208.It Fl c Ar cachefile
1209Reads configuration from the given
1210.Ar cachefile
1211that was created with the
1212.Sy cachefile
1213pool property.
1214This
1215.Ar cachefile
1216is used instead of searching for devices.
1217.It Fl d Ar dir
1218Searches for devices or files in
1219.Ar dir .
1220The
1221.Fl d
1222option can be specified multiple times.
1223This option is incompatible with the
1224.Fl c
1225option.
1226.It Fl D
1227Imports destroyed pools only.
1228The
1229.Fl f
1230option is also required.
1231.It Fl f
058ac9ba 1232Forces import, even if the pool appears to be potentially active.
cae5b340
AX
1233.It Fl F
1234Recovery mode for a non-importable pool.
1235Attempt to return the pool to an importable state by discarding the last few
1236transactions.
1237Not all damaged pools can be recovered by using this option.
1238If successful, the data from the discarded transactions is irretrievably lost.
1239This option is ignored if the pool is importable or already imported.
1240.It Fl m
7f9d9946 1241Allows a pool to import when there is a missing log device.
cae5b340
AX
1242Recent transactions can be lost because the log device will be discarded.
1243.It Fl n
1244Used with the
1245.Fl F
1246recovery option.
1247Determines whether a non-importable pool can be made importable again, but does
1248not actually perform the pool recovery.
1249For more details about pool recovery mode, see the
1250.Fl F
1251option, above.
1252.It Fl N
7f9d9946 1253Import the pool without mounting any file systems.
cae5b340
AX
1254.It Fl o Ar mntopts
1255Comma-separated list of mount options to use when mounting datasets within the
1256pool.
1257See
1258.Xr zfs 8
1259for a description of dataset properties and mount options.
1260.It Fl o Ar property Ns = Ns Ar value
1261Sets the specified property on the imported pool.
1262See the
1263.Sx Properties
1264section for more information on the available pool properties.
1265.It Fl R Ar root
1266Sets the
1267.Sy cachefile
1268property to
1269.Sy none
1270and the
1271.Sy altroot
1272property to
1273.Ar root .
1274.It Fl s
1275Scan using the default search path, the libblkid cache will not be
1276consulted. A custom search path may be specified by setting the
1277ZPOOL_IMPORT_PATH environment variable.
1278.It Fl X
1279Used with the
1280.Fl F
1281recovery option. Determines whether extreme
1282measures to find a valid txg should take place. This allows the pool to
1283be rolled back to a txg which is no longer guaranteed to be consistent.
1284Pools imported at an inconsistent txg may contain uncorrectable
1285checksum errors. For more details about pool recovery mode, see the
1286.Fl F
1287option, above. WARNING: This option can be extremely hazardous to the
1288health of your pool and should only be used as a last resort.
1289.It Fl T
1290Specify the txg to use for rollback. Implies
1291.Fl FX .
1292For more details
1293about pool recovery mode, see the
1294.Fl X
1295option, above. WARNING: This option can be extremely hazardous to the
1296health of your pool and should only be used as a last resort.
1297.El
1298.It Xo
1299.Nm
1300.Cm import
1301.Op Fl Dfm
1302.Op Fl F Oo Fl n Oc Oo Fl t Oc Oo Fl T Oc Oo Fl X Oc
1303.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1304.Op Fl o Ar mntopts
1305.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1306.Op Fl R Ar root
1307.Op Fl s
1308.Ar pool Ns | Ns Ar id
1309.Op Ar newpool
1310.Xc
1311Imports a specific pool.
1312A pool can be identified by its name or the numeric identifier.
1313If
1314.Ar newpool
1315is specified, the pool is imported using the name
1316.Ar newpool .
1317Otherwise, it is imported with the same name as its exported name.
1318.Pp
1319If a device is removed from a system without running
1320.Nm zpool Cm export
1321first, the device appears as potentially active.
1322It cannot be determined if this was a failed export, or whether the device is
1323really in use from another host.
1324To import a pool in this state, the
1325.Fl f
1326option is required.
1327.Bl -tag -width Ds
1328.It Fl c Ar cachefile
1329Reads configuration from the given
1330.Ar cachefile
1331that was created with the
1332.Sy cachefile
1333pool property.
1334This
1335.Ar cachefile
1336is used instead of searching for devices.
1337.It Fl d Ar dir
1338Searches for devices or files in
1339.Ar dir .
1340The
1341.Fl d
1342option can be specified multiple times.
1343This option is incompatible with the
1344.Fl c
1345option.
1346.It Fl D
1347Imports destroyed pool.
1348The
1349.Fl f
1350option is also required.
1351.It Fl f
058ac9ba 1352Forces import, even if the pool appears to be potentially active.
cae5b340
AX
1353.It Fl F
1354Recovery mode for a non-importable pool.
1355Attempt to return the pool to an importable state by discarding the last few
1356transactions.
1357Not all damaged pools can be recovered by using this option.
1358If successful, the data from the discarded transactions is irretrievably lost.
1359This option is ignored if the pool is importable or already imported.
1360.It Fl m
7f9d9946 1361Allows a pool to import when there is a missing log device.
cae5b340
AX
1362Recent transactions can be lost because the log device will be discarded.
1363.It Fl n
1364Used with the
1365.Fl F
1366recovery option.
1367Determines whether a non-importable pool can be made importable again, but does
1368not actually perform the pool recovery.
1369For more details about pool recovery mode, see the
1370.Fl F
1371option, above.
1372.It Fl o Ar mntopts
1373Comma-separated list of mount options to use when mounting datasets within the
1374pool.
1375See
1376.Xr zfs 8
1377for a description of dataset properties and mount options.
1378.It Fl o Ar property Ns = Ns Ar value
1379Sets the specified property on the imported pool.
1380See the
1381.Sx Properties
1382section for more information on the available pool properties.
1383.It Fl R Ar root
1384Sets the
1385.Sy cachefile
1386property to
1387.Sy none
1388and the
1389.Sy altroot
1390property to
1391.Ar root .
1392.It Fl s
1393Scan using the default search path, the libblkid cache will not be
1394consulted. A custom search path may be specified by setting the
1395ZPOOL_IMPORT_PATH environment variable.
1396.It Fl X
1397Used with the
1398.Fl F
1399recovery option. Determines whether extreme
1400measures to find a valid txg should take place. This allows the pool to
1401be rolled back to a txg which is no longer guaranteed to be consistent.
1402Pools imported at an inconsistent txg may contain uncorrectable
1403checksum errors. For more details about pool recovery mode, see the
1404.Fl F
1405option, above. WARNING: This option can be extremely hazardous to the
1406health of your pool and should only be used as a last resort.
1407.It Fl T
1408Specify the txg to use for rollback. Implies
1409.Fl FX .
1410For more details
1411about pool recovery mode, see the
1412.Fl X
1413option, above. WARNING: This option can be extremely hazardous to the
1414health of your pool and should only be used as a last resort.
41d74433 1415.It Fl t
cae5b340
AX
1416Used with
1417.Sy newpool .
1418Specifies that
1419.Sy newpool
1420is temporary. Temporary pool names last until export. Ensures that
1421the original pool name will be used in all label updates and therefore
1422is retained upon export.
1423Will also set -o cachefile=none when not explicitly specified.
1424.El
1425.It Xo
1426.Nm
1427.Cm iostat
1428.Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
1429.Op Fl T Sy u Ns | Ns Sy d
1430.Op Fl ghHLpPvy
1431.Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
1432.Op Ar interval Op Ar count
1433.Xc
1434Displays I/O statistics for the given pools/vdevs. You can pass in a
1435list of pools, a pool and list of vdevs in that pool, or a list of any
1436vdevs from any pool. If no items are specified, statistics for every
1437pool in the system are shown.
1438When given an
1439.Ar interval ,
1440the statistics are printed every
1441.Ar interval
1442seconds until ^C is pressed. If count is specified, the command exits
1443after count reports are printed. The first report printed is always
1444the statistics since boot regardless of whether
1445.Ar interval
1446and
1447.Ar count
1448are passed. However, this behavior can be suppressed with the
1449.Fl y
1450flag. Also note that the units of
1451.Sy K ,
1452.Sy M ,
1453.Sy G ...
1454that are printed in the report are in base 1024. To get the raw
1455values, use the
1456.Fl p
1457flag.
1458.Bl -tag -width Ds
1459.It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1460Run a script (or scripts) on each vdev and include the output as a new column
1461in the
1462.Nm zpool Cm iostat
1463output. Users can run any script found in their
1464.Pa ~/.zpool.d
1465directory or from the system
1466.Pa /etc/zfs/zpool.d
1467directory. Script names containing the slash (/) character are not allowed.
1468The default search path can be overridden by setting the
1469ZPOOL_SCRIPTS_PATH environment variable. A privileged user can run
1470.Fl c
1471if they have the ZPOOL_SCRIPTS_AS_ROOT
1472environment variable set. If a script requires the use of a privileged
1473command, like
1474.Xr smartctl 8 ,
1475then it's recommended you allow the user access to it in
1476.Pa /etc/sudoers
1477or add the user to the
1478.Pa /etc/sudoers.d/zfs
1479file.
1480.Pp
1481If
1482.Fl c
1483is passed without a script name, it prints a list of all scripts.
1484.Fl c
1485also sets verbose mode
1486.No ( Ns Fl v Ns No ).
1487.Pp
1488Script output should be in the form of "name=value". The column name is
1489set to "name" and the value is set to "value". Multiple lines can be
1490used to output multiple columns. The first line of output not in the
1491"name=value" format is displayed without a column title, and no more
1492output after that is displayed. This can be useful for printing error
1493messages. Blank or NULL values are printed as a '-' to make output
1494awk-able.
1495.Pp
1496The following environment variables are set before running each script:
1497.Pp
1498.Bl -tag -width "VDEV_PATH"
1499.It Sy VDEV_PATH
1500Full path to the vdev
1501.El
1502.Bl -tag -width "VDEV_UPATH"
1503.It Sy VDEV_UPATH
1504Underlying path to the vdev (/dev/sd*). For use with device mapper,
1505multipath, or partitioned vdevs.
1506.El
1507.Bl -tag -width "VDEV_ENC_SYSFS_PATH"
1508.It Sy VDEV_ENC_SYSFS_PATH
1509The sysfs path to the enclosure for the vdev (if any).
1510.El
1511.It Fl T Sy u Ns | Ns Sy d
058ac9ba 1512Display a time stamp.
cae5b340
AX
1513Specify
1514.Sy u
1515for a printed representation of the internal representation of time.
1516See
1517.Xr time 2 .
1518Specify
1519.Sy d
1520for standard date format.
1521See
1522.Xr date 1 .
1523.It Fl g
1524Display vdev GUIDs instead of the normal device names. These GUIDs
1525can be used in place of device names for the zpool
1526detach/offline/remove/replace commands.
1527.It Fl H
1528Scripted mode. Do not display headers, and separate fields by a
1529single tab instead of arbitrary space.
1530.It Fl L
1531Display real paths for vdevs resolving all symbolic links. This can
1532be used to look up the current block device name regardless of the
1533.Pa /dev/disk/
1534path used to open it.
1535.It Fl p
1536Display numbers in parsable (exact) values. Time values are in
1537nanoseconds.
1538.It Fl P
1539Display full paths for vdevs instead of only the last component of
1540the path. This can be used in conjunction with the
1541.Fl L
1542flag.
1543.It Fl r
1544Print request size histograms for the leaf ZIOs. This includes
1545histograms of individual ZIOs (
1546.Ar ind )
1547and aggregate ZIOs (
1548.Ar agg ).
1549These stats can be useful for seeing how well the ZFS IO aggregator is
1550working. Do not confuse these request size stats with the block layer
1551requests; it's possible ZIOs can be broken up before being sent to the
1552block device.
1553.It Fl v
1554Verbose statistics Reports usage statistics for individual vdevs within the
1555pool, in addition to the pool-wide statistics.
1556.It Fl y
42f7b73b
AX
1557Omit statistics since boot.
1558Normally the first line of output reports the statistics since boot.
1559This option suppresses that first line of output.
cae5b340 1560.It Fl w
42f7b73b
AX
1561Display latency histograms:
1562.Pp
1563.Ar total_wait :
1564Total IO time (queuing + disk IO time).
1565.Ar disk_wait :
1566Disk IO time (time reading/writing the disk).
1567.Ar syncq_wait :
1568Amount of time IO spent in synchronous priority queues. Does not include
1569disk time.
1570.Ar asyncq_wait :
1571Amount of time IO spent in asynchronous priority queues. Does not include
1572disk time.
1573.Ar scrub :
1574Amount of time IO spent in scrub queue. Does not include disk time.
cae5b340
AX
1575.It Fl l
1576Include average latency statistics:
1577.Pp
1578.Ar total_wait :
1579Average total IO time (queuing + disk IO time).
1580.Ar disk_wait :
1581Average disk IO time (time reading/writing the disk).
1582.Ar syncq_wait :
1583Average amount of time IO spent in synchronous priority queues. Does
1584not include disk time.
1585.Ar asyncq_wait :
1586Average amount of time IO spent in asynchronous priority queues.
1587Does not include disk time.
1588.Ar scrub :
1589Average queuing time in scrub queue. Does not include disk time.
1590.It Fl q
1591Include active queue statistics. Each priority queue has both
1592pending (
1593.Ar pend )
1594and active (
1595.Ar activ )
1596IOs. Pending IOs are waiting to
1597be issued to the disk, and active IOs have been issued to disk and are
1598waiting for completion. These stats are broken out by priority queue:
1599.Pp
1600.Ar syncq_read/write :
1601Current number of entries in synchronous priority
1602queues.
1603.Ar asyncq_read/write :
1604Current number of entries in asynchronous priority queues.
1605.Ar scrubq_read :
1606Current number of entries in scrub queue.
1607.Pp
1608All queue statistics are instantaneous measurements of the number of
1609entries in the queues. If you specify an interval, the measurements
1610will be sampled from the end of the interval.
1611.El
1612.It Xo
1613.Nm
1614.Cm labelclear
1615.Op Fl f
1616.Ar device
1617.Xc
1618Removes ZFS label information from the specified
1619.Ar device .
1620The
1621.Ar device
1622must not be part of an active pool configuration.
1623.Bl -tag -width Ds
1624.It Fl f
c06d4368 1625Treat exported or foreign devices as inactive.
cae5b340
AX
1626.El
1627.It Xo
1628.Nm
1629.Cm list
1630.Op Fl HgLpPv
1631.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1632.Op Fl T Sy u Ns | Ns Sy d
1633.Oo Ar pool Oc Ns ...
1634.Op Ar interval Op Ar count
1635.Xc
1636Lists the given pools along with a health status and space usage.
1637If no
1638.Ar pool Ns s
1639are specified, all pools in the system are listed.
1640When given an
1641.Ar interval ,
1642the information is printed every
1643.Ar interval
1644seconds until ^C is pressed.
1645If
1646.Ar count
1647is specified, the command exits after
1648.Ar count
1649reports are printed.
1650.Bl -tag -width Ds
1651.It Fl g
1652Display vdev GUIDs instead of the normal device names. These GUIDs
1653can be used in place of device names for the zpool
1654detach/offline/remove/replace commands.
1655.It Fl H
1656Scripted mode.
1657Do not display headers, and separate fields by a single tab instead of arbitrary
1658space.
1659.It Fl o Ar property
1660Comma-separated list of properties to display.
1661See the
1662.Sx Properties
1663section for a list of valid properties.
1664The default list is
1665.Sy name, size, alloc, free, fragmentation, expandsize, capacity,
1666.Sy dedupratio, health, altroot .
1667.It Fl L
1668Display real paths for vdevs resolving all symbolic links. This can
1669be used to look up the current block device name regardless of the
1670/dev/disk/ path used to open it.
1671.It Fl p
1672Display numbers in parsable
1673.Pq exact
1674values.
1675.It Fl P
1676Display full paths for vdevs instead of only the last component of
1677the path. This can be used in conjunction with the
1678.Fl L flag.
1679.It Fl T Sy u Ns | Ns Sy d
c06d4368 1680Display a time stamp.
cae5b340
AX
1681Specify
1682.Fl u
1683for a printed representation of the internal representation of time.
1684See
1685.Xr time 2 .
1686Specify
1687.Fl d
1688for standard date format.
1689See
1690.Xr date 1 .
1691.It Fl v
1692Verbose statistics.
1693Reports usage statistics for individual vdevs within the pool, in addition to
1694the pool-wise statistics.
1695.El
1696.It Xo
1697.Nm
1698.Cm offline
1699.Op Fl f
1700.Op Fl t
1701.Ar pool Ar device Ns ...
1702.Xc
1703Takes the specified physical device offline.
1704While the
1705.Ar device
1706is offline, no attempt is made to read or write to the device.
1707This command is not applicable to spares.
1708.Bl -tag -width Ds
1709.It Fl f
1710Force fault. Instead of offlining the disk, put it into a faulted
1711state. The fault will persist across imports unless the
1712.Fl t
1713flag was specified.
1714.It Fl t
1715Temporary.
1716Upon reboot, the specified physical device reverts to its previous state.
1717.El
1718.It Xo
1719.Nm
1720.Cm online
1721.Op Fl e
1722.Ar pool Ar device Ns ...
1723.Xc
058ac9ba 1724Brings the specified physical device online.
058ac9ba 1725This command is not applicable to spares or cache devices.
cae5b340
AX
1726.Bl -tag -width Ds
1727.It Fl e
1728Expand the device to use all available space.
1729If the device is part of a mirror or raidz then all devices must be expanded
1730before the new space will become available to the pool.
1731.El
1732.It Xo
1733.Nm
1734.Cm reguid
1735.Ar pool
1736.Xc
1737Generates a new unique identifier for the pool.
1738You must ensure that all devices in this pool are online and healthy before
1739performing this action.
1740.It Xo
1741.Nm
1742.Cm reopen
1743.Ar pool
1744.Xc
c06d4368 1745Reopen all the vdevs associated with the pool.
cae5b340
AX
1746.It Xo
1747.Nm
1748.Cm remove
1749.Ar pool Ar device Ns ...
1750.Xc
1751Removes the specified device from the pool.
1752This command currently only supports removing hot spares, cache, and log
1753devices.
1754A mirrored log device can be removed by specifying the top-level mirror for the
1755log.
1756Non-log devices that are part of a mirrored configuration can be removed using
1757the
1758.Nm zpool Cm detach
1759command.
1760Non-redundant and raidz devices cannot be removed from a pool.
1761.It Xo
1762.Nm
1763.Cm replace
1764.Op Fl f
1765.Op Fl o Ar property Ns = Ns Ar value
1766.Ar pool Ar device Op Ar new_device
1767.Xc
1768Replaces
1769.Ar old_device
1770with
1771.Ar new_device .
1772This is equivalent to attaching
1773.Ar new_device ,
1774waiting for it to resilver, and then detaching
1775.Ar old_device .
1776.Pp
1777The size of
1778.Ar new_device
1779must be greater than or equal to the minimum size of all the devices in a mirror
1780or raidz configuration.
1781.Pp
1782.Ar new_device
1783is required if the pool is not redundant.
1784If
1785.Ar new_device
1786is not specified, it defaults to
1787.Ar old_device .
1788This form of replacement is useful after an existing disk has failed and has
1789been physically replaced.
1790In this case, the new disk may have the same
1791.Pa /dev
1792path as the old device, even though it is actually a different disk.
1793ZFS recognizes this.
1794.Bl -tag -width Ds
1795.It Fl f
1796Forces use of
1797.Ar new_device ,
1798even if its appears to be in use.
1799Not all devices can be overridden in this manner.
1800.It Fl o Ar property Ns = Ns Ar value
1801Sets the given pool properties. See the
1802.Sx Properties
1803section for a list of valid properties that can be set.
1804The only property supported at the moment is
1805.Sy ashift .
1806.El
1807.It Xo
1808.Nm
1809.Cm scrub
1810.Op Fl s | Fl p
1811.Ar pool Ns ...
1812.Xc
1813Begins a scrub or resumes a paused scrub.
1814The scrub examines all data in the specified pools to verify that it checksums
1815correctly.
1816For replicated
1817.Pq mirror or raidz
1818devices, ZFS automatically repairs any damage discovered during the scrub.
1819The
1820.Nm zpool Cm status
1821command reports the progress of the scrub and summarizes the results of the
1822scrub upon completion.
1823.Pp
1824Scrubbing and resilvering are very similar operations.
1825The difference is that resilvering only examines data that ZFS knows to be out
1826of date
1827.Po
1828for example, when attaching a new device to a mirror or replacing an existing
1829device
1830.Pc ,
1831whereas scrubbing examines all data to discover silent errors due to hardware
1832faults or disk failure.
1833.Pp
1834Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1835one at a time.
1836If a scrub is paused, the
1837.Nm zpool Cm scrub
1838resumes it.
1839If a resilver is in progress, ZFS does not allow a scrub to be started until the
1840resilver completes.
1841.Bl -tag -width Ds
1842.It Fl s
058ac9ba 1843Stop scrubbing.
cae5b340
AX
1844.El
1845.Bl -tag -width Ds
1846.It Fl p
1847Pause scrubbing.
1848Scrub progress is periodically synced to disk so if the system
1849is restarted or pool is exported during a paused scrub, the scrub will resume
1850from the place where it was last checkpointed to disk.
1851To resume a paused scrub issue
1852.Nm zpool Cm scrub
1853again.
1854.El
1855.It Xo
1856.Nm
1857.Cm set
1858.Ar property Ns = Ns Ar value
1859.Ar pool
1860.Xc
1861Sets the given property on the specified pool.
1862See the
1863.Sx Properties
1864section for more information on what properties can be set and acceptable
1865values.
1866.It Xo
1867.Nm
1868.Cm split
1869.Op Fl gLnP
1870.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1871.Op Fl R Ar root
1872.Ar pool newpool
1873.Op Ar device ...
1874.Xc
1875Splits devices off
1876.Ar pool
1877creating
1878.Ar newpool .
1879All vdevs in
1880.Ar pool
1881must be mirrors and the pool must not be in the process of resilvering.
1882At the time of the split,
1883.Ar newpool
1884will be a replica of
1885.Ar pool .
1886By default, the
1887last device in each mirror is split from
1888.Ar pool
1889to create
1890.Ar newpool .
1891.Pp
1892The optional device specification causes the specified device(s) to be
1893included in the new
1894.Ar pool
1895and, should any devices remain unspecified,
1896the last device in each mirror is used as would be by default.
1897.Bl -tag -width Ds
1898.It Fl g
1899Display vdev GUIDs instead of the normal device names. These GUIDs
1900can be used in place of device names for the zpool
1901detach/offline/remove/replace commands.
1902.It Fl L
1903Display real paths for vdevs resolving all symbolic links. This can
1904be used to look up the current block device name regardless of the
1905.Pa /dev/disk/
1906path used to open it.
1907.It Fl n
1908Do dry run, do not actually perform the split.
1909Print out the expected configuration of
1910.Ar newpool .
1911.It Fl P
1912Display full paths for vdevs instead of only the last component of
1913the path. This can be used in conjunction with the
1914.Fl L flag.
1915.It Fl o Ar property Ns = Ns Ar value
1916Sets the specified property for
1917.Ar newpool .
1918See the
1919.Sx Properties
1920section for more information on the available pool properties.
1921.It Fl R Ar root
1922Set
1923.Sy altroot
1924for
1925.Ar newpool
1926to
1927.Ar root
1928and automatically import it.
1929.El
1930.It Xo
1931.Nm
1932.Cm status
1933.Op Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1934.Op Fl gLPvxD
1935.Op Fl T Sy u Ns | Ns Sy d
1936.Oo Ar pool Oc Ns ...
1937.Op Ar interval Op Ar count
1938.Xc
1939Displays the detailed health status for the given pools.
1940If no
1941.Ar pool
1942is specified, then the status of each pool in the system is displayed.
1943For more information on pool and device health, see the
1944.Sx Device Failure and Recovery
1945section.
1946.Pp
1947If a scrub or resilver is in progress, this command reports the percentage done
1948and the estimated time to completion.
1949Both of these are only approximate, because the amount of data in the pool and
1950the other workloads on the system can change.
1951.Bl -tag -width Ds
1952.It Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns ...
1953Run a script (or scripts) on each vdev and include the output as a new column
1954in the
1955.Nm zpool Cm status
1956output. See the
1957.Fl c
1958option of
1959.Nm zpool Cm iostat
1960for complete details.
1961.It Fl g
1962Display vdev GUIDs instead of the normal device names. These GUIDs
1963can be used in place of device names for the zpool
1964detach/offline/remove/replace commands.
1965.It Fl L
1966Display real paths for vdevs resolving all symbolic links. This can
1967be used to look up the current block device name regardless of the
1968.Pa /dev/disk/
1969path used to open it.
41d74433
AX
1970.It Fl P
1971Display full paths for vdevs instead of only the last component of
1972the path. This can be used in conjunction with the
1973.Fl L flag.
cae5b340
AX
1974.It Fl D
1975Display a histogram of deduplication statistics, showing the allocated
1976.Pq physically present on disk
1977and referenced
1978.Pq logically referenced in the pool
1979block counts and sizes by reference count.
1980.It Fl T Sy u Ns | Ns Sy d
a08ee875 1981Display a time stamp.
cae5b340
AX
1982Specify
1983.Fl u
1984for a printed representation of the internal representation of time.
1985See
1986.Xr time 2 .
1987Specify
1988.Fl d
1989for standard date format.
1990See
1991.Xr date 1 .
1992.It Fl v
1993Displays verbose data error information, printing out a complete list of all
1994data errors since the last complete pool scrub.
1995.It Fl x
1996Only display status for pools that are exhibiting errors or are otherwise
1997unavailable.
1998Warnings about pools not using the latest on-disk format will not be included.
1999.El
2000.It Xo
2001.Nm
2002.Cm sync
2003.Op Ar pool ...
2004.Xc
2005This command forces all in-core dirty data to be written to the primary
2006pool storage and not the ZIL. It will also update administrative
2007information including quota reporting. Without arguments,
2008.Sy zpool sync
2009will sync all pools on the system. Otherwise, it will sync only the
2010specified pool(s).
2011.It Xo
2012.Nm
2013.Cm upgrade
2014.Xc
2015Displays pools which do not have all supported features enabled and pools
2016formatted using a legacy ZFS version number.
2017These pools can continue to be used, but some features may not be available.
2018Use
2019.Nm zpool Cm upgrade Fl a
2020to enable all features on all pools.
2021.It Xo
2022.Nm
2023.Cm upgrade
2024.Fl v
2025.Xc
2026Displays legacy ZFS versions supported by the current software.
2027See
2028.Xr zpool-features 5
2029for a description of feature flags features supported by the current software.
2030.It Xo
2031.Nm
2032.Cm upgrade
2033.Op Fl V Ar version
2034.Fl a Ns | Ns Ar pool Ns ...
2035.Xc
2036Enables all supported features on the given pool.
2037Once this is done, the pool will no longer be accessible on systems that do not
2038support feature flags.
2039See
2040.Xr zfs-features 5
2041for details on compatibility with systems that support feature flags, but do not
2042support all features enabled on the pool.
2043.Bl -tag -width Ds
2044.It Fl a
b9b24bb4 2045Enables all supported features on all pools.
cae5b340
AX
2046.It Fl V Ar version
2047Upgrade to the specified legacy version.
2048If the
2049.Fl V
2050flag is specified, no features will be enabled on the pool.
2051This option can only be used to increase the version number up to the last
2052supported legacy version number.
2053.El
2054.El
2055.Sh EXIT STATUS
2056The following exit values are returned:
2057.Bl -tag -width Ds
2058.It Sy 0
2059Successful completion.
2060.It Sy 1
2061An error occurred.
2062.It Sy 2
2063Invalid command line options were specified.
2064.El
2065.Sh EXAMPLES
2066.Bl -tag -width Ds
2067.It Sy Example 1 No Creating a RAID-Z Storage Pool
2068The following command creates a pool with a single raidz root vdev that
2069consists of six disks.
2070.Bd -literal
2071# zpool create tank raidz sda sdb sdc sdd sde sdf
2072.Ed
2073.It Sy Example 2 No Creating a Mirrored Storage Pool
2074The following command creates a pool with two mirrors, where each mirror
2075contains two disks.
2076.Bd -literal
2077# zpool create tank mirror sda sdb mirror sdc sdd
2078.Ed
2079.It Sy Example 3 No Creating a ZFS Storage Pool by Using Partitions
54e5f226 2080The following command creates an unmirrored pool using two disk partitions.
cae5b340
AX
2081.Bd -literal
2082# zpool create tank sda1 sdb2
2083.Ed
2084.It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
2085The following command creates an unmirrored pool using files.
2086While not recommended, a pool based on files can be useful for experimental
2087purposes.
2088.Bd -literal
2089# zpool create tank /path/to/file/a /path/to/file/b
2090.Ed
2091.It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
2092The following command adds two mirrored disks to the pool
2093.Em tank ,
2094assuming the pool is already made up of two-way mirrors.
2095The additional space is immediately available to any datasets within the pool.
2096.Bd -literal
2097# zpool add tank mirror sda sdb
2098.Ed
2099.It Sy Example 6 No Listing Available ZFS Storage Pools
2100The following command lists all available pools on the system.
2101In this case, the pool
2102.Em zion
2103is faulted due to a missing device.
058ac9ba 2104The results from this command are similar to the following:
cae5b340
AX
2105.Bd -literal
2106# zpool list
42f7b73b
AX
2107NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2108rpool 19.9G 8.43G 11.4G - 33% 42% 1.00x ONLINE -
2109tank 61.5G 20.0G 41.5G - 48% 32% 1.00x ONLINE -
2110zion - - - - - - - FAULTED -
cae5b340
AX
2111.Ed
2112.It Sy Example 7 No Destroying a ZFS Storage Pool
2113The following command destroys the pool
2114.Em tank
2115and any datasets contained within.
2116.Bd -literal
2117# zpool destroy -f tank
2118.Ed
2119.It Sy Example 8 No Exporting a ZFS Storage Pool
2120The following command exports the devices in pool
2121.Em tank
2122so that they can be relocated or later imported.
2123.Bd -literal
2124# zpool export tank
2125.Ed
2126.It Sy Example 9 No Importing a ZFS Storage Pool
2127The following command displays available pools, and then imports the pool
2128.Em tank
2129for use on the system.
058ac9ba 2130The results from this command are similar to the following:
cae5b340
AX
2131.Bd -literal
2132# zpool import
058ac9ba
BB
2133 pool: tank
2134 id: 15451357997522795478
2135 state: ONLINE
2136action: The pool can be imported using its name or numeric identifier.
2137config:
2138
2139 tank ONLINE
2140 mirror ONLINE
54e5f226
RL
2141 sda ONLINE
2142 sdb ONLINE
058ac9ba 2143
cae5b340
AX
2144# zpool import tank
2145.Ed
2146.It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
2147The following command upgrades all ZFS Storage pools to the current version of
2148the software.
2149.Bd -literal
2150# zpool upgrade -a
2151This system is currently running ZFS version 2.
2152.Ed
2153.It Sy Example 11 No Managing Hot Spares
058ac9ba 2154The following command creates a new pool with an available hot spare:
cae5b340
AX
2155.Bd -literal
2156# zpool create tank mirror sda sdb spare sdc
2157.Ed
2158.Pp
2159If one of the disks were to fail, the pool would be reduced to the degraded
2160state.
2161The failed device can be replaced using the following command:
2162.Bd -literal
2163# zpool replace tank sda sdd
2164.Ed
2165.Pp
2166Once the data has been resilvered, the spare is automatically removed and is
2167made available for use should another device fails.
2168The hot spare can be permanently removed from the pool using the following
2169command:
2170.Bd -literal
2171# zpool remove tank sdc
2172.Ed
2173.It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
2174The following command creates a ZFS storage pool consisting of two, two-way
2175mirrors and mirrored log devices:
2176.Bd -literal
2177# zpool create pool mirror sda sdb mirror sdc sdd log mirror \\
2178 sde sdf
2179.Ed
2180.It Sy Example 13 No Adding Cache Devices to a ZFS Pool
2181The following command adds two disks for use as cache devices to a ZFS storage
2182pool:
2183.Bd -literal
2184# zpool add pool cache sdc sdd
2185.Ed
2186.Pp
2187Once added, the cache devices gradually fill with content from main memory.
2188Depending on the size of your cache devices, it could take over an hour for
2189them to fill.
2190Capacity and reads can be monitored using the
2191.Cm iostat
2192option as follows:
2193.Bd -literal
2194# zpool iostat -v pool 5
2195.Ed
2196.It Sy Example 14 No Removing a Mirrored Log Device
2197The following command removes the mirrored log device
2198.Sy mirror-2 .
058ac9ba 2199Given this configuration:
cae5b340
AX
2200.Bd -literal
2201 pool: tank
2202 state: ONLINE
2203 scrub: none requested
058ac9ba
BB
2204config:
2205
2206 NAME STATE READ WRITE CKSUM
2207 tank ONLINE 0 0 0
2208 mirror-0 ONLINE 0 0 0
54e5f226
RL
2209 sda ONLINE 0 0 0
2210 sdb ONLINE 0 0 0
058ac9ba 2211 mirror-1 ONLINE 0 0 0
54e5f226
RL
2212 sdc ONLINE 0 0 0
2213 sdd ONLINE 0 0 0
058ac9ba
BB
2214 logs
2215 mirror-2 ONLINE 0 0 0
54e5f226
RL
2216 sde ONLINE 0 0 0
2217 sdf ONLINE 0 0 0
cae5b340
AX
2218.Ed
2219.Pp
2220The command to remove the mirrored log
2221.Sy mirror-2
2222is:
2223.Bd -literal
2224# zpool remove tank mirror-2
2225.Ed
2226.It Sy Example 15 No Displaying expanded space on a device
2227The following command displays the detailed information for the pool
2228.Em data .
2229This pool is comprised of a single raidz vdev where one of its devices
2230increased its capacity by 10GB.
2231In this example, the pool will not be able to utilize this extra capacity until
2232all the devices under the raidz vdev have been expanded.
2233.Bd -literal
2234# zpool list -v data
42f7b73b
AX
2235NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
2236data 23.9G 14.6G 9.30G - 48% 61% 1.00x ONLINE -
2237 raidz1 23.9G 14.6G 9.30G - 48%
2238 sda - - - - -
2239 sdb - - - 10G -
2240 sdc - - - - -
cae5b340
AX
2241.Ed
2242.It Sy Example 16 No Adding output columns
2243Additional columns can be added to the
2244.Nm zpool Cm status
2245and
2246.Nm zpool Cm iostat
2247output with
2248.Fl c
2249option.
2250.Bd -literal
2251# zpool status -c vendor,model,size
2252 NAME STATE READ WRITE CKSUM vendor model size
2253 tank ONLINE 0 0 0
2254 mirror-0 ONLINE 0 0 0
2255 U1 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2256 U10 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2257 U11 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2258 U12 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2259 U13 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2260 U14 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
2261
2262# zpool iostat -vc slaves
2263 capacity operations bandwidth
2264 pool alloc free read write read write slaves
2265 ---------- ----- ----- ----- ----- ----- ----- ---------
2266 tank 20.4G 7.23T 26 152 20.7M 21.6M
2267 mirror 20.4G 7.23T 26 152 20.7M 21.6M
2268 U1 - - 0 31 1.46K 20.6M sdb sdff
2269 U10 - - 0 1 3.77K 13.3K sdas sdgw
2270 U11 - - 0 1 288K 13.3K sdat sdgx
2271 U12 - - 0 1 78.4K 13.3K sdau sdgy
2272 U13 - - 0 1 128K 13.3K sdav sdgz
2273 U14 - - 0 1 63.2K 13.3K sdfk sdg
2274.Ed
2275.El
2276.Sh ENVIRONMENT VARIABLES
2277.Bl -tag -width "ZFS_ABORT"
2278.It Ev ZFS_ABORT
2279Cause
2280.Nm zpool
2281to dump core on exit for the purposes of running
2282.Sy::findleaks .
2283.El
2284.Bl -tag -width "ZPOOL_IMPORT_PATH"
2285.It Ev ZPOOL_IMPORT_PATH
2286The search path for devices or files to use with the pool. This is a colon-separated list of directories in which
2287.Nm zpool
2288looks for device nodes and files.
2289Similar to the
2290.Fl d
2291option in
2292.Nm zpool import .
2293.El
2294.Bl -tag -width "ZPOOL_VDEV_NAME_GUID"
2295.It Ev ZPOOL_VDEV_NAME_GUID
2296Cause
2297.Nm zpool subcommands to output vdev guids by default. This behavior
2298is identical to the
2299.Nm zpool status -g
2300command line option.
2301.El
2302.Bl -tag -width "ZPOOL_VDEV_NAME_FOLLOW_LINKS"
2303.It Ev ZPOOL_VDEV_NAME_FOLLOW_LINKS
2304Cause
2305.Nm zpool
2306subcommands to follow links for vdev names by default. This behavior is identical to the
2307.Nm zpool status -L
2308command line option.
2309.El
2310.Bl -tag -width "ZPOOL_VDEV_NAME_PATH"
2311.It Ev ZPOOL_VDEV_NAME_PATH
2312Cause
2313.Nm zpool
2314subcommands to output full vdev path names by default. This
2315behavior is identical to the
2316.Nm zpool status -p
2317command line option.
2318.El
2319.Bl -tag -width "ZFS_VDEV_DEVID_OPT_OUT"
2320.It Ev ZFS_VDEV_DEVID_OPT_OUT
2321Older ZFS on Linux implementations had issues when attempting to display pool
2322config VDEV names if a
2323.Sy devid
2324NVP value is present in the pool's config.
2325.Pp
2326For example, a pool that originated on illumos platform would have a devid
2327value in the config and
2328.Nm zpool status
2329would fail when listing the config.
2330This would also be true for future Linux based pools.
2331.Pp
2332A pool can be stripped of any
2333.Sy devid
2334values on import or prevented from adding
2335them on
2336.Nm zpool create
2337or
2338.Nm zpool add
2339by setting
2340.Sy ZFS_VDEV_DEVID_OPT_OUT .
2341.El
2342.Bl -tag -width "ZPOOL_SCRIPTS_AS_ROOT"
2343.It Ev ZPOOL_SCRIPTS_AS_ROOT
2344Allow a privileged user to run the
2345.Nm zpool status/iostat
2346with the
2347.Fl c
2348option. Normally, only unprivileged users are allowed to run
2349.Fl c .
2350.El
2351.Bl -tag -width "ZPOOL_SCRIPTS_PATH"
2352.It Ev ZPOOL_SCRIPTS_PATH
2353The search path for scripts when running
2354.Nm zpool status/iostat
2355with the
2356.Fl c
2357option. This is a colon-separated list of directories and overrides the default
2358.Pa ~/.zpool.d
2359and
2360.Pa /etc/zfs/zpool.d
2361search paths.
2362.El
2363.Bl -tag -width "ZPOOL_SCRIPTS_ENABLED"
2364.It Ev ZPOOL_SCRIPTS_ENABLED
2365Allow a user to run
2366.Nm zpool status/iostat
2367with the
2368.Fl c
2369option. If
2370.Sy ZPOOL_SCRIPTS_ENABLED
2371is not set, it is assumed that the user is allowed to run
2372.Nm zpool status/iostat -c .
2373.Sh INTERFACE STABILITY
2374.Sy Evolving
2375.Sh SEE ALSO
2376.Xr zed 8 ,
2377.Xr zfs 8 ,
2378.Xr zfs-events 5 ,
2379.Xr zfs-module-parameters 5 ,
2380.Xr zpool-features 5