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