]> git.proxmox.com Git - mirror_zfs.git/blame - man/man8/zpool.8
Add "-o ashift" to zpool add and zpool attach
[mirror_zfs.git] / man / man8 / zpool.8
CommitLineData
058ac9ba
BB
1'\" te
2.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
d96eb2b1 3.\" Copyright 2011 Nexenta Systems, Inc. All rights reserved.
1bd201e7 4.\" Copyright (c) 2012 by Delphix. All Rights Reserved.
df831108 5.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
058ac9ba
BB
6.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
7.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
8.\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
d96eb2b1 9.TH zpool 8 "2 August 2012" "ZFS pool 28, filesystem 5" "System Administration Commands"
058ac9ba
BB
10.SH NAME
11zpool \- configures ZFS storage pools
12.SH SYNOPSIS
13.LP
14.nf
15\fBzpool\fR [\fB-?\fR]
16.fi
17
18.LP
19.nf
df831108 20\fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...
058ac9ba
BB
21.fi
22
23.LP
24.nf
df831108 25\fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
058ac9ba
BB
26.fi
27
28.LP
29.nf
30\fBzpool clear\fR \fIpool\fR [\fIdevice\fR]
31.fi
32
33.LP
34.nf
35\fBzpool create\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR]
36 ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...
37.fi
38
39.LP
40.nf
41\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
42.fi
43
44.LP
45.nf
46\fBzpool detach\fR \fIpool\fR \fIdevice\fR
47.fi
48
49.LP
50.nf
51\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...
52.fi
53
54.LP
55.nf
56\fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
57.fi
58
59.LP
60.nf
61\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...
62.fi
63
64.LP
65.nf
66\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
67.fi
68
69.LP
70.nf
7f9d9946
BB
71\fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
72 [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fB-a\fR
058ac9ba
BB
73.fi
74
75.LP
76.nf
77\fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
7f9d9946 78 [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fIpool\fR |\fIid\fR [\fInewpool\fR]
058ac9ba
BB
79.fi
80
81.LP
82.nf
83\fBzpool iostat\fR [\fB-T\fR u | d ] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
84.fi
85
86.LP
87.nf
1bd201e7 88\fBzpool list\fR [\fB-Hv\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
058ac9ba
BB
89.fi
90
91.LP
92.nf
93\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
94.fi
95
96.LP
97.nf
98\fBzpool online\fR \fIpool\fR \fIdevice\fR ...
99.fi
100
3541dc6d
GA
101.LP
102.nf
103\fBzpool reguid\fR \fIpool\fR
104.fi
105
058ac9ba
BB
106.LP
107.nf
108\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...
109.fi
110
111.LP
112.nf
113\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR [\fInew_device\fR]
114.fi
115
116.LP
117.nf
118\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
119.fi
120
121.LP
122.nf
123\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR
124.fi
125
126.LP
127.nf
128\fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...
129.fi
130
131.LP
132.nf
133\fBzpool upgrade\fR
134.fi
135
136.LP
137.nf
138\fBzpool upgrade\fR \fB-v\fR
139.fi
140
141.LP
142.nf
143\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...
144.fi
145
146.SH DESCRIPTION
147.sp
148.LP
149The \fBzpool\fR command configures \fBZFS\fR storage pools. A storage pool is a collection of devices that provides physical storage and data replication for \fBZFS\fR datasets.
150.sp
151.LP
2d1b7b0b 152All datasets within a storage pool share the same space. See \fBzfs\fR(8) for information on managing datasets.
058ac9ba
BB
153.SS "Virtual Devices (\fBvdev\fRs)"
154.sp
155.LP
156A "virtual device" describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported:
157.sp
158.ne 2
159.mk
160.na
161\fB\fBdisk\fR\fR
162.ad
163.RS 10n
164.rt
25d4782b 165A block device, typically located under \fB/dev\fR. \fBZFS\fR can use individual partitions, though the recommended mode of operation is to use whole disks. A disk can be specified by a full path, or it can be a shorthand name (the relative portion of the path under "/dev"). For example, "sda" is equivalent to "/dev/sda". A whole disk can be specified by omitting the partition designation. When given a whole disk, \fBZFS\fR automatically labels the disk, if necessary.
058ac9ba
BB
166.RE
167
168.sp
169.ne 2
170.mk
171.na
172\fB\fBfile\fR\fR
173.ad
174.RS 10n
175.rt
176A regular file. The use of files as a backing store is strongly discouraged. It is designed primarily for experimental purposes, as the fault tolerance of a file is only as good as the file system of which it is a part. A file must be specified by a full path.
177.RE
178
179.sp
180.ne 2
181.mk
182.na
183\fB\fBmirror\fR\fR
184.ad
185.RS 10n
186.rt
187A mirror of two or more devices. Data is replicated in an identical fashion across all components of a mirror. A mirror with \fIN\fR disks of size \fIX\fR can hold \fIX\fR bytes and can withstand (\fIN-1\fR) devices failing before data integrity is compromised.
188.RE
189
190.sp
191.ne 2
192.mk
193.na
194\fB\fBraidz\fR\fR
195.ad
196.br
197.na
198\fB\fBraidz1\fR\fR
199.ad
200.br
201.na
202\fB\fBraidz2\fR\fR
203.ad
204.br
205.na
206\fB\fBraidz3\fR\fR
207.ad
208.RS 10n
209.rt
210A variation on \fBRAID-5\fR that allows for better distribution of parity and eliminates the "\fBRAID-5\fR write hole" (in which data and parity become inconsistent after a power loss). Data and parity is striped across all disks within a \fBraidz\fR group.
211.sp
212A \fBraidz\fR group can have single-, double- , or triple parity, meaning that the \fBraidz\fR group can sustain one, two, or three failures, respectively, without losing any data. The \fBraidz1\fR \fBvdev\fR type specifies a single-parity \fBraidz\fR group; the \fBraidz2\fR \fBvdev\fR type specifies a double-parity \fBraidz\fR group; and the \fBraidz3\fR \fBvdev\fR type specifies a triple-parity \fBraidz\fR group. The \fBraidz\fR \fBvdev\fR type is an alias for \fBraidz1\fR.
213.sp
214A \fBraidz\fR group with \fIN\fR disks of size \fIX\fR with \fIP\fR parity disks can hold approximately (\fIN-P\fR)*\fIX\fR bytes and can withstand \fIP\fR device(s) failing before data integrity is compromised. The minimum number of devices in a \fBraidz\fR group is one more than the number of parity disks. The recommended number is between 3 and 9 to help increase performance.
215.RE
216
217.sp
218.ne 2
219.mk
220.na
221\fB\fBspare\fR\fR
222.ad
223.RS 10n
224.rt
225A special pseudo-\fBvdev\fR which keeps track of available hot spares for a pool. For more information, see the "Hot Spares" section.
226.RE
227
228.sp
229.ne 2
230.mk
231.na
232\fB\fBlog\fR\fR
233.ad
234.RS 10n
235.rt
236A separate-intent log device. If more than one log device is specified, then writes are load-balanced between devices. Log devices can be mirrored. However, \fBraidz\fR \fBvdev\fR types are not supported for the intent log. For more information, see the "Intent Log" section.
237.RE
238
239.sp
240.ne 2
241.mk
242.na
243\fB\fBcache\fR\fR
244.ad
245.RS 10n
246.rt
247A device used to cache storage pool data. A cache device cannot be cannot be configured as a mirror or \fBraidz\fR group. For more information, see the "Cache Devices" section.
248.RE
249
250.sp
251.LP
252Virtual devices cannot be nested, so a mirror or \fBraidz\fR virtual device can only contain files or disks. Mirrors of mirrors (or other combinations) are not allowed.
253.sp
254.LP
255A pool can have any number of virtual devices at the top of the configuration (known as "root vdevs"). Data is dynamically distributed across all top-level devices to balance data among devices. As new virtual devices are added, \fBZFS\fR automatically places data on the newly available devices.
256.sp
257.LP
258Virtual devices are specified one at a time on the command line, separated by whitespace. The keywords "mirror" and "raidz" are used to distinguish where a group ends and another begins. For example, the following creates two root vdevs, each a mirror of two disks:
259.sp
260.in +2
261.nf
54e5f226 262# \fBzpool create mypool mirror sda sdb mirror sdc sdd\fR
058ac9ba
BB
263.fi
264.in -2
265.sp
266
267.SS "Device Failure and Recovery"
268.sp
269.LP
270\fBZFS\fR supports a rich set of mechanisms for handling device failure and data corruption. All metadata and data is checksummed, and \fBZFS\fR automatically repairs bad data from a good copy when corruption is detected.
271.sp
272.LP
273In order to take advantage of these features, a pool must make use of some form of redundancy, using either mirrored or \fBraidz\fR groups. While \fBZFS\fR supports running in a non-redundant configuration, where each root vdev is simply a disk or file, this is strongly discouraged. A single case of bit corruption can render some or all of your data unavailable.
274.sp
275.LP
276A pool's health status is described by one of three states: online, degraded, or faulted. An online pool has all devices operating normally. A degraded pool is one in which one or more devices have failed, but the data is still available due to a redundant configuration. A faulted pool has corrupted metadata, or one or more faulted devices, and insufficient replicas to continue functioning.
277.sp
278.LP
279The health of the top-level vdev, such as mirror or \fBraidz\fR device, is potentially impacted by the state of its associated vdevs, or component devices. A top-level vdev or component device is in one of the following states:
280.sp
281.ne 2
282.mk
283.na
284\fB\fBDEGRADED\fR\fR
285.ad
286.RS 12n
287.rt
288One or more top-level vdevs is in the degraded state because one or more component devices are offline. Sufficient replicas exist to continue functioning.
289.sp
290One or more component devices is in the degraded or faulted state, but sufficient replicas exist to continue functioning. The underlying conditions are as follows:
291.RS +4
292.TP
293.ie t \(bu
294.el o
295The number of checksum errors exceeds acceptable levels and the device is degraded as an indication that something may be wrong. \fBZFS\fR continues to use the device as necessary.
296.RE
297.RS +4
298.TP
299.ie t \(bu
300.el o
301The number of I/O errors exceeds acceptable levels. The device could not be marked as faulted because there are insufficient replicas to continue functioning.
302.RE
303.RE
304
305.sp
306.ne 2
307.mk
308.na
309\fB\fBFAULTED\fR\fR
310.ad
311.RS 12n
312.rt
313One or more top-level vdevs is in the faulted state because one or more component devices are offline. Insufficient replicas exist to continue functioning.
314.sp
315One or more component devices is in the faulted state, and insufficient replicas exist to continue functioning. The underlying conditions are as follows:
316.RS +4
317.TP
318.ie t \(bu
319.el o
320The device could be opened, but the contents did not match expected values.
321.RE
322.RS +4
323.TP
324.ie t \(bu
325.el o
326The number of I/O errors exceeds acceptable levels and the device is faulted to prevent further use of the device.
327.RE
328.RE
329
330.sp
331.ne 2
332.mk
333.na
334\fB\fBOFFLINE\fR\fR
335.ad
336.RS 12n
337.rt
338The device was explicitly taken offline by the "\fBzpool offline\fR" command.
339.RE
340
341.sp
342.ne 2
343.mk
344.na
345\fB\fBONLINE\fR\fR
346.ad
347.RS 12n
348.rt
349The device is online and functioning.
350.RE
351
352.sp
353.ne 2
354.mk
355.na
356\fB\fBREMOVED\fR\fR
357.ad
358.RS 12n
359.rt
360The device was physically removed while the system was running. Device removal detection is hardware-dependent and may not be supported on all platforms.
361.RE
362
363.sp
364.ne 2
365.mk
366.na
367\fB\fBUNAVAIL\fR\fR
368.ad
369.RS 12n
370.rt
371The device could not be opened. If a pool is imported when a device was unavailable, then the device will be identified by a unique identifier instead of its path since the path was never correct in the first place.
372.RE
373
374.sp
375.LP
376If a device is removed and later re-attached to the system, \fBZFS\fR attempts to put the device online automatically. Device attach detection is hardware-dependent and might not be supported on all platforms.
377.SS "Hot Spares"
378.sp
379.LP
380\fBZFS\fR allows devices to be associated with pools as "hot spares". These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare. To create a pool with hot spares, specify a "spare" \fBvdev\fR with any number of devices. For example,
381.sp
382.in +2
383.nf
54e5f226 384# zpool create pool mirror sda sdb spare sdc sdd
058ac9ba
BB
385.fi
386.in -2
387.sp
388
389.sp
390.LP
0d122e21 391Spares can be shared across multiple pools, and can be added with the "\fBzpool add\fR" command and removed with the "\fBzpool remove\fR" command. Once a spare replacement is initiated, a new "spare" \fBvdev\fR is created within the configuration that will remain there until the original device is replaced. At this point, the hot spare becomes available again.
058ac9ba
BB
392.sp
393.LP
394If a pool has a shared spare that is currently being used, the pool can not be exported since other pools may use this shared spare, which may lead to potential data corruption.
395.sp
396.LP
397An in-progress spare replacement can be cancelled by detaching the hot spare. If the original faulted device is detached, then the hot spare assumes its place in the configuration, and is removed from the spare list of all active pools.
398.sp
399.LP
400Spares cannot replace log devices.
401.SS "Intent Log"
402.sp
403.LP
404The \fBZFS\fR Intent Log (\fBZIL\fR) satisfies \fBPOSIX\fR requirements for synchronous transactions. For instance, databases often require their transactions to be on stable storage devices when returning from a system call. \fBNFS\fR and other applications can also use \fBfsync\fR() to ensure data stability. By default, the intent log is allocated from blocks within the main pool. However, it might be possible to get better performance using separate intent log devices such as \fBNVRAM\fR or a dedicated disk. For example:
405.sp
406.in +2
407.nf
54e5f226 408\fB# zpool create pool sda sdb log sdc\fR
058ac9ba
BB
409.fi
410.in -2
411.sp
412
413.sp
414.LP
415Multiple log devices can also be specified, and they can be mirrored. See the EXAMPLES section for an example of mirroring multiple log devices.
416.sp
417.LP
418Log devices can be added, replaced, attached, detached, and imported and exported as part of the larger pool. Mirrored log devices can be removed by specifying the top-level mirror for the log.
419.SS "Cache Devices"
420.sp
421.LP
422Devices can be added to a storage pool as "cache devices." These devices provide an additional layer of caching between main memory and disk. For read-heavy workloads, where the working set size is much larger than what can be cached in main memory, using cache devices allow much more of this working set to be served from low latency media. Using cache devices provides the greatest performance improvement for random read-workloads of mostly static content.
423.sp
424.LP
425To create a pool with cache devices, specify a "cache" \fBvdev\fR with any number of devices. For example:
426.sp
427.in +2
428.nf
54e5f226 429\fB# zpool create pool sda sdb cache sdc sdd\fR
058ac9ba
BB
430.fi
431.in -2
432.sp
433
434.sp
435.LP
436Cache devices cannot be mirrored or part of a \fBraidz\fR configuration. If a read error is encountered on a cache device, that read \fBI/O\fR is reissued to the original storage pool device, which might be part of a mirrored or \fBraidz\fR configuration.
437.sp
438.LP
439The content of the cache devices is considered volatile, as is the case with other system caches.
440.SS "Properties"
441.sp
442.LP
443Each pool has several properties associated with it. Some properties are read-only statistics while others are configurable and change the behavior of the pool. The following are read-only properties:
444.sp
445.ne 2
446.mk
447.na
448\fB\fBavailable\fR\fR
449.ad
450.RS 20n
451.rt
452Amount of storage available within the pool. This property can also be referred to by its shortened column name, "avail".
453.RE
454
455.sp
456.ne 2
457.mk
458.na
459\fB\fBcapacity\fR\fR
460.ad
461.RS 20n
462.rt
463Percentage of pool space used. This property can also be referred to by its shortened column name, "cap".
464.RE
465
d96eb2b1
DM
466.sp
467.ne 2
468.mk
469.na
470\fB\fBcomment\fR\fR
471.ad
472.RS 20n
473.rt
474A text string consisting of printable ASCII characters that will be stored such that it is available even if the pool becomes faulted. An administrator can provide additional information about a pool using this property.
475.RE
476
058ac9ba
BB
477.sp
478.ne 2
479.mk
480.na
1bd201e7
CS
481\fB\fBexpandsize\fR\fR
482.ad
483.RS 20n
484Amount of uninitialized space within the pool or device that can be used to
485increase the total capacity of the pool. Uninitialized space consists of
486any space on an EFI labeled vdev which has not been brought online
487(i.e. zpool online -e). This space occurs when a LUN is dynamically expanded.
488.RE
489
490.sp
491.ne 2
492.na
058ac9ba
BB
493\fB\fBhealth\fR\fR
494.ad
495.RS 20n
496.rt
497The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR", "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
498.RE
499
500.sp
501.ne 2
502.mk
503.na
504\fB\fBguid\fR\fR
505.ad
506.RS 20n
507.rt
508A unique identifier for the pool.
509.RE
510
511.sp
512.ne 2
513.mk
514.na
515\fB\fBsize\fR\fR
516.ad
517.RS 20n
518.rt
519Total size of the storage pool.
520.RE
521
522.sp
523.ne 2
524.mk
525.na
526\fB\fBused\fR\fR
527.ad
528.RS 20n
529.rt
530Amount of storage space used within the pool.
531.RE
532
533.sp
534.LP
2d1b7b0b 535These space usage properties report actual physical space available to the storage pool. The physical space can be different from the total amount of space that any contained datasets can actually use. The amount of space used in a \fBraidz\fR configuration depends on the characteristics of the data being written. In addition, \fBZFS\fR reserves some space for internal accounting that the \fBzfs\fR(8) command takes into account, but the \fBzpool\fR command does not. For non-full pools of a reasonable size, these effects should be invisible. For small pools, or pools that are close to being completely full, these discrepancies may become more noticeable.
df30f566
CK
536
537.sp
538.LP
539The following property can be set at creation time:
540.sp
541.ne 2
542.mk
543.na
544\fB\fBashift\fR\fR
545.ad
546.sp .6
547.RS 4n
548Pool sector size exponent, to the power of 2 (internally referred to as "ashift"). I/O operations will be aligned to the specified size boundaries. Additionally, the minimum (disk) write size will be set to the specified size, so this represents a space vs. performance trade-off. The typical case for setting this property is when performance is important and the underlying disks use 4KiB sectors but report 512B sectors to the OS (for compatibility reasons); in that case, set \fBashift=12\fR (which is 1<<12 = 4096).
549.LP
550For optimal performance, the pool sector size should be greater than or equal to the sector size of the underlying disks. Since the property cannot be changed after pool creation, if in a given pool, you \fIever\fR want to use drives that \fIreport\fR 4KiB sectors, you must set \fBashift=12\fR at pool creation time.
551.RE
552
058ac9ba
BB
553.sp
554.LP
555The following property can be set at creation time and import time:
556.sp
557.ne 2
558.mk
559.na
560\fB\fBaltroot\fR\fR
561.ad
562.sp .6
563.RS 4n
57746821 564Alternate root directory. If set, this directory is prepended to any mount points within the pool. This can be used when examining an unknown pool where the mount points cannot be trusted, or in an alternate boot environment, where the typical paths are not valid. \fBaltroot\fR is not a persistent property. It is valid only while the system is up. Setting \fBaltroot\fR defaults to using \fBcachefile\fR=none, though this may be overridden using an explicit setting.
058ac9ba
BB
565.RE
566
567.sp
568.LP
569The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
570.sp
571.ne 2
572.mk
573.na
574\fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
575.ad
576.sp .6
577.RS 4n
578Controls automatic pool expansion when the underlying LUN is grown. If set to \fBon\fR, the pool will be resized according to the size of the expanded device. If the device is part of a mirror or \fBraidz\fR then all devices within that mirror/\fBraidz\fR group must be expanded before the new space is made available to the pool. The default behavior is \fBoff\fR. This property can also be referred to by its shortened column name, \fBexpand\fR.
579.RE
580
581.sp
582.ne 2
583.mk
584.na
585\fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
586.ad
587.sp .6
588.RS 4n
589Controls automatic device replacement. If set to "\fBoff\fR", device replacement must be initiated by the administrator by using the "\fBzpool replace\fR" command. If set to "\fBon\fR", any new device, found in the same physical location as a device that previously belonged to the pool, is automatically formatted and replaced. The default behavior is "\fBoff\fR". This property can also be referred to by its shortened column name, "replace".
590.RE
591
592.sp
593.ne 2
594.mk
595.na
596\fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
597.ad
598.sp .6
599.RS 4n
600Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
601.RE
602
603.sp
604.ne 2
605.mk
606.na
607\fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
608.ad
609.sp .6
610.RS 4n
611Controls the location of where the pool configuration is cached. Discovering all pools on system startup requires a cached copy of the configuration data that is stored on the root file system. All pools in this cache are automatically imported when the system boots. Some environments, such as install and clustering, need to cache this information in a different location so that pools are not automatically imported. Setting this property caches the pool configuration in a different location that can later be imported with "\fBzpool import -c\fR". Setting it to the special value "\fBnone\fR" creates a temporary pool that is never cached, and the special value \fB\&''\fR (empty string) uses the default location.
612.sp
613Multiple pools can share the same cache file. Because the kernel destroys and recreates this file when pools are added and removed, care should be taken when attempting to access this file. When the last pool using a \fBcachefile\fR is exported or destroyed, the file is removed.
614.RE
615
616.sp
617.ne 2
618.mk
619.na
620\fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
621.ad
622.sp .6
623.RS 4n
2d1b7b0b 624Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See \fBzfs\fR(8) for more information on \fBZFS\fR delegated administration.
058ac9ba
BB
625.RE
626
627.sp
628.ne 2
629.mk
630.na
631\fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
632.ad
633.sp .6
634.RS 4n
635Controls the system behavior in the event of catastrophic pool failure. This condition is typically a result of a loss of connectivity to the underlying storage device(s) or a failure of all devices within the pool. The behavior of such an event is determined as follows:
636.sp
637.ne 2
638.mk
639.na
640\fB\fBwait\fR\fR
641.ad
642.RS 12n
643.rt
644Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
645.RE
646
647.sp
648.ne 2
649.mk
650.na
651\fB\fBcontinue\fR\fR
652.ad
653.RS 12n
654.rt
655Returns \fBEIO\fR to any new write \fBI/O\fR requests but allows reads to any of the remaining healthy devices. Any write requests that have yet to be committed to disk would be blocked.
656.RE
657
658.sp
659.ne 2
660.mk
661.na
662\fB\fBpanic\fR\fR
663.ad
664.RS 12n
665.rt
666Prints out a message to the console and generates a system crash dump.
667.RE
668
669.RE
670
671.sp
672.ne 2
673.mk
674.na
675\fB\fBlistsnaps\fR=on | off\fR
676.ad
677.sp .6
678.RS 4n
679Controls whether information about snapshots associated with this pool is output when "\fBzfs list\fR" is run without the \fB-t\fR option. The default value is "off".
680.RE
681
682.sp
683.ne 2
684.mk
685.na
686\fB\fBversion\fR=\fIversion\fR\fR
687.ad
688.sp .6
689.RS 4n
690The current on-disk version of the pool. This can be increased, but never decreased. The preferred method of updating pools is with the "\fBzpool upgrade\fR" command, though this property can be used when a specific version is needed for backwards compatibility. This property can be any number between 1 and the current version reported by "\fBzpool upgrade -v\fR".
691.RE
692
693.SS "Subcommands"
694.sp
695.LP
696All subcommands that modify state are logged persistently to the pool in their original form.
697.sp
698.LP
699The \fBzpool\fR command provides subcommands to create and destroy storage pools, add capacity to storage pools, and provide information about the storage pools. The following subcommands are supported:
700.sp
701.ne 2
702.mk
703.na
704\fB\fBzpool\fR \fB-?\fR\fR
705.ad
706.sp .6
707.RS 4n
708Displays a help message.
709.RE
710
711.sp
712.ne 2
713.mk
714.na
df831108 715\fB\fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...\fR
058ac9ba
BB
716.ad
717.sp .6
718.RS 4n
719Adds the specified virtual devices to the given pool. The \fIvdev\fR specification is described in the "Virtual Devices" section. The behavior of the \fB-f\fR option, and the device checks performed are described in the "zpool create" subcommand.
720.sp
721.ne 2
722.mk
723.na
724\fB\fB-f\fR\fR
725.ad
726.RS 6n
727.rt
728Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
729.RE
730
731.sp
732.ne 2
733.mk
734.na
735\fB\fB-n\fR\fR
736.ad
737.RS 6n
738.rt
739Displays the configuration that would be used without actually adding the \fBvdev\fRs. The actual pool creation can still fail due to insufficient privileges or device sharing.
740.RE
741
df831108
CP
742.sp
743.ne 2
744.mk
745.na
746\fB\fB-o\fR \fIproperty=value\fR
747.ad
748.sp .6
749.RS 4n
750Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set. The only property supported at the moment is "ashift".
751.RE
752
058ac9ba
BB
753Do not add a disk that is currently configured as a quorum device to a zpool. After a disk is in the pool, that disk can then be configured as a quorum device.
754.RE
755
756.sp
757.ne 2
758.mk
759.na
df831108 760\fB\fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
058ac9ba
BB
761.ad
762.sp .6
763.RS 4n
764Attaches \fInew_device\fR to an existing \fBzpool\fR device. The existing device cannot be part of a \fBraidz\fR configuration. If \fIdevice\fR is not currently part of a mirrored configuration, \fIdevice\fR automatically transforms into a two-way mirror of \fIdevice\fR and \fInew_device\fR. If \fIdevice\fR is part of a two-way mirror, attaching \fInew_device\fR creates a three-way mirror, and so on. In either case, \fInew_device\fR begins to resilver immediately.
765.sp
766.ne 2
767.mk
768.na
769\fB\fB-f\fR\fR
770.ad
771.RS 6n
772.rt
773Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
774.RE
775
df831108
CP
776.sp
777.ne 2
778.mk
779.na
780\fB\fB-o\fR \fIproperty=value\fR
781.ad
782.sp .6
783.RS 4n
784Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set. The only property supported at the moment is "ashift".
785.RE
786
058ac9ba
BB
787.RE
788
789.sp
790.ne 2
791.mk
792.na
793\fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
794.ad
795.sp .6
796.RS 4n
797Clears device errors in a pool. If no arguments are specified, all device errors within the pool are cleared. If one or more devices is specified, only those errors associated with the specified device or devices are cleared.
798.RE
799
800.sp
801.ne 2
802.mk
803.na
804\fB\fBzpool create\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR] ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...\fR
805.ad
806.sp .6
807.RS 4n
e6101ea8 808Creates a new storage pool containing the virtual devices specified on the command line. The pool name must begin with a letter, and can only contain alphanumeric characters as well as underscore ("_"), dash ("-"), period ("."), colon (":"), and space (" "). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are names beginning with the pattern "c[0-9]". The \fBvdev\fR specification is described in the "Virtual Devices" section.
058ac9ba
BB
809.sp
810The command verifies that each device specified is accessible and not currently in use by another subsystem. There are some uses, such as being currently mounted, or specified as the dedicated dump device, that prevents a device from ever being used by \fBZFS\fR. Other uses, such as having a preexisting \fBUFS\fR file system, can be overridden with the \fB-f\fR option.
811.sp
812The command also checks that the replication strategy for the pool is consistent. An attempt to combine redundant and non-redundant storage in a single pool, or to mix disks and files, results in an error unless \fB-f\fR is specified. The use of differently sized devices within a single \fBraidz\fR or mirror group is also flagged as an error unless \fB-f\fR is specified.
813.sp
814Unless the \fB-R\fR option is specified, the default mount point is "/\fIpool\fR". The mount point must not exist or must be empty, or else the root dataset cannot be mounted. This can be overridden with the \fB-m\fR option.
815.sp
816.ne 2
817.mk
818.na
819\fB\fB-f\fR\fR
820.ad
821.sp .6
822.RS 4n
823Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
824.RE
825
826.sp
827.ne 2
828.mk
829.na
830\fB\fB-n\fR\fR
831.ad
832.sp .6
833.RS 4n
834Displays the configuration that would be used without actually creating the pool. The actual pool creation can still fail due to insufficient privileges or device sharing.
835.RE
836
837.sp
838.ne 2
839.mk
840.na
841\fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
842.ad
843.sp .6
844.RS 4n
845Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
846.RE
847
848.sp
849.ne 2
850.mk
851.na
852\fB\fB-O\fR \fIfile-system-property=value\fR\fR
853.ad
854.br
855.na
856\fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
857.ad
858.sp .6
859.RS 4n
2d1b7b0b 860Sets the given file system properties in the root file system of the pool. See the "Properties" section of \fBzfs\fR(8) for a list of valid properties that can be set.
058ac9ba
BB
861.RE
862
863.sp
864.ne 2
865.mk
866.na
867\fB\fB-R\fR \fIroot\fR\fR
868.ad
869.sp .6
870.RS 4n
871Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
872.RE
873
874.sp
875.ne 2
876.mk
877.na
878\fB\fB-m\fR \fImountpoint\fR\fR
879.ad
880.sp .6
881.RS 4n
2d1b7b0b 882Sets the mount point for the root dataset. The default mount point is "/\fIpool\fR" or "\fBaltroot\fR/\fIpool\fR" if \fBaltroot\fR is specified. The mount point must be an absolute path, "\fBlegacy\fR", or "\fBnone\fR". For more information on dataset mount points, see \fBzfs\fR(8).
058ac9ba
BB
883.RE
884
885.RE
886
887.sp
888.ne 2
889.mk
890.na
891\fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
892.ad
893.sp .6
894.RS 4n
895Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
896.sp
897.ne 2
898.mk
899.na
900\fB\fB-f\fR\fR
901.ad
902.RS 6n
903.rt
904Forces any active datasets contained within the pool to be unmounted.
905.RE
906
907.RE
908
909.sp
910.ne 2
911.mk
912.na
913\fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
914.ad
915.sp .6
916.RS 4n
917Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data.
918.RE
919
920.sp
921.ne 2
922.mk
923.na
924\fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
925.ad
926.sp .6
927.RS 4n
928Exports the given pools from the system. All devices are marked as exported, but are still considered in use by other subsystems. The devices can be moved between systems (even those of different endianness) and imported as long as a sufficient number of devices are present.
929.sp
930Before exporting the pool, all datasets within the pool are unmounted. A pool can not be exported if it has a shared spare that is currently being used.
931.sp
25d4782b 932For pools to be portable, you must give the \fBzpool\fR command whole disks, not just partitions, so that \fBZFS\fR can label the disks with portable \fBEFI\fR labels. Otherwise, disk drivers on platforms of different endianness will not recognize the disks.
058ac9ba
BB
933.sp
934.ne 2
935.mk
936.na
937\fB\fB-f\fR\fR
938.ad
939.RS 6n
940.rt
941Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
942.sp
943This command will forcefully export the pool even if it has a shared spare that is currently being used. This may lead to potential data corruption.
944.RE
945
946.RE
947
948.sp
949.ne 2
950.mk
951.na
952\fB\fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
953.ad
954.sp .6
955.RS 4n
956Retrieves the given list of properties (or all properties if "\fBall\fR" is used) for the specified storage pool(s). These properties are displayed with the following fields:
957.sp
958.in +2
959.nf
960 name Name of storage pool
961 property Property name
962 value Property value
963 source Property source, either 'default' or 'local'.
964.fi
965.in -2
966.sp
967
968See the "Properties" section for more information on the available pool properties.
969.RE
970
971.sp
972.ne 2
973.mk
974.na
975\fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
976.ad
977.sp .6
978.RS 4n
979Displays the command history of the specified pools or all pools if no pool is specified.
980.sp
981.ne 2
982.mk
983.na
984\fB\fB-i\fR\fR
985.ad
986.RS 6n
987.rt
988Displays internally logged \fBZFS\fR events in addition to user initiated events.
989.RE
990
991.sp
992.ne 2
993.mk
994.na
995\fB\fB-l\fR\fR
996.ad
997.RS 6n
998.rt
999Displays log records in long format, which in addition to standard format includes, the user name, the hostname, and the zone in which the operation was performed.
1000.RE
1001
1002.RE
1003
1004.sp
1005.ne 2
1006.mk
1007.na
1008\fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
1009.ad
1010.sp .6
1011.RS 4n
1fe2e237 1012Lists pools available to import. If the \fB-d\fR option is not specified, this command searches for devices in "/dev". The \fB-d\fR option can be specified multiple times, and all directories are searched. If the device appears to be part of an exported pool, this command displays a summary of the pool with the name of the pool, a numeric identifier, as well as the \fIvdev\fR layout and current health of the device for each device or file. Destroyed pools, pools that were previously destroyed with the "\fBzpool destroy\fR" command, are not listed unless the \fB-D\fR option is specified.
058ac9ba
BB
1013.sp
1014The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
1015.sp
1016.ne 2
1017.mk
1018.na
1019\fB\fB-c\fR \fIcachefile\fR\fR
1020.ad
1021.RS 16n
1022.rt
1023Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
1024.RE
1025
1026.sp
1027.ne 2
1028.mk
1029.na
1030\fB\fB-d\fR \fIdir\fR\fR
1031.ad
1032.RS 16n
1033.rt
1034Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times.
1035.RE
1036
1037.sp
1038.ne 2
1039.mk
1040.na
1041\fB\fB-D\fR\fR
1042.ad
1043.RS 16n
1044.rt
1045Lists destroyed pools only.
1046.RE
1047
1048.RE
1049
1050.sp
1051.ne 2
1052.mk
1053.na
7f9d9946 1054\fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fB-a\fR\fR
058ac9ba
BB
1055.ad
1056.sp .6
1057.RS 4n
1058Imports all pools found in the search directories. Identical to the previous command, except that all pools with a sufficient number of devices available are imported. Destroyed pools, pools that were previously destroyed with the "\fBzpool destroy\fR" command, will not be imported unless the \fB-D\fR option is specified.
1059.sp
1060.ne 2
1061.mk
1062.na
1063\fB\fB-o\fR \fImntopts\fR\fR
1064.ad
1065.RS 21n
1066.rt
2d1b7b0b 1067Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(8) for a description of dataset properties and mount options.
058ac9ba
BB
1068.RE
1069
1070.sp
1071.ne 2
1072.mk
1073.na
1074\fB\fB-o\fR \fIproperty=value\fR\fR
1075.ad
1076.RS 21n
1077.rt
1078Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1079.RE
1080
1081.sp
1082.ne 2
1083.mk
1084.na
1085\fB\fB-c\fR \fIcachefile\fR\fR
1086.ad
1087.RS 21n
1088.rt
1089Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
1090.RE
1091
1092.sp
1093.ne 2
1094.mk
1095.na
1096\fB\fB-d\fR \fIdir\fR\fR
1097.ad
1098.RS 21n
1099.rt
1100Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. This option is incompatible with the \fB-c\fR option.
1101.RE
1102
1103.sp
1104.ne 2
1105.mk
1106.na
1107\fB\fB-D\fR\fR
1108.ad
1109.RS 21n
1110.rt
1111Imports destroyed pools only. The \fB-f\fR option is also required.
1112.RE
1113
1114.sp
1115.ne 2
1116.mk
1117.na
1118\fB\fB-f\fR\fR
1119.ad
1120.RS 21n
1121.rt
1122Forces import, even if the pool appears to be potentially active.
1123.RE
1124
7f9d9946
BB
1125.sp
1126.ne 2
1127.mk
1128.na
1129\fB\fB-F\fR\fR
1130.ad
1131.RS 21n
1132Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported.
1133.RE
1134
058ac9ba
BB
1135.sp
1136.ne 2
1137.mk
1138.na
1139\fB\fB-a\fR\fR
1140.ad
1141.RS 21n
1142.rt
1143Searches for and imports all pools found.
1144.RE
1145
7f9d9946
BB
1146.sp
1147.ne 2
1148.mk
1149.na
1150\fB\fB-m\fR\fR
1151.ad
1152.RS 21n
1153Allows a pool to import when there is a missing log device.
1154.RE
1155
058ac9ba
BB
1156.sp
1157.ne 2
1158.mk
1159.na
1160\fB\fB-R\fR \fIroot\fR\fR
1161.ad
1162.RS 21n
1163.rt
1164Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1165.RE
1166
7f9d9946
BB
1167.sp
1168.ne 2
1169.mk
1170.na
1171\fB\fB-N\fR\fR
1172.ad
1173.RS 21n
1174Import the pool without mounting any file systems.
1175.RE
1176
1177.sp
1178.ne 2
1179.mk
1180.na
1181\fB\fB-n\fR\fR
1182.ad
1183.RS 21n
1184Used with the \fB-F\fR recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the \fB-F\fR option, above.
1185.RE
1186
058ac9ba
BB
1187.RE
1188
1189.sp
1190.ne 2
1191.mk
1192.na
7f9d9946 1193\fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fIpool\fR | \fIid\fR [\fInewpool\fR]\fR
058ac9ba
BB
1194.ad
1195.sp .6
1196.RS 4n
1197Imports a specific pool. A pool can be identified by its name or the numeric identifier. If \fInewpool\fR is specified, the pool is imported using the name \fInewpool\fR. Otherwise, it is imported with the same name as its exported name.
1198.sp
1199If a device is removed from a system without running "\fBzpool export\fR" first, the device appears as potentially active. It cannot be determined if this was a failed export, or whether the device is really in use from another host. To import a pool in this state, the \fB-f\fR option is required.
1200.sp
1201.ne 2
1202.mk
1203.na
1204\fB\fB-o\fR \fImntopts\fR\fR
1205.ad
1206.sp .6
1207.RS 4n
2d1b7b0b 1208Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(8) for a description of dataset properties and mount options.
058ac9ba
BB
1209.RE
1210
1211.sp
1212.ne 2
1213.mk
1214.na
1215\fB\fB-o\fR \fIproperty=value\fR\fR
1216.ad
1217.sp .6
1218.RS 4n
1219Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1220.RE
1221
1222.sp
1223.ne 2
1224.mk
1225.na
1226\fB\fB-c\fR \fIcachefile\fR\fR
1227.ad
1228.sp .6
1229.RS 4n
1230Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
1231.RE
1232
1233.sp
1234.ne 2
1235.mk
1236.na
1237\fB\fB-d\fR \fIdir\fR\fR
1238.ad
1239.sp .6
1240.RS 4n
1241Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. This option is incompatible with the \fB-c\fR option.
1242.RE
1243
1244.sp
1245.ne 2
1246.mk
1247.na
1248\fB\fB-D\fR\fR
1249.ad
1250.sp .6
1251.RS 4n
1252Imports destroyed pool. The \fB-f\fR option is also required.
1253.RE
1254
1255.sp
1256.ne 2
1257.mk
1258.na
1259\fB\fB-f\fR\fR
1260.ad
1261.sp .6
1262.RS 4n
1263Forces import, even if the pool appears to be potentially active.
1264.RE
1265
7f9d9946
BB
1266.sp
1267.ne 2
1268.mk
1269.na
1270\fB\fB-F\fR\fR
1271.ad
1272.sp .6
1273.RS 4n
1274Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported.
1275.RE
1276
058ac9ba
BB
1277.sp
1278.ne 2
1279.mk
1280.na
1281\fB\fB-R\fR \fIroot\fR\fR
1282.ad
1283.sp .6
1284.RS 4n
1285Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1286.RE
1287
7f9d9946
BB
1288.sp
1289.ne 2
1290.mk
1291.na
1292\fB\fB-n\fR\fR
1293.ad
1294.sp .6
1295.RS 4n
1296Used with the \fB-F\fR recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the \fB-F\fR option, above.
1297.RE
1298
1299.sp
1300.ne 2
1301.mk
1302.na
1303\fB\fB-m\fR\fR
1304.ad
1305.sp .6
1306.RS 4n
1307Allows a pool to import when there is a missing log device.
1308.RE
1309
058ac9ba
BB
1310.RE
1311
1312.sp
1313.ne 2
1314.mk
1315.na
1316\fB\fBzpool iostat\fR [\fB-T\fR \fBu\fR | \fBd\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1317.ad
1318.sp .6
1319.RS 4n
1320Displays \fBI/O\fR statistics for the given pools. When given an interval, the statistics are printed every \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If no \fIpools\fR are specified, statistics for every pool in the system is shown. If \fIcount\fR is specified, the command exits after \fIcount\fR reports are printed.
1321.sp
1322.ne 2
1323.mk
1324.na
1325\fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1326.ad
1327.RS 12n
1328.rt
1329Display a time stamp.
1330.sp
1331Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
1332.RE
1333
1334.sp
1335.ne 2
1336.mk
1337.na
1338\fB\fB-v\fR\fR
1339.ad
1340.RS 12n
1341.rt
1342Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1343.RE
1344
1345.RE
1346
1347.sp
1348.ne 2
1349.mk
1350.na
1bd201e7 1351\fB\fBzpool list\fR [\fB-Hv\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...\fR
058ac9ba
BB
1352.ad
1353.sp .6
1354.RS 4n
1355Lists the given pools along with a health status and space usage. When given no arguments, all pools in the system are listed.
1356.sp
1357.ne 2
1358.mk
1359.na
1360\fB\fB-H\fR\fR
1361.ad
1362.RS 12n
1363.rt
1364Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1365.RE
1366
1367.sp
1368.ne 2
1369.mk
1370.na
1371\fB\fB-o\fR \fIprops\fR\fR
1372.ad
1373.RS 12n
1374.rt
1bd201e7
CS
1375Comma-separated list of properties to display. See the "Properties" section for a list of valid properties. The default list is "name, size, used, available, expandsize, capacity, dedupratio, health, altroot"
1376.RE
1377
1378.sp
1379.ne 2
1380.mk
1381.na
1382\fB\fB-v\fR\fR
1383.ad
1384.RS 12n
1385.rt
1386Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wise statistics.
058ac9ba
BB
1387.RE
1388
1389.RE
1390
1391.sp
1392.ne 2
1393.mk
1394.na
1395\fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1396.ad
1397.sp .6
1398.RS 4n
1399Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1400.sp
1401This command is not applicable to spares or cache devices.
1402.sp
1403.ne 2
1404.mk
1405.na
1406\fB\fB-t\fR\fR
1407.ad
1408.RS 6n
1409.rt
1410Temporary. Upon reboot, the specified physical device reverts to its previous state.
1411.RE
1412
1413.RE
1414
1415.sp
1416.ne 2
1417.mk
1418.na
1419\fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1420.ad
1421.sp .6
1422.RS 4n
1423Brings the specified physical device online.
1424.sp
1425This command is not applicable to spares or cache devices.
1426.sp
1427.ne 2
1428.mk
1429.na
1430\fB\fB-e\fR\fR
1431.ad
1432.RS 6n
1433.rt
1434Expand the device to use all available space. If the device is part of a mirror or \fBraidz\fR then all devices must be expanded before the new space will become available to the pool.
1435.RE
1436
1437.RE
1438
1439.sp
1440.ne 2
1441.mk
1442.na
3541dc6d
GA
1443\fB\fBzpool reguid\fR \fIpool\fR
1444.ad
1445.sp .6
1446.RS 4n
1447Generates a new unique identifier for the pool. You must ensure that all devices in this pool are online and
1448healthy before performing this action.
1449.RE
1450
1451.sp
1452.ne 2
1453.na
058ac9ba
BB
1454\fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1455.ad
1456.sp .6
1457.RS 4n
1458Removes the specified device from the pool. This command currently only supports removing hot spares, cache, and log devices. A mirrored log device can be removed by specifying the top-level mirror for the log. Non-log devices that are part of a mirrored configuration can be removed using the \fBzpool detach\fR command. Non-redundant and \fBraidz\fR devices cannot be removed from a pool.
1459.RE
1460
1461.sp
1462.ne 2
1463.mk
1464.na
1465\fB\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
1466.ad
1467.sp .6
1468.RS 4n
1469Replaces \fIold_device\fR with \fInew_device\fR. This is equivalent to attaching \fInew_device\fR, waiting for it to resilver, and then detaching \fIold_device\fR.
1470.sp
1471The size of \fInew_device\fR must be greater than or equal to the minimum size of all the devices in a mirror or \fBraidz\fR configuration.
1472.sp
1fe2e237 1473\fInew_device\fR is required if the pool is not redundant. If \fInew_device\fR is not specified, it defaults to \fIold_device\fR. This form of replacement is useful after an existing disk has failed and has been physically replaced. In this case, the new disk may have the same \fB/dev\fR path as the old device, even though it is actually a different disk. \fBZFS\fR recognizes this.
058ac9ba
BB
1474.sp
1475.ne 2
1476.mk
1477.na
1478\fB\fB-f\fR\fR
1479.ad
1480.RS 6n
1481.rt
1482Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1483.RE
1484
1485.RE
1486
1487.sp
1488.ne 2
1489.mk
1490.na
1491\fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1492.ad
1493.sp .6
1494.RS 4n
1495Begins a scrub. The scrub examines all data in the specified pools to verify that it checksums correctly. For replicated (mirror or \fBraidz\fR) devices, \fBZFS\fR automatically repairs any damage discovered during the scrub. The "\fBzpool status\fR" command reports the progress of the scrub and summarizes the results of the scrub upon completion.
1496.sp
1497Scrubbing and resilvering are very similar operations. The difference is that resilvering only examines data that \fBZFS\fR knows to be out of date (for example, when attaching a new device to a mirror or replacing an existing device), whereas scrubbing examines all data to discover silent errors due to hardware faults or disk failure.
1498.sp
1499Because scrubbing and resilvering are \fBI/O\fR-intensive operations, \fBZFS\fR only allows one at a time. If a scrub is already in progress, the "\fBzpool scrub\fR" command terminates it and starts a new scrub. If a resilver is in progress, \fBZFS\fR does not allow a scrub to be started until the resilver completes.
1500.sp
1501.ne 2
1502.mk
1503.na
1504\fB\fB-s\fR\fR
1505.ad
1506.RS 6n
1507.rt
1508Stop scrubbing.
1509.RE
1510
1511.RE
1512
1513.sp
1514.ne 2
1515.mk
1516.na
1517\fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1518.ad
1519.sp .6
1520.RS 4n
1521Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1522.RE
1523
1524.sp
1525.ne 2
1526.mk
1527.na
1528\fB\fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...\fR
1529.ad
1530.sp .6
1531.RS 4n
1532Displays the detailed health status for the given pools. If no \fIpool\fR is specified, then the status of each pool in the system is displayed. For more information on pool and device health, see the "Device Failure and Recovery" section.
1533.sp
1534If a scrub or resilver is in progress, this command reports the percentage done and the estimated time to completion. Both of these are only approximate, because the amount of data in the pool and the other workloads on the system can change.
1535.sp
1536.ne 2
1537.mk
1538.na
1539\fB\fB-x\fR\fR
1540.ad
1541.RS 6n
1542.rt
1543Only display status for pools that are exhibiting errors or are otherwise unavailable.
1544.RE
1545
1546.sp
1547.ne 2
1548.mk
1549.na
1550\fB\fB-v\fR\fR
1551.ad
1552.RS 6n
1553.rt
1554Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1555.RE
1556
1557.RE
1558
1559.sp
1560.ne 2
1561.mk
1562.na
1563\fB\fBzpool upgrade\fR\fR
1564.ad
1565.sp .6
1566.RS 4n
1567Displays all pools formatted using a different \fBZFS\fR on-disk version. Older versions can continue to be used, but some features may not be available. These pools can be upgraded using "\fBzpool upgrade -a\fR". Pools that are formatted with a more recent version are also displayed, although these pools will be inaccessible on the system.
1568.RE
1569
1570.sp
1571.ne 2
1572.mk
1573.na
1574\fB\fBzpool upgrade\fR \fB-v\fR\fR
1575.ad
1576.sp .6
1577.RS 4n
1578Displays \fBZFS\fR versions supported by the current software. The current \fBZFS\fR versions and all previous supported versions are displayed, along with an explanation of the features provided with each version.
1579.RE
1580
1581.sp
1582.ne 2
1583.mk
1584.na
1585\fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1586.ad
1587.sp .6
1588.RS 4n
1589Upgrades the given pool to the latest on-disk version. Once this is done, the pool will no longer be accessible on systems running older versions of the software.
1590.sp
1591.ne 2
1592.mk
1593.na
1594\fB\fB-a\fR\fR
1595.ad
1596.RS 14n
1597.rt
1598Upgrades all pools.
1599.RE
1600
1601.sp
1602.ne 2
1603.mk
1604.na
1605\fB\fB-V\fR \fIversion\fR\fR
1606.ad
1607.RS 14n
1608.rt
1609Upgrade to the specified version. If the \fB-V\fR flag is not specified, the pool is upgraded to the most recent version. This option can only be used to increase the version number, and only up to the most recent version supported by this software.
1610.RE
1611
1612.RE
1613
1614.SH EXAMPLES
1615.LP
1616\fBExample 1 \fRCreating a RAID-Z Storage Pool
1617.sp
1618.LP
1619The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
1620
1621.sp
1622.in +2
1623.nf
54e5f226 1624# \fBzpool create tank raidz sda sdb sdc sdd sde sdf\fR
058ac9ba
BB
1625.fi
1626.in -2
1627.sp
1628
1629.LP
1630\fBExample 2 \fRCreating a Mirrored Storage Pool
1631.sp
1632.LP
1633The following command creates a pool with two mirrors, where each mirror contains two disks.
1634
1635.sp
1636.in +2
1637.nf
54e5f226 1638# \fBzpool create tank mirror sda sdb mirror sdc sdd\fR
058ac9ba
BB
1639.fi
1640.in -2
1641.sp
1642
1643.LP
54e5f226 1644\fBExample 3 \fRCreating a ZFS Storage Pool by Using Partitions
058ac9ba
BB
1645.sp
1646.LP
54e5f226 1647The following command creates an unmirrored pool using two disk partitions.
058ac9ba
BB
1648
1649.sp
1650.in +2
1651.nf
54e5f226 1652# \fBzpool create tank sda1 sdb2\fR
058ac9ba
BB
1653.fi
1654.in -2
1655.sp
1656
1657.LP
1658\fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
1659.sp
1660.LP
1661The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
1662
1663.sp
1664.in +2
1665.nf
1666# \fBzpool create tank /path/to/file/a /path/to/file/b\fR
1667.fi
1668.in -2
1669.sp
1670
1671.LP
1672\fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
1673.sp
1674.LP
6b92390f 1675The following command adds two mirrored disks to the pool \fItank\fR, assuming the pool is already made up of two-way mirrors. The additional space is immediately available to any datasets within the pool.
058ac9ba
BB
1676
1677.sp
1678.in +2
1679.nf
54e5f226 1680# \fBzpool add tank mirror sda sdb\fR
058ac9ba
BB
1681.fi
1682.in -2
1683.sp
1684
1685.LP
1686\fBExample 6 \fRListing Available ZFS Storage Pools
1687.sp
1688.LP
1689The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
1690
1691.sp
1692.LP
1693The results from this command are similar to the following:
1694
1695.sp
1696.in +2
1697.nf
1698# \fBzpool list\fR
1bd201e7
CS
1699 NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT
1700 rpool 19.9G 8.43G 11.4G - 42% 1.00x ONLINE -
1701 tank 61.5G 20.0G 41.5G - 32% 1.00x ONLINE -
1702 zion - - - - - - FAULTED -
058ac9ba
BB
1703.fi
1704.in -2
1705.sp
1706
1707.LP
1708\fBExample 7 \fRDestroying a ZFS Storage Pool
1709.sp
1710.LP
6b92390f 1711The following command destroys the pool \fItank\fR and any datasets contained within.
058ac9ba
BB
1712
1713.sp
1714.in +2
1715.nf
1716# \fBzpool destroy -f tank\fR
1717.fi
1718.in -2
1719.sp
1720
1721.LP
1722\fBExample 8 \fRExporting a ZFS Storage Pool
1723.sp
1724.LP
1725The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
1726
1727.sp
1728.in +2
1729.nf
1730# \fBzpool export tank\fR
1731.fi
1732.in -2
1733.sp
1734
1735.LP
1736\fBExample 9 \fRImporting a ZFS Storage Pool
1737.sp
1738.LP
6b92390f 1739The following command displays available pools, and then imports the pool \fItank\fR for use on the system.
058ac9ba
BB
1740
1741.sp
1742.LP
1743The results from this command are similar to the following:
1744
1745.sp
1746.in +2
1747.nf
1748# \fBzpool import\fR
1749 pool: tank
1750 id: 15451357997522795478
1751 state: ONLINE
1752action: The pool can be imported using its name or numeric identifier.
1753config:
1754
1755 tank ONLINE
1756 mirror ONLINE
54e5f226
RL
1757 sda ONLINE
1758 sdb ONLINE
058ac9ba
BB
1759
1760# \fBzpool import tank\fR
1761.fi
1762.in -2
1763.sp
1764
1765.LP
1766\fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
1767.sp
1768.LP
1769The following command upgrades all ZFS Storage pools to the current version of the software.
1770
1771.sp
1772.in +2
1773.nf
1774# \fBzpool upgrade -a\fR
251eb26d 1775This system is currently running ZFS pool version 28.
058ac9ba
BB
1776.fi
1777.in -2
1778.sp
1779
1780.LP
1781\fBExample 11 \fRManaging Hot Spares
1782.sp
1783.LP
1784The following command creates a new pool with an available hot spare:
1785
1786.sp
1787.in +2
1788.nf
54e5f226 1789# \fBzpool create tank mirror sda sdb spare sdc\fR
058ac9ba
BB
1790.fi
1791.in -2
1792.sp
1793
1794.sp
1795.LP
1796If one of the disks were to fail, the pool would be reduced to the degraded state. The failed device can be replaced using the following command:
1797
1798.sp
1799.in +2
1800.nf
54e5f226 1801# \fBzpool replace tank sda sdd\fR
058ac9ba
BB
1802.fi
1803.in -2
1804.sp
1805
1806.sp
1807.LP
0d122e21 1808Once the data has been resilvered, the spare is automatically removed and is made available for use should another device fails. The hot spare can be permanently removed from the pool using the following command:
058ac9ba
BB
1809
1810.sp
1811.in +2
1812.nf
54e5f226 1813# \fBzpool remove tank sdc\fR
058ac9ba
BB
1814.fi
1815.in -2
1816.sp
1817
1818.LP
1819\fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
1820.sp
1821.LP
1822The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
1823
1824.sp
1825.in +2
1826.nf
54e5f226
RL
1827# \fBzpool create pool mirror sda sdb mirror sdc sdd log mirror \e
1828 sde sdf\fR
058ac9ba
BB
1829.fi
1830.in -2
1831.sp
1832
1833.LP
1834\fBExample 13 \fRAdding Cache Devices to a ZFS Pool
1835.sp
1836.LP
1837The following command adds two disks for use as cache devices to a ZFS storage pool:
1838
1839.sp
1840.in +2
1841.nf
54e5f226 1842# \fBzpool add pool cache sdc sdd\fR
058ac9ba
BB
1843.fi
1844.in -2
1845.sp
1846
1847.sp
1848.LP
1849Once added, the cache devices gradually fill with content from main memory. Depending on the size of your cache devices, it could take over an hour for them to fill. Capacity and reads can be monitored using the \fBiostat\fR option as follows:
1850
1851.sp
1852.in +2
1853.nf
1854# \fBzpool iostat -v pool 5\fR
1855.fi
1856.in -2
1857.sp
1858
1859.LP
1860\fBExample 14 \fRRemoving a Mirrored Log Device
1861.sp
1862.LP
1863The following command removes the mirrored log device \fBmirror-2\fR.
1864
1865.sp
1866.LP
1867Given this configuration:
1868
1869.sp
1870.in +2
1871.nf
1872 pool: tank
1873 state: ONLINE
1874 scrub: none requested
1875config:
1876
1877 NAME STATE READ WRITE CKSUM
1878 tank ONLINE 0 0 0
1879 mirror-0 ONLINE 0 0 0
54e5f226
RL
1880 sda ONLINE 0 0 0
1881 sdb ONLINE 0 0 0
058ac9ba 1882 mirror-1 ONLINE 0 0 0
54e5f226
RL
1883 sdc ONLINE 0 0 0
1884 sdd ONLINE 0 0 0
058ac9ba
BB
1885 logs
1886 mirror-2 ONLINE 0 0 0
54e5f226
RL
1887 sde ONLINE 0 0 0
1888 sdf ONLINE 0 0 0
058ac9ba
BB
1889.fi
1890.in -2
1891.sp
1892
1893.sp
1894.LP
1895The command to remove the mirrored log \fBmirror-2\fR is:
1896
1897.sp
1898.in +2
1899.nf
1900# \fBzpool remove tank mirror-2\fR
1901.fi
1902.in -2
1903.sp
1904
1bd201e7
CS
1905.LP
1906\fBExample 15 \fRDisplaying expanded space on a device
1907.sp
1908.LP
1909The following command dipslays the detailed information for the \fIdata\fR
1910pool. This pool is comprised of a single \fIraidz\fR vdev where one of its
1911devices increased its capacity by 1GB. In this example, the pool will not
1912be able to utilized this extra capacity until all the devices under the
1913\fIraidz\fR vdev have been expanded.
1914
1915.sp
1916.in +2
1917.nf
1918# \fBzpool list -v data\fR
1919 NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT
1920 data 17.9G 174K 17.9G - 0% 1.00x ONLINE -
1921 raidz1 17.9G 174K 17.9G -
1922 c4t2d0 - - - 1G
1923 c4t3d0 - - - -
1924 c4t4d0 - - - -
1925.fi
1926.in -2
1927
058ac9ba
BB
1928.SH EXIT STATUS
1929.sp
1930.LP
1931The following exit values are returned:
1932.sp
1933.ne 2
1934.mk
1935.na
1936\fB\fB0\fR\fR
1937.ad
1938.RS 5n
1939.rt
1940Successful completion.
1941.RE
1942
1943.sp
1944.ne 2
1945.mk
1946.na
1947\fB\fB1\fR\fR
1948.ad
1949.RS 5n
1950.rt
1951An error occurred.
1952.RE
1953
1954.sp
1955.ne 2
1956.mk
1957.na
1958\fB\fB2\fR\fR
1959.ad
1960.RS 5n
1961.rt
1962Invalid command line options were specified.
1963.RE
1964
058ac9ba
BB
1965.SH SEE ALSO
1966.sp
1967.LP
4da4a9e1 1968\fBzfs\fR(8)