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