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