]> git.proxmox.com Git - mirror_zfs.git/blame - man/man8/zpool.8
Man page white space and spelling corrections
[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.
f3a7f661 4.\" Copyright (c) 2013 by Delphix. All rights reserved.
df831108 5.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
9ae529ec
CS
6.\" The contents of this file are subject to the terms of the Common Development
7.\" and Distribution License (the "License"). You may not use this file except
8.\" in compliance with the License. You can obtain a copy of the license at
9.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
10.\"
11.\" See the License for the specific language governing permissions and
12.\" limitations under the License. When distributing Covered Code, include this
13.\" CDDL HEADER in each file and include the License file at
14.\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this
15.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
16.\" own identifying information:
17.\" Portions Copyright [yyyy] [name of copyright owner]
18.TH zpool 8 "14 December 2012" "ZFS pool 28, filesystem 5" "System Administration Commands"
058ac9ba
BB
19.SH NAME
20zpool \- configures ZFS storage pools
21.SH SYNOPSIS
22.LP
23.nf
24\fBzpool\fR [\fB-?\fR]
25.fi
26
27.LP
28.nf
df831108 29\fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...
058ac9ba
BB
30.fi
31
32.LP
33.nf
df831108 34\fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
058ac9ba
BB
35.fi
36
37.LP
38.nf
39\fBzpool clear\fR \fIpool\fR [\fIdevice\fR]
40.fi
41
42.LP
43.nf
9ae529ec 44\fBzpool create\fR [\fB-fnd\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR]
83e9986f 45 ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] [\fB-t\fR \fItname\fR] \fIpool\fR \fIvdev\fR ...
058ac9ba
BB
46.fi
47
48.LP
49.nf
50\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
51.fi
52
53.LP
54.nf
55\fBzpool detach\fR \fIpool\fR \fIdevice\fR
56.fi
57
d050c627
TF
58.LP
59.nf
60\fBzpool events\fR [\fB-vHfc\fR] [\fIpool\fR] ...
61.fi
62
058ac9ba
BB
63.LP
64.nf
859735c0 65\fBzpool export\fR [\fB-a\fR] [\fB-f\fR] \fIpool\fR ...
058ac9ba
BB
66.fi
67
68.LP
69.nf
79eb71dc 70\fBzpool get\fR [\fB-pH\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
058ac9ba
BB
71.fi
72
73.LP
74.nf
75\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...
76.fi
77
78.LP
79.nf
80\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
81.fi
82
83.LP
84.nf
7f9d9946 85\fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
21b446a7 86 [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR] [\fB-X\fR\] [\fB-T\fR\]] \fB-a\fR
058ac9ba
BB
87.fi
88
89.LP
90.nf
91\fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
21b446a7 92 [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR] [\fB-X\fR] [\fB-T\fR\]] [\fB-t\fR]] \fIpool\fR |\fIid\fR [\fInewpool\fR]
058ac9ba
BB
93.fi
94
95.LP
96.nf
41092124 97\fBzpool iostat\fR [\fB-T\fR d | u ] [\fB-v\fR] [\fB-y\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
058ac9ba
BB
98.fi
99
131cc95c
DK
100.LP
101.nf
102\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
103.fi
104
058ac9ba
BB
105.LP
106.nf
2e2ddc30
TC
107\fBzpool list\fR [\fB-T\fR d | u ] [\fB-Hv\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
108 [\fIinterval\fR[\fIcount\fR]]
058ac9ba
BB
109.fi
110
111.LP
112.nf
113\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
114.fi
115
116.LP
117.nf
118\fBzpool online\fR \fIpool\fR \fIdevice\fR ...
119.fi
120
3541dc6d
GA
121.LP
122.nf
123\fBzpool reguid\fR \fIpool\fR
124.fi
125
5853fe79
GW
126.LP
127.nf
128\fBzpool reopen\fR \fIpool\fR
129.fi
130
058ac9ba
BB
131.LP
132.nf
133\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...
134.fi
135
136.LP
137.nf
628668a3 138\fBzpool replace\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR [\fInew_device\fR]
058ac9ba
BB
139.fi
140
141.LP
142.nf
143\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
144.fi
145
146.LP
147.nf
148\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR
149.fi
150
fb827006
SB
151.LP
152.nf
52e68edc 153\fBzpool split\fR [\fB-n\fR] [\fB-R\fR \fIaltroot\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fInewpool\fR [\fIdevice\fR ...]
fb827006
SB
154.fi
155
058ac9ba
BB
156.LP
157.nf
2e2ddc30 158\fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR d | u] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
058ac9ba
BB
159.fi
160
161.LP
162.nf
6b4e21c6 163\fBzpool upgrade\fR
058ac9ba
BB
164.fi
165
166.LP
167.nf
168\fBzpool upgrade\fR \fB-v\fR
169.fi
170
171.LP
172.nf
173\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...
174.fi
175
176.SH DESCRIPTION
177.sp
178.LP
179The \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.
180.sp
181.LP
2d1b7b0b 182All datasets within a storage pool share the same space. See \fBzfs\fR(8) for information on managing datasets.
058ac9ba
BB
183.SS "Virtual Devices (\fBvdev\fRs)"
184.sp
185.LP
186A "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:
187.sp
188.ne 2
189.mk
190.na
191\fB\fBdisk\fR\fR
192.ad
193.RS 10n
6b4e21c6 194.rt
25d4782b 195A 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
196.RE
197
198.sp
199.ne 2
200.mk
201.na
202\fB\fBfile\fR\fR
203.ad
204.RS 10n
6b4e21c6 205.rt
058ac9ba
BB
206A 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.
207.RE
208
209.sp
210.ne 2
211.mk
212.na
213\fB\fBmirror\fR\fR
214.ad
215.RS 10n
6b4e21c6 216.rt
058ac9ba
BB
217A 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.
218.RE
219
220.sp
221.ne 2
222.mk
223.na
224\fB\fBraidz\fR\fR
225.ad
226.br
227.na
228\fB\fBraidz1\fR\fR
229.ad
230.br
231.na
232\fB\fBraidz2\fR\fR
233.ad
234.br
235.na
236\fB\fBraidz3\fR\fR
237.ad
238.RS 10n
6b4e21c6 239.rt
058ac9ba
BB
240A 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.
241.sp
242A \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.
243.sp
244A \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.
245.RE
246
247.sp
248.ne 2
249.mk
250.na
251\fB\fBspare\fR\fR
252.ad
253.RS 10n
6b4e21c6 254.rt
058ac9ba
BB
255A special pseudo-\fBvdev\fR which keeps track of available hot spares for a pool. For more information, see the "Hot Spares" section.
256.RE
257
258.sp
259.ne 2
260.mk
261.na
262\fB\fBlog\fR\fR
263.ad
264.RS 10n
6b4e21c6 265.rt
058ac9ba
BB
266A 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.
267.RE
268
269.sp
270.ne 2
271.mk
272.na
273\fB\fBcache\fR\fR
274.ad
275.RS 10n
6b4e21c6 276.rt
15313c5e 277A device used to cache storage pool data. A cache device cannot be configured as a mirror or \fBraidz\fR group. For more information, see the "Cache Devices" section.
058ac9ba
BB
278.RE
279
280.sp
281.LP
282Virtual 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.
283.sp
284.LP
285A 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.
286.sp
287.LP
288Virtual 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:
289.sp
290.in +2
291.nf
54e5f226 292# \fBzpool create mypool mirror sda sdb mirror sdc sdd\fR
058ac9ba
BB
293.fi
294.in -2
295.sp
296
297.SS "Device Failure and Recovery"
298.sp
299.LP
300\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.
301.sp
302.LP
303In 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.
304.sp
305.LP
6b4e21c6 306A 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.
058ac9ba
BB
307.sp
308.LP
309The 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:
310.sp
311.ne 2
312.mk
313.na
314\fB\fBDEGRADED\fR\fR
315.ad
316.RS 12n
6b4e21c6 317.rt
058ac9ba
BB
318One or more top-level vdevs is in the degraded state because one or more component devices are offline. Sufficient replicas exist to continue functioning.
319.sp
320One or more component devices is in the degraded or faulted state, but sufficient replicas exist to continue functioning. The underlying conditions are as follows:
321.RS +4
322.TP
323.ie t \(bu
324.el o
325The 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.
326.RE
327.RS +4
328.TP
329.ie t \(bu
330.el o
331The number of I/O errors exceeds acceptable levels. The device could not be marked as faulted because there are insufficient replicas to continue functioning.
332.RE
333.RE
334
335.sp
336.ne 2
337.mk
338.na
339\fB\fBFAULTED\fR\fR
340.ad
341.RS 12n
6b4e21c6
NB
342.rt
343One or more top-level vdevs is in the faulted state because one or more component devices are offline. Insufficient replicas exist to continue functioning.
058ac9ba
BB
344.sp
345One or more component devices is in the faulted state, and insufficient replicas exist to continue functioning. The underlying conditions are as follows:
346.RS +4
347.TP
348.ie t \(bu
349.el o
6b4e21c6 350The device could be opened, but the contents did not match expected values.
058ac9ba
BB
351.RE
352.RS +4
353.TP
354.ie t \(bu
355.el o
356The number of I/O errors exceeds acceptable levels and the device is faulted to prevent further use of the device.
357.RE
358.RE
359
360.sp
361.ne 2
362.mk
363.na
364\fB\fBOFFLINE\fR\fR
365.ad
366.RS 12n
6b4e21c6 367.rt
058ac9ba
BB
368The device was explicitly taken offline by the "\fBzpool offline\fR" command.
369.RE
370
371.sp
372.ne 2
373.mk
374.na
375\fB\fBONLINE\fR\fR
376.ad
377.RS 12n
6b4e21c6 378.rt
058ac9ba
BB
379The device is online and functioning.
380.RE
381
382.sp
383.ne 2
384.mk
385.na
386\fB\fBREMOVED\fR\fR
387.ad
388.RS 12n
6b4e21c6 389.rt
058ac9ba
BB
390The device was physically removed while the system was running. Device removal detection is hardware-dependent and may not be supported on all platforms.
391.RE
392
393.sp
394.ne 2
395.mk
396.na
397\fB\fBUNAVAIL\fR\fR
398.ad
399.RS 12n
6b4e21c6 400.rt
058ac9ba
BB
401The 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.
402.RE
403
404.sp
405.LP
406If 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.
407.SS "Hot Spares"
408.sp
409.LP
6b4e21c6 410\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,
058ac9ba
BB
411.sp
412.in +2
413.nf
54e5f226 414# zpool create pool mirror sda sdb spare sdc sdd
058ac9ba
BB
415.fi
416.in -2
417.sp
418
419.sp
420.LP
0d122e21 421Spares 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
422.sp
423.LP
424If 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.
425.sp
426.LP
427An 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.
428.sp
429.LP
430Spares cannot replace log devices.
431.SS "Intent Log"
432.sp
433.LP
434The \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:
435.sp
436.in +2
437.nf
54e5f226 438\fB# zpool create pool sda sdb log sdc\fR
058ac9ba
BB
439.fi
440.in -2
441.sp
442
443.sp
444.LP
445Multiple log devices can also be specified, and they can be mirrored. See the EXAMPLES section for an example of mirroring multiple log devices.
446.sp
447.LP
448Log 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.
449.SS "Cache Devices"
450.sp
451.LP
452Devices 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.
453.sp
454.LP
455To create a pool with cache devices, specify a "cache" \fBvdev\fR with any number of devices. For example:
456.sp
457.in +2
458.nf
54e5f226 459\fB# zpool create pool sda sdb cache sdc sdd\fR
058ac9ba
BB
460.fi
461.in -2
462.sp
463
464.sp
465.LP
466Cache 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.
467.sp
468.LP
469The content of the cache devices is considered volatile, as is the case with other system caches.
470.SS "Properties"
471.sp
472.LP
473Each 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:
474.sp
475.ne 2
476.mk
477.na
478\fB\fBavailable\fR\fR
479.ad
480.RS 20n
6b4e21c6 481.rt
058ac9ba
BB
482Amount of storage available within the pool. This property can also be referred to by its shortened column name, "avail".
483.RE
484
485.sp
486.ne 2
487.mk
488.na
489\fB\fBcapacity\fR\fR
490.ad
491.RS 20n
6b4e21c6 492.rt
058ac9ba
BB
493Percentage of pool space used. This property can also be referred to by its shortened column name, "cap".
494.RE
495
d96eb2b1
DM
496.sp
497.ne 2
498.mk
499.na
9ae529ec 500\fB\fBexpandsize\fR\fR
d96eb2b1
DM
501.ad
502.RS 20n
e2e229eb 503.rt
9ae529ec
CS
504Amount of uninitialized space within the pool or device that can be used to
505increase the total capacity of the pool. Uninitialized space consists of
506any space on an EFI labeled vdev which has not been brought online
507(i.e. zpool online -e). This space occurs when a LUN is dynamically expanded.
d96eb2b1
DM
508.RE
509
f3a7f661
GW
510.sp
511.ne 2
512.mk
513.na
514\fB\fBfragmentation\fR\fR
515.ad
516.RS 20n
517.rt
518The amount of fragmentation in the pool.
519.RE
520
058ac9ba
BB
521.sp
522.ne 2
e2e229eb 523.mk
058ac9ba 524.na
9ae529ec 525\fB\fBfree\fR\fR
1bd201e7
CS
526.ad
527.RS 20n
e2e229eb 528.rt
9ae529ec
CS
529The amount of free space available in the pool.
530.RE
531
532.sp
533.ne 2
e2e229eb 534.mk
9ae529ec
CS
535.na
536\fB\fBfreeing\fR\fR
537.ad
538.RS 20n
e2e229eb 539.rt
9ae529ec
CS
540After a file system or snapshot is destroyed, the space it was using is
541returned to the pool asynchronously. \fB\fBfreeing\fR\fR is the amount of
542space remaining to be reclaimed. Over time \fB\fBfreeing\fR\fR will decrease
543while \fB\fBfree\fR\fR increases.
1bd201e7
CS
544.RE
545
546.sp
547.ne 2
e2e229eb 548.mk
1bd201e7 549.na
058ac9ba
BB
550\fB\fBhealth\fR\fR
551.ad
552.RS 20n
6b4e21c6 553.rt
058ac9ba
BB
554The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR", "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
555.RE
556
557.sp
558.ne 2
559.mk
560.na
561\fB\fBguid\fR\fR
562.ad
563.RS 20n
6b4e21c6 564.rt
058ac9ba
BB
565A unique identifier for the pool.
566.RE
567
568.sp
569.ne 2
570.mk
571.na
572\fB\fBsize\fR\fR
573.ad
574.RS 20n
6b4e21c6 575.rt
058ac9ba
BB
576Total size of the storage pool.
577.RE
578
9ae529ec
CS
579.sp
580.ne 2
e2e229eb 581.mk
9ae529ec
CS
582.na
583\fB\fBunsupported@\fR\fIfeature_guid\fR\fR
584.ad
585.RS 20n
e2e229eb 586.rt
1567e075 587.sp
9ae529ec
CS
588Information about unsupported features that are enabled on the pool. See
589\fBzpool-features\fR(5) for details.
590.RE
591
058ac9ba
BB
592.sp
593.ne 2
594.mk
595.na
596\fB\fBused\fR\fR
597.ad
598.RS 20n
6b4e21c6 599.rt
058ac9ba
BB
600Amount of storage space used within the pool.
601.RE
602
603.sp
604.LP
9ae529ec 605The 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
606
607.sp
608.LP
609The following property can be set at creation time:
610.sp
611.ne 2
612.mk
613.na
614\fB\fBashift\fR\fR
615.ad
616.sp .6
617.RS 4n
618Pool 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).
619.LP
620For 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.
022f7bf6
TF
621.LP
622Keep in mind is that the \fBashift\fR is \fIvdev\fR specific and is not a \fIpool\fR global. This means that when adding new vdevs to an existing pool you may need to specify the \fBashift\fR.
df30f566
CK
623.RE
624
058ac9ba
BB
625.sp
626.LP
627The following property can be set at creation time and import time:
628.sp
629.ne 2
630.mk
631.na
632\fB\fBaltroot\fR\fR
633.ad
634.sp .6
635.RS 4n
57746821 636Alternate 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
637.RE
638
52dd454d
TC
639.sp
640.LP
641The following property can only be set at import time:
642.sp
643.ne 2
644.mk
645.na
646\fB\fBreadonly\fR=\fBon\fR | \fBoff\fR\fR
647.ad
648.sp .6
649.RS 4n
650If set to \fBon\fR, the pool will be imported in read-only mode: Synchronous data in the intent log will not be accessible, properties of the pool can not be changed and datasets of the pool can only be mounted read-only. The \fBreadonly\fR property of its datasets will be implicitly set to \fBon\fR.
651
652It can also be specified by its column name of \fBrdonly\fR.
653
654To write to a read-only pool, a export and import of the pool is required.
655.RE
656
058ac9ba
BB
657.sp
658.LP
659The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
660.sp
661.ne 2
662.mk
663.na
664\fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
665.ad
666.sp .6
667.RS 4n
668Controls 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.
669.RE
670
671.sp
672.ne 2
673.mk
674.na
675\fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
676.ad
677.sp .6
678.RS 4n
679Controls 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".
680.RE
681
682.sp
683.ne 2
684.mk
685.na
686\fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
687.ad
688.sp .6
689.RS 4n
690Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
691.RE
692
693.sp
694.ne 2
695.mk
696.na
697\fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
698.ad
699.sp .6
700.RS 4n
6b4e21c6 701Controls 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.
058ac9ba
BB
702.sp
703Multiple 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.
704.RE
705
9ae529ec
CS
706.sp
707.ne 2
708.mk
709.na
710\fB\fBcomment\fR=\fB\fItext\fR\fR
711.ad
712.sp .6
713.RS 4n
714A 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.
715.RE
716
b1d13a60
TC
717.sp
718.ne 2
719.mk
720.na
721\fB\fBdedupditto\fR=\fB\fInumber\fR\fR
722.ad
723.sp .6
724.RS 4n
6b4e21c6 725Threshold for the number of block ditto copies. If the reference count for a deduplicated block increases above this number, a new ditto copy of this block is automatically stored. The default setting is 0 which causes no ditto copies to be created for deduplicated blocks. The minimum legal nonzero setting is 100.
b1d13a60
TC
726.RE
727
058ac9ba
BB
728.sp
729.ne 2
730.mk
731.na
732\fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
733.ad
734.sp .6
735.RS 4n
2d1b7b0b 736Controls 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
737.RE
738
739.sp
740.ne 2
741.mk
742.na
743\fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
744.ad
745.sp .6
746.RS 4n
747Controls 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:
748.sp
749.ne 2
750.mk
751.na
752\fB\fBwait\fR\fR
753.ad
754.RS 12n
6b4e21c6 755.rt
058ac9ba
BB
756Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
757.RE
758
759.sp
760.ne 2
761.mk
762.na
763\fB\fBcontinue\fR\fR
764.ad
765.RS 12n
6b4e21c6 766.rt
058ac9ba
BB
767Returns \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.
768.RE
769
770.sp
771.ne 2
772.mk
773.na
774\fB\fBpanic\fR\fR
775.ad
776.RS 12n
6b4e21c6 777.rt
058ac9ba
BB
778Prints out a message to the console and generates a system crash dump.
779.RE
780
781.RE
782
9ae529ec
CS
783.sp
784.ne 2
785.na
786\fB\fBfeature@\fR\fIfeature_name\fR=\fBenabled\fR\fR
787.ad
788.RS 4n
789The value of this property is the current state of \fIfeature_name\fR. The
790only valid value when setting this property is \fBenabled\fR which moves
791\fIfeature_name\fR to the enabled state. See \fBzpool-features\fR(5) for
792details on feature states.
793.RE
794
058ac9ba
BB
795.sp
796.ne 2
797.mk
798.na
799\fB\fBlistsnaps\fR=on | off\fR
800.ad
801.sp .6
802.RS 4n
803Controls 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".
804.RE
805
806.sp
807.ne 2
808.mk
809.na
810\fB\fBversion\fR=\fIversion\fR\fR
811.ad
812.sp .6
813.RS 4n
9ae529ec 814The 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. Once feature flags are enabled on a pool this property will no longer have a value.
058ac9ba
BB
815.RE
816
817.SS "Subcommands"
818.sp
819.LP
820All subcommands that modify state are logged persistently to the pool in their original form.
821.sp
822.LP
823The \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:
824.sp
825.ne 2
826.mk
827.na
828\fB\fBzpool\fR \fB-?\fR\fR
829.ad
830.sp .6
831.RS 4n
832Displays a help message.
833.RE
834
835.sp
836.ne 2
837.mk
838.na
df831108 839\fB\fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...\fR
058ac9ba
BB
840.ad
841.sp .6
842.RS 4n
843Adds 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.
844.sp
845.ne 2
846.mk
847.na
848\fB\fB-f\fR\fR
849.ad
850.RS 6n
6b4e21c6 851.rt
058ac9ba
BB
852Forces 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.
853.RE
854
855.sp
856.ne 2
857.mk
858.na
859\fB\fB-n\fR\fR
860.ad
861.RS 6n
6b4e21c6 862.rt
058ac9ba
BB
863Displays 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.
864.RE
865
df831108
CP
866.sp
867.ne 2
868.mk
869.na
870\fB\fB-o\fR \fIproperty=value\fR
871.ad
872.sp .6
873.RS 4n
022f7bf6 874Sets 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 \fBashift\fR. \fBDo note\fR that some properties (among them \fBashift\fR) are \fInot\fR inherited from a previous vdev. They are vdev specific, not pool specific.
df831108
CP
875.RE
876
058ac9ba
BB
877Do 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.
878.RE
879
880.sp
881.ne 2
882.mk
883.na
df831108 884\fB\fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
058ac9ba
BB
885.ad
886.sp .6
887.RS 4n
888Attaches \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.
889.sp
890.ne 2
891.mk
892.na
893\fB\fB-f\fR\fR
894.ad
895.RS 6n
6b4e21c6 896.rt
058ac9ba
BB
897Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
898.RE
899
df831108
CP
900.sp
901.ne 2
902.mk
903.na
904\fB\fB-o\fR \fIproperty=value\fR
905.ad
906.sp .6
907.RS 4n
908Sets 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".
909.RE
910
058ac9ba
BB
911.RE
912
913.sp
914.ne 2
915.mk
916.na
917\fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
918.ad
919.sp .6
920.RS 4n
921Clears 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.
922.RE
923
924.sp
925.ne 2
926.mk
927.na
83e9986f 928\fB\fBzpool create\fR [\fB-fnd\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] [\fB-t\fR \fItname\fR] \fIpool\fR \fIvdev\fR ...\fR
058ac9ba
BB
929.ad
930.sp .6
931.RS 4n
e6101ea8 932Creates 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
933.sp
934The 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.
935.sp
936The 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.
937.sp
938Unless 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.
939.sp
9ae529ec
CS
940By default all supported features are enabled on the new pool unless the \fB-d\fR option is specified.
941.sp
058ac9ba
BB
942.ne 2
943.mk
944.na
945\fB\fB-f\fR\fR
946.ad
947.sp .6
948.RS 4n
949Forces 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.
950.RE
951
952.sp
953.ne 2
954.mk
955.na
956\fB\fB-n\fR\fR
957.ad
958.sp .6
959.RS 4n
960Displays 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.
961.RE
962
963.sp
964.ne 2
965.mk
966.na
9ae529ec
CS
967\fB\fB-d\fR\fR
968.ad
969.sp .6
970.RS 4n
971Do not enable any features on the new pool. Individual features can be enabled by setting their corresponding properties to \fBenabled\fR with the \fB-o\fR option. See \fBzpool-features\fR(5) for details about feature properties.
972.RE
973
974.sp
975.ne 2
976.na
058ac9ba
BB
977\fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
978.ad
979.sp .6
980.RS 4n
981Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
982.RE
983
984.sp
985.ne 2
986.mk
987.na
988\fB\fB-O\fR \fIfile-system-property=value\fR\fR
989.ad
990.br
991.na
992\fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
993.ad
994.sp .6
995.RS 4n
2d1b7b0b 996Sets 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
997.RE
998
999.sp
1000.ne 2
1001.mk
1002.na
1003\fB\fB-R\fR \fIroot\fR\fR
1004.ad
1005.sp .6
1006.RS 4n
1007Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
1008.RE
1009
1010.sp
1011.ne 2
1012.mk
1013.na
1014\fB\fB-m\fR \fImountpoint\fR\fR
1015.ad
1016.sp .6
1017.RS 4n
2d1b7b0b 1018Sets 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
1019.RE
1020
83e9986f
RY
1021.sp
1022.ne 2
1023.mk
1024.na
1025\fB\fB-t\fR \fItname\fR\fR
1026.ad
1027.sp .6
1028.RS 4n
1029Sets the in-core pool name to "\fBtname\fR" while the on-disk name will be the name specified as the pool name "\fBpool\fR". This will set the default cachefile property to none. This is intended to handle name space collisions when creating pools for other systems, such as virtual machines or physical machines whose pools live on network block devices.
1030.RE
1031
058ac9ba
BB
1032.RE
1033
1034.sp
1035.ne 2
1036.mk
1037.na
1038\fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
1039.ad
1040.sp .6
1041.RS 4n
1042Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
1043.sp
1044.ne 2
1045.mk
1046.na
1047\fB\fB-f\fR\fR
1048.ad
1049.RS 6n
6b4e21c6 1050.rt
058ac9ba
BB
1051Forces any active datasets contained within the pool to be unmounted.
1052.RE
1053
1054.RE
1055
1056.sp
1057.ne 2
1058.mk
1059.na
1060\fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
1061.ad
1062.sp .6
1063.RS 4n
65ee05ac 1064Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data. If \fIdevice\fR may be re-added to the pool later on then consider the "\fBzpool offline\fR" command instead.
058ac9ba
BB
1065.RE
1066
859735c0
TF
1067.RE
1068
d050c627
TF
1069.sp
1070.ne 2
1071.mk
1072.na
1073\fBzpool events\fR [\fB-vHfc\fR] [\fIpool\fR] ...
1074.ad
1075.sp .6
1076.RS 4n
1077Description of the different events generated by the ZFS kernel modules. See \fBzfs-events\fR(5) for more information about the subclasses and event payloads that can be generated.
1078
1079.sp
1080.ne 2
1081.mk
1082.na
1083\fB\fB-v\fR\fR
1084.ad
1085.RS 6n
1086.rt
1087Get a full detail of the events and what information is available about it.
1088.RE
1089
1090.sp
1091.ne 2
1092.mk
1093.na
1094\fB\fB-H\fR\fR
1095.ad
1096.RS 6n
1097.rt
1098Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1099.RE
1100
1101.sp
1102.ne 2
1103.mk
1104.na
1105\fB\fB-f\fR\fR
1106.ad
1107.RS 6n
1108.rt
1109Follow mode.
1110.RE
1111
1112.sp
1113.ne 2
1114.mk
1115.na
1116\fB\fB-c\fR\fR
1117.ad
1118.RS 6n
1119.rt
1120Clear all previous events.
1121.RE
1122
1123.RE
1124
058ac9ba
BB
1125.sp
1126.ne 2
1127.mk
1128.na
859735c0 1129\fB\fBzpool export\fR [\fB-a\fR] [\fB-f\fR] \fIpool\fR ...\fR
058ac9ba
BB
1130.ad
1131.sp .6
1132.RS 4n
1133Exports 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.
1134.sp
1135Before 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.
1136.sp
25d4782b 1137For 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.
859735c0
TF
1138.sp
1139.ne 2
1140.mk
1141.na
1142\fB\fB-a\fR\fR
1143.ad
1144.RS 6n
1145.rt
1146Exports all pools imported on the system.
1147.RE
1148
058ac9ba
BB
1149.sp
1150.ne 2
1151.mk
1152.na
1153\fB\fB-f\fR\fR
1154.ad
1155.RS 6n
859735c0 1156.rt
058ac9ba
BB
1157Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
1158.sp
1159This 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.
1160.RE
1161
1162.RE
1163
1164.sp
1165.ne 2
1166.mk
1167.na
d65e7381 1168\fB\fBzpool get\fR [\fB-p\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
058ac9ba
BB
1169.ad
1170.sp .6
1171.RS 4n
1172Retrieves 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:
1173.sp
1174.in +2
1175.nf
1176 name Name of storage pool
1177 property Property name
1178 value Property value
1179 source Property source, either 'default' or 'local'.
1180.fi
1181.in -2
1182.sp
1183
1184See the "Properties" section for more information on the available pool properties.
d65e7381
RE
1185.sp
1186.ne 2
1187.mk
1188.na
1189\fB\fB-p\fR\fR
1190.ad
1191.RS 6n
1192.rt
1193Display numbers in parseable (exact) values.
1194.RE
1195
79eb71dc
TF
1196.sp
1197.ne 2
1198.mk
1199.na
1200\fB\fB-H\fR\fR
1201.ad
1202.RS 6n
1203.rt
1204Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1205.RE
1206
058ac9ba
BB
1207.RE
1208
1209.sp
1210.ne 2
1211.mk
1212.na
1213\fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
1214.ad
1215.sp .6
1216.RS 4n
1217Displays the command history of the specified pools or all pools if no pool is specified.
1218.sp
1219.ne 2
1220.mk
1221.na
1222\fB\fB-i\fR\fR
1223.ad
1224.RS 6n
6b4e21c6 1225.rt
058ac9ba
BB
1226Displays internally logged \fBZFS\fR events in addition to user initiated events.
1227.RE
1228
1229.sp
1230.ne 2
1231.mk
1232.na
1233\fB\fB-l\fR\fR
1234.ad
1235.RS 6n
6b4e21c6 1236.rt
058ac9ba
BB
1237Displays 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.
1238.RE
1239
1240.RE
1241
1242.sp
1243.ne 2
1244.mk
1245.na
1246\fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
1247.ad
1248.sp .6
1249.RS 4n
6b4e21c6 1250Lists 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
1251.sp
1252The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
1253.sp
1254.ne 2
1255.mk
1256.na
1257\fB\fB-c\fR \fIcachefile\fR\fR
1258.ad
1259.RS 16n
6b4e21c6 1260.rt
058ac9ba
BB
1261Reads 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.
1262.RE
1263
1264.sp
1265.ne 2
1266.mk
1267.na
1268\fB\fB-d\fR \fIdir\fR\fR
1269.ad
1270.RS 16n
6b4e21c6
NB
1271.rt
1272Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times.
058ac9ba
BB
1273.RE
1274
1275.sp
1276.ne 2
1277.mk
1278.na
1279\fB\fB-D\fR\fR
1280.ad
1281.RS 16n
6b4e21c6 1282.rt
058ac9ba
BB
1283Lists destroyed pools only.
1284.RE
1285
1286.RE
1287
1288.sp
1289.ne 2
1290.mk
1291.na
7f9d9946 1292\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
1293.ad
1294.sp .6
1295.RS 4n
1296Imports 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.
1297.sp
1298.ne 2
1299.mk
1300.na
1301\fB\fB-o\fR \fImntopts\fR\fR
1302.ad
1303.RS 21n
6b4e21c6 1304.rt
2d1b7b0b 1305Comma-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
1306.RE
1307
1308.sp
1309.ne 2
1310.mk
1311.na
1312\fB\fB-o\fR \fIproperty=value\fR\fR
1313.ad
1314.RS 21n
6b4e21c6 1315.rt
058ac9ba
BB
1316Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1317.RE
1318
1319.sp
1320.ne 2
1321.mk
1322.na
1323\fB\fB-c\fR \fIcachefile\fR\fR
1324.ad
1325.RS 21n
6b4e21c6 1326.rt
058ac9ba
BB
1327Reads 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.
1328.RE
1329
1330.sp
1331.ne 2
1332.mk
1333.na
1334\fB\fB-d\fR \fIdir\fR\fR
1335.ad
1336.RS 21n
6b4e21c6 1337.rt
058ac9ba
BB
1338Searches 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.
1339.RE
1340
1341.sp
1342.ne 2
1343.mk
1344.na
1345\fB\fB-D\fR\fR
1346.ad
1347.RS 21n
6b4e21c6 1348.rt
058ac9ba
BB
1349Imports destroyed pools only. The \fB-f\fR option is also required.
1350.RE
1351
1352.sp
1353.ne 2
1354.mk
1355.na
1356\fB\fB-f\fR\fR
1357.ad
1358.RS 21n
6b4e21c6 1359.rt
058ac9ba
BB
1360Forces import, even if the pool appears to be potentially active.
1361.RE
1362
7f9d9946
BB
1363.sp
1364.ne 2
1365.mk
1366.na
1367\fB\fB-F\fR\fR
1368.ad
1369.RS 21n
1370Recovery 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.
1371.RE
1372
058ac9ba
BB
1373.sp
1374.ne 2
1375.mk
1376.na
1377\fB\fB-a\fR\fR
1378.ad
1379.RS 21n
6b4e21c6
NB
1380.rt
1381Searches for and imports all pools found.
058ac9ba
BB
1382.RE
1383
7f9d9946
BB
1384.sp
1385.ne 2
1386.mk
1387.na
1388\fB\fB-m\fR\fR
1389.ad
1390.RS 21n
1391Allows a pool to import when there is a missing log device.
1392.RE
1393
058ac9ba
BB
1394.sp
1395.ne 2
1396.mk
1397.na
1398\fB\fB-R\fR \fIroot\fR\fR
1399.ad
1400.RS 21n
6b4e21c6 1401.rt
058ac9ba
BB
1402Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1403.RE
1404
7f9d9946
BB
1405.sp
1406.ne 2
1407.mk
1408.na
1409\fB\fB-N\fR\fR
1410.ad
1411.RS 21n
1412Import the pool without mounting any file systems.
1413.RE
1414
1415.sp
1416.ne 2
1417.mk
1418.na
1419\fB\fB-n\fR\fR
1420.ad
1421.RS 21n
1422Used 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.
1423.RE
1424
21b446a7
TF
1425.sp
1426.ne 2
1427.mk
1428.na
1429\fB\fB-X\fR\fR
1430.ad
1431.RS 21n
1432Used with the \fB-F\fR recovery option. Determines whether extreme measures to find a valid txg should take place. This allows the pool to be rolled back to a txg which is no longer guaranteed to be consistent. Pools imported at an inconsistent txg may contain uncorrectable checksum errors. For more details about pool recovery mode, see the \fB-F\fR option, above.
1433\fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1434.RE
1435
1436.sp
1437.ne 2
1438.mk
1439.na
1440\fB\fB-T\fR\fR
1441.ad
1442.RS 21n
1443Specify the txg to use for rollback. Implies \fB-FX\fR. For more details about pool recovery mode, see the \fB-X\fR option, above.
1444\fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1445.RE
1446
058ac9ba
BB
1447.RE
1448
1449.sp
1450.ne 2
1451.mk
1452.na
26b42f3f 1453\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]] [\fB-t\fR]] \fIpool\fR | \fIid\fR [\fInewpool\fR]\fR
058ac9ba
BB
1454.ad
1455.sp .6
1456.RS 4n
1457Imports 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.
1458.sp
1459If 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.
1460.sp
1461.ne 2
1462.mk
1463.na
1464\fB\fB-o\fR \fImntopts\fR\fR
1465.ad
1466.sp .6
1467.RS 4n
2d1b7b0b 1468Comma-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
1469.RE
1470
1471.sp
1472.ne 2
1473.mk
1474.na
1475\fB\fB-o\fR \fIproperty=value\fR\fR
1476.ad
1477.sp .6
1478.RS 4n
1479Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1480.RE
1481
1482.sp
1483.ne 2
1484.mk
1485.na
1486\fB\fB-c\fR \fIcachefile\fR\fR
1487.ad
1488.sp .6
1489.RS 4n
1490Reads 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.
1491.RE
1492
1493.sp
1494.ne 2
1495.mk
1496.na
1497\fB\fB-d\fR \fIdir\fR\fR
1498.ad
1499.sp .6
1500.RS 4n
1501Searches 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.
1502.RE
1503
1504.sp
1505.ne 2
1506.mk
1507.na
1508\fB\fB-D\fR\fR
1509.ad
1510.sp .6
1511.RS 4n
1512Imports destroyed pool. The \fB-f\fR option is also required.
1513.RE
1514
1515.sp
1516.ne 2
1517.mk
1518.na
1519\fB\fB-f\fR\fR
1520.ad
1521.sp .6
1522.RS 4n
1523Forces import, even if the pool appears to be potentially active.
1524.RE
1525
7f9d9946
BB
1526.sp
1527.ne 2
1528.mk
1529.na
1530\fB\fB-F\fR\fR
1531.ad
1532.sp .6
1533.RS 4n
1534Recovery 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.
1535.RE
1536
058ac9ba
BB
1537.sp
1538.ne 2
1539.mk
1540.na
1541\fB\fB-R\fR \fIroot\fR\fR
1542.ad
1543.sp .6
1544.RS 4n
1545Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1546.RE
1547
7f9d9946
BB
1548.sp
1549.ne 2
1550.mk
1551.na
1552\fB\fB-n\fR\fR
1553.ad
1554.sp .6
1555.RS 4n
1556Used 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.
1557.RE
1558
21b446a7
TF
1559.sp
1560.ne 2
1561.mk
1562.na
1563\fB\fB-X\fR\fR
1564.ad
1565.sp .6
1566.RS 4n
1567Used with the \fB-F\fR recovery option. Determines whether extreme measures to find a valid txg should take place. This allows the pool to be rolled back to a txg which is no longer guaranteed to be consistent. Pools imported at an inconsistent txg may contain uncorrectable checksum errors. For more details about pool recovery mode, see the \fB-F\fR option, above.
1568\fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1569.RE
1570
1571.sp
1572.ne 2
1573.mk
1574.na
1575\fB\fB-T\fR\fR
1576.ad
1577.sp .6
1578.RS 4n
1579Specify the txg to use for rollback. Implies \fB-FX\fR. For more details about pool recovery mode, see the \fB-X\fR option, above.
1580\fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1581.RE
1582
26b42f3f
RY
1583.sp
1584.ne 2
1585.mk
1586.na
1587\fB\fB-t\fR\fR
1588.ad
1589.sp .6
1590.RS 4n
00d2a8c9 1591Used with "\fBnewpool\fR". Specifies that "\fBnewpool\fR" is temporary. Temporary pool names last until export. Ensures that the original pool name will be used in all label updates and therefore is retained upon export. Will also set -o cachefile=none when not explicitly specified.
26b42f3f
RY
1592.RE
1593
7f9d9946
BB
1594.sp
1595.ne 2
1596.mk
1597.na
1598\fB\fB-m\fR\fR
1599.ad
1600.sp .6
1601.RS 4n
1602Allows a pool to import when there is a missing log device.
1603.RE
1604
058ac9ba
BB
1605.RE
1606
1607.sp
1608.ne 2
1609.mk
1610.na
41092124 1611\fB\fBzpool iostat\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-v\fR] [\fB-y\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
058ac9ba
BB
1612.ad
1613.sp .6
1614.RS 4n
1615Displays \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.
1616.sp
1617.ne 2
1618.mk
1619.na
1620\fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1621.ad
1622.RS 12n
6b4e21c6 1623.rt
058ac9ba
BB
1624Display a time stamp.
1625.sp
1626Specify \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).
1627.RE
1628
1629.sp
1630.ne 2
1631.mk
1632.na
1633\fB\fB-v\fR\fR
1634.ad
1635.RS 12n
6b4e21c6 1636.rt
058ac9ba
BB
1637Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1638.RE
1639
41092124
HM
1640.sp
1641.ne 2
1642.mk
1643.na
1644\fB\fB-y\fR\fR
1645.ad
1646.RS 12n
1647.rt
1648Omit statistics since boot. Normally the first line of output reports the statistics since boot. This option suppresses that first line of output.
1649.RE
1650
058ac9ba
BB
1651.RE
1652
131cc95c
DK
1653.sp
1654.ne 2
1655.mk
1656.na
1657\fB\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
1658.ad
1659.sp .6
1660.RS 4n
1661Removes ZFS label information from the specified device. The device must not be part of an active pool configuration.
1662.sp
1663.ne 2
1664.mk
1665.na
1666\fB\fB-f\fR\fR
1667.ad
1668.RS 12n
1669.rt
1670Treat exported or foreign devices as inactive.
1671.RE
1672
1673.RE
1674
058ac9ba
BB
1675.sp
1676.ne 2
1677.mk
1678.na
2e2ddc30 1679\fB\fBzpool list\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-Hv\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
058ac9ba
BB
1680.ad
1681.sp .6
1682.RS 4n
6e1b9d03 1683Lists the given pools along with a health status and space usage. If no \fIpools\fR are specified, all pools in the system are listed. When given an \fIinterval\fR, the information is printed every \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If \fIcount\fR is specified, the command exits after \fIcount\fR reports are printed.
058ac9ba
BB
1684.sp
1685.ne 2
1686.mk
1687.na
1688\fB\fB-H\fR\fR
1689.ad
1690.RS 12n
6b4e21c6 1691.rt
058ac9ba
BB
1692Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1693.RE
1694
6e1b9d03
CE
1695.ne 2
1696.mk
1697.na
2e2ddc30 1698\fB\fB-T\fR \fBd\fR | \fBu\fR\fR
6e1b9d03
CE
1699.ad
1700.RS 12n
6b4e21c6 1701.rt
6e1b9d03
CE
1702Display a time stamp.
1703.sp
1704Specify \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).
1705.RE
1706
058ac9ba
BB
1707.sp
1708.ne 2
1709.mk
1710.na
1711\fB\fB-o\fR \fIprops\fR\fR
1712.ad
1713.RS 12n
6b4e21c6 1714.rt
f3a7f661 1715Comma-separated list of properties to display. See the "Properties" section for a list of valid properties. The default list is "name, size, used, available, fragmentation, expandsize, capacity, dedupratio, health, altroot"
1bd201e7
CS
1716.RE
1717
1718.sp
1719.ne 2
1720.mk
1721.na
1722\fB\fB-v\fR\fR
1723.ad
1724.RS 12n
1725.rt
1726Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wise statistics.
058ac9ba
BB
1727.RE
1728
1729.RE
1730
1731.sp
1732.ne 2
1733.mk
1734.na
1735\fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1736.ad
1737.sp .6
1738.RS 4n
1739Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1740.sp
1741This command is not applicable to spares or cache devices.
1742.sp
1743.ne 2
1744.mk
1745.na
1746\fB\fB-t\fR\fR
1747.ad
1748.RS 6n
6b4e21c6 1749.rt
058ac9ba
BB
1750Temporary. Upon reboot, the specified physical device reverts to its previous state.
1751.RE
1752
1753.RE
1754
1755.sp
1756.ne 2
1757.mk
1758.na
1759\fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1760.ad
1761.sp .6
1762.RS 4n
1763Brings the specified physical device online.
1764.sp
1765This command is not applicable to spares or cache devices.
1766.sp
1767.ne 2
1768.mk
1769.na
1770\fB\fB-e\fR\fR
1771.ad
1772.RS 6n
6b4e21c6 1773.rt
058ac9ba
BB
1774Expand 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.
1775.RE
1776
1777.RE
1778
1779.sp
1780.ne 2
1781.mk
1782.na
3541dc6d
GA
1783\fB\fBzpool reguid\fR \fIpool\fR
1784.ad
1785.sp .6
1786.RS 4n
5853fe79
GW
1787Generates a new unique identifier for the pool. You must ensure that all
1788devices in this pool are online and healthy before performing this action.
1789.RE
1790
1791.sp
1792.ne 2
1793.na
1794\fB\fBzpool reopen\fR \fIpool\fR
1795.ad
1796.sp .6
1797.RS 4n
1798Reopen all the vdevs associated with the pool.
3541dc6d
GA
1799.RE
1800
1801.sp
1802.ne 2
1803.na
058ac9ba
BB
1804\fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1805.ad
1806.sp .6
1807.RS 4n
1808Removes 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.
1809.RE
1810
1811.sp
1812.ne 2
1813.mk
1814.na
628668a3 1815\fB\fBzpool replace\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
058ac9ba
BB
1816.ad
1817.sp .6
1818.RS 4n
1819Replaces \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.
1820.sp
1821The 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.
1822.sp
1fe2e237 1823\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
1824.sp
1825.ne 2
1826.mk
1827.na
1828\fB\fB-f\fR\fR
1829.ad
1830.RS 6n
6b4e21c6 1831.rt
058ac9ba
BB
1832Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1833.RE
1834
628668a3
TF
1835.sp
1836.ne 2
1837.mk
1838.na
1839\fB\fB-o\fR \fIproperty=value\fR
1840.ad
1841.sp .6n
1842.RS 6n
1843Sets 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 \fBashift\fR. \fBDo note\fR that some properties (among them \fBashift\fR) are \fInot\fR inherited from a previous vdev. They are vdev specific, not pool specific.
1844.RE
1845
058ac9ba
BB
1846.RE
1847
1848.sp
1849.ne 2
1850.mk
1851.na
1852\fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1853.ad
1854.sp .6
1855.RS 4n
1856Begins 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.
1857.sp
1858Scrubbing 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.
1859.sp
1860Because 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.
1861.sp
1862.ne 2
1863.mk
1864.na
1865\fB\fB-s\fR\fR
1866.ad
1867.RS 6n
6b4e21c6 1868.rt
058ac9ba
BB
1869Stop scrubbing.
1870.RE
1871
1872.RE
1873
1874.sp
1875.ne 2
1876.mk
1877.na
1878\fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1879.ad
1880.sp .6
1881.RS 4n
1882Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1883.RE
1884
fb827006
SB
1885.sp
1886.ne 2
1887.mk
1888.na
52e68edc 1889\fBzpool split\fR [\fB-n\fR] [\fB-R\fR \fIaltroot\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fInewpool\fR [\fIdevice\fR ...]
fb827006
SB
1890.ad
1891.sp .6
1892.RS 4n
52e68edc
TC
1893Split devices off \fIpool\fR creating \fInewpool\fR. All \fBvdev\fRs in \fIpool\fR must be mirrors and the pool must not be in the process of resilvering. At the time of the split, \fInewpool\fR will be a replica of \fIpool\fR. By default, the last device in each mirror is split from \fIpool\fR to create \fInewpool\fR.
1894
1895The optional \fIdevice\fR specification causes the specified device(s) to be included in the new pool and, should any devices remain unspecified, the last device in each mirror is used as would be by default.
fb827006
SB
1896
1897.sp
1898.ne 2
1899.mk
1900.na
1901\fB\fB-n\fR \fR
1902.ad
1903.sp .6
1904.RS 4n
1905Do dry run, do not actually perform the split. Print out the expected configuration of \fInewpool\fR.
1906.RE
1907
1908.sp
1909.ne 2
1910.mk
1911.na
1912\fB\fB-R\fR \fIaltroot\fR \fR
1913.ad
1914.sp .6
1915.RS 4n
6b4e21c6 1916Set \fIaltroot\fR for \fInewpool\fR and automatically import it. This can be useful to avoid mountpoint collisions if \fInewpool\fR is imported on the same filesystem as \fIpool\fR.
fb827006
SB
1917.RE
1918
1919.sp
1920.ne 2
1921.mk
1922.na
1923\fB\fB-o\fR \fIproperty=value\fR \fR
1924.ad
1925.sp .6
1926.RS 4n
1927Sets the specified property for \fInewpool\fR. See the “Properties” section for more information on the available pool properties.
1928.RE
1929
1930.RE
1931
058ac9ba
BB
1932.sp
1933.ne 2
1934.mk
1935.na
2e2ddc30 1936\fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR d | u] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
058ac9ba
BB
1937.ad
1938.sp .6
1939.RS 4n
1940Displays 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.
1941.sp
1942If 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.
1943.sp
1944.ne 2
1945.mk
1946.na
1947\fB\fB-x\fR\fR
1948.ad
2e2ddc30 1949.RS 12n
6b4e21c6 1950.rt
c5b247f3 1951Only display status for pools that are exhibiting errors or are otherwise unavailable. Warnings about pools not using the latest on-disk format will not be included.
058ac9ba
BB
1952.RE
1953
1954.sp
1955.ne 2
1956.mk
1957.na
1958\fB\fB-v\fR\fR
1959.ad
2e2ddc30 1960.RS 12n
6b4e21c6 1961.rt
058ac9ba
BB
1962Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1963.RE
1964
2e2ddc30
TC
1965.sp
1966.ne 2
1967.mk
1968.na
1969\fB\fB-D\fR\fR
1970.ad
1971.RS 12n
1972.rt
1973Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and
1974referenced (logically referenced in the pool) block counts and sizes by reference count.
1975.RE
1976
1977.sp
1978.ne 2
1979.mk
1980.na
1981\fB\fB-T\fR \fBd\fR | \fBu\fR\fR
1982.ad
1983.RS 12n
1984.rt
1985Display a time stamp.
1986.sp
1987Specify \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).
058ac9ba
BB
1988.RE
1989
1990.sp
1991.ne 2
1992.mk
1993.na
1994\fB\fBzpool upgrade\fR\fR
1995.ad
1996.sp .6
1997.RS 4n
b9b24bb4 1998Displays pools which do not have all supported features enabled and pools formatted using a legacy ZFS version number. These pools can continue to be used, but some features may not be available. Use "\fBzpool upgrade -a\fR" to enable all features on all pools.
058ac9ba
BB
1999.RE
2000
2001.sp
2002.ne 2
2003.mk
2004.na
2005\fB\fBzpool upgrade\fR \fB-v\fR\fR
2006.ad
2007.sp .6
2008.RS 4n
b9b24bb4 2009Displays legacy \fBZFS\fR versions supported by the current software. See \fBzfs-features\fR(5) for a description of feature flags features supported by the current software.
058ac9ba
BB
2010.RE
2011
2012.sp
2013.ne 2
2014.mk
2015.na
2016\fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
2017.ad
2018.sp .6
2019.RS 4n
8f343973 2020Enables all supported features on the given pool. Once this is done, the pool will no longer be accessible on systems that do not support feature flags. See \fBzfs-features\fR(5) for details on compatibility with systems that support feature flags, but do not support all features enabled on the pool.
058ac9ba
BB
2021.sp
2022.ne 2
2023.mk
2024.na
2025\fB\fB-a\fR\fR
2026.ad
2027.RS 14n
b9b24bb4
CS
2028.rt
2029Enables all supported features on all pools.
058ac9ba
BB
2030.RE
2031
2032.sp
2033.ne 2
2034.mk
2035.na
2036\fB\fB-V\fR \fIversion\fR\fR
2037.ad
2038.RS 14n
b9b24bb4
CS
2039.rt
2040Upgrade to the specified legacy version. If the \fB-V\fR flag is specified, no features will be enabled on the pool. This option can only be used to increase the version number up to the last supported legacy version number.
058ac9ba
BB
2041.RE
2042
2043.RE
2044
2045.SH EXAMPLES
2046.LP
2047\fBExample 1 \fRCreating a RAID-Z Storage Pool
2048.sp
2049.LP
2050The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
2051
2052.sp
2053.in +2
2054.nf
54e5f226 2055# \fBzpool create tank raidz sda sdb sdc sdd sde sdf\fR
058ac9ba
BB
2056.fi
2057.in -2
2058.sp
2059
2060.LP
2061\fBExample 2 \fRCreating a Mirrored Storage Pool
2062.sp
2063.LP
2064The following command creates a pool with two mirrors, where each mirror contains two disks.
2065
2066.sp
2067.in +2
2068.nf
54e5f226 2069# \fBzpool create tank mirror sda sdb mirror sdc sdd\fR
058ac9ba
BB
2070.fi
2071.in -2
2072.sp
2073
2074.LP
54e5f226 2075\fBExample 3 \fRCreating a ZFS Storage Pool by Using Partitions
058ac9ba
BB
2076.sp
2077.LP
54e5f226 2078The following command creates an unmirrored pool using two disk partitions.
058ac9ba
BB
2079
2080.sp
2081.in +2
2082.nf
54e5f226 2083# \fBzpool create tank sda1 sdb2\fR
058ac9ba
BB
2084.fi
2085.in -2
2086.sp
2087
2088.LP
2089\fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
2090.sp
2091.LP
2092The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
2093
2094.sp
2095.in +2
2096.nf
2097# \fBzpool create tank /path/to/file/a /path/to/file/b\fR
2098.fi
2099.in -2
2100.sp
2101
2102.LP
2103\fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
2104.sp
2105.LP
6b92390f 2106The 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
2107
2108.sp
2109.in +2
2110.nf
54e5f226 2111# \fBzpool add tank mirror sda sdb\fR
058ac9ba
BB
2112.fi
2113.in -2
2114.sp
2115
2116.LP
2117\fBExample 6 \fRListing Available ZFS Storage Pools
2118.sp
2119.LP
2120The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
2121
2122.sp
2123.LP
2124The results from this command are similar to the following:
2125
2126.sp
2127.in +2
2128.nf
2129# \fBzpool list\fR
f3a7f661
GW
2130NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2131rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE -
2132tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE -
2133zion - - - - - - - FAULTED -
058ac9ba
BB
2134.fi
2135.in -2
2136.sp
2137
2138.LP
2139\fBExample 7 \fRDestroying a ZFS Storage Pool
2140.sp
2141.LP
6b92390f 2142The following command destroys the pool \fItank\fR and any datasets contained within.
058ac9ba
BB
2143
2144.sp
2145.in +2
2146.nf
2147# \fBzpool destroy -f tank\fR
2148.fi
2149.in -2
2150.sp
2151
2152.LP
2153\fBExample 8 \fRExporting a ZFS Storage Pool
2154.sp
2155.LP
2156The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
2157
2158.sp
2159.in +2
2160.nf
2161# \fBzpool export tank\fR
2162.fi
2163.in -2
2164.sp
2165
2166.LP
2167\fBExample 9 \fRImporting a ZFS Storage Pool
2168.sp
2169.LP
6b92390f 2170The following command displays available pools, and then imports the pool \fItank\fR for use on the system.
058ac9ba
BB
2171
2172.sp
2173.LP
2174The results from this command are similar to the following:
2175
2176.sp
2177.in +2
2178.nf
2179# \fBzpool import\fR
2180 pool: tank
2181 id: 15451357997522795478
2182 state: ONLINE
2183action: The pool can be imported using its name or numeric identifier.
2184config:
2185
2186 tank ONLINE
2187 mirror ONLINE
54e5f226
RL
2188 sda ONLINE
2189 sdb ONLINE
058ac9ba
BB
2190
2191# \fBzpool import tank\fR
2192.fi
2193.in -2
2194.sp
2195
2196.LP
2197\fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
2198.sp
2199.LP
2200The following command upgrades all ZFS Storage pools to the current version of the software.
2201
2202.sp
2203.in +2
2204.nf
2205# \fBzpool upgrade -a\fR
251eb26d 2206This system is currently running ZFS pool version 28.
058ac9ba
BB
2207.fi
2208.in -2
2209.sp
2210
2211.LP
2212\fBExample 11 \fRManaging Hot Spares
2213.sp
2214.LP
2215The following command creates a new pool with an available hot spare:
2216
2217.sp
2218.in +2
2219.nf
54e5f226 2220# \fBzpool create tank mirror sda sdb spare sdc\fR
058ac9ba
BB
2221.fi
2222.in -2
2223.sp
2224
2225.sp
2226.LP
2227If 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:
2228
2229.sp
2230.in +2
2231.nf
54e5f226 2232# \fBzpool replace tank sda sdd\fR
058ac9ba
BB
2233.fi
2234.in -2
2235.sp
2236
2237.sp
2238.LP
0d122e21 2239Once 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
2240
2241.sp
2242.in +2
2243.nf
54e5f226 2244# \fBzpool remove tank sdc\fR
058ac9ba
BB
2245.fi
2246.in -2
2247.sp
2248
2249.LP
2250\fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
2251.sp
2252.LP
2253The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
2254
2255.sp
2256.in +2
2257.nf
54e5f226
RL
2258# \fBzpool create pool mirror sda sdb mirror sdc sdd log mirror \e
2259 sde sdf\fR
058ac9ba
BB
2260.fi
2261.in -2
2262.sp
2263
2264.LP
2265\fBExample 13 \fRAdding Cache Devices to a ZFS Pool
2266.sp
2267.LP
2268The following command adds two disks for use as cache devices to a ZFS storage pool:
2269
2270.sp
2271.in +2
2272.nf
54e5f226 2273# \fBzpool add pool cache sdc sdd\fR
058ac9ba
BB
2274.fi
2275.in -2
2276.sp
2277
2278.sp
2279.LP
6b4e21c6 2280Once 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:
058ac9ba
BB
2281
2282.sp
2283.in +2
2284.nf
2285# \fBzpool iostat -v pool 5\fR
2286.fi
2287.in -2
2288.sp
2289
2290.LP
2291\fBExample 14 \fRRemoving a Mirrored Log Device
2292.sp
2293.LP
2294The following command removes the mirrored log device \fBmirror-2\fR.
2295
2296.sp
2297.LP
2298Given this configuration:
2299
2300.sp
2301.in +2
2302.nf
2303 pool: tank
2304 state: ONLINE
2305 scrub: none requested
2306config:
2307
2308 NAME STATE READ WRITE CKSUM
2309 tank ONLINE 0 0 0
2310 mirror-0 ONLINE 0 0 0
54e5f226
RL
2311 sda ONLINE 0 0 0
2312 sdb ONLINE 0 0 0
058ac9ba 2313 mirror-1 ONLINE 0 0 0
54e5f226
RL
2314 sdc ONLINE 0 0 0
2315 sdd ONLINE 0 0 0
058ac9ba
BB
2316 logs
2317 mirror-2 ONLINE 0 0 0
54e5f226
RL
2318 sde ONLINE 0 0 0
2319 sdf ONLINE 0 0 0
058ac9ba
BB
2320.fi
2321.in -2
2322.sp
2323
2324.sp
2325.LP
2326The command to remove the mirrored log \fBmirror-2\fR is:
2327
2328.sp
2329.in +2
2330.nf
2331# \fBzpool remove tank mirror-2\fR
2332.fi
2333.in -2
2334.sp
2335
1bd201e7
CS
2336.LP
2337\fBExample 15 \fRDisplaying expanded space on a device
2338.sp
2339.LP
f3a7f661 2340The following command displays the detailed information for the \fIdata\fR
1bd201e7 2341pool. This pool is comprised of a single \fIraidz\fR vdev where one of its
6b4e21c6 2342devices increased its capacity by 10GB. In this example, the pool will not
1bd201e7
CS
2343be able to utilized this extra capacity until all the devices under the
2344\fIraidz\fR vdev have been expanded.
2345
2346.sp
2347.in +2
2348.nf
2349# \fBzpool list -v data\fR
f3a7f661
GW
2350NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2351data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
2352 raidz1 23.9G 14.6G 9.30G 48% -
2353 c1t1d0 - - - - -
2354 c1t2d0 - - - - 10G
2355 c1t3d0 - - - - -
1bd201e7
CS
2356.fi
2357.in -2
2358
058ac9ba
BB
2359.SH EXIT STATUS
2360.sp
2361.LP
2362The following exit values are returned:
2363.sp
2364.ne 2
2365.mk
2366.na
2367\fB\fB0\fR\fR
2368.ad
2369.RS 5n
6b4e21c6
NB
2370.rt
2371Successful completion.
058ac9ba
BB
2372.RE
2373
2374.sp
2375.ne 2
2376.mk
2377.na
2378\fB\fB1\fR\fR
2379.ad
2380.RS 5n
6b4e21c6 2381.rt
058ac9ba
BB
2382An error occurred.
2383.RE
2384
2385.sp
2386.ne 2
2387.mk
2388.na
2389\fB\fB2\fR\fR
2390.ad
2391.RS 5n
6b4e21c6 2392.rt
058ac9ba
BB
2393Invalid command line options were specified.
2394.RE
2395
71bd0645
TF
2396.SH "ENVIRONMENT VARIABLES"
2397.TP
2398.B "ZFS_ABORT
2399Cause \fBzpool\fR to dump core on exit for the purposes of running \fB::findleaks\fR.
2400.TP
2401.B "ZPOOL_IMPORT_PATH"
2402The search path for devices or files to use with the pool. This is a colon-separated list of directories in which \fBzpool\fR looks for device nodes and files.
2403Similar to the \fB-d\fR option in \fIzpool import\fR.
2404
058ac9ba
BB
2405.SH SEE ALSO
2406.sp
2407.LP
d050c627 2408\fBzfs\fR(8), \fBzpool-features\fR(5), \fBzfs-events\fR(5)