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