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