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