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