]> git.proxmox.com Git - mirror_zfs.git/blob - man/man8/zpool.8
zpool import -t should not update cachefile
[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-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] \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] \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 .RE
1017
1018 .sp
1019 .ne 2
1020 .mk
1021 .na
1022 \fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
1023 .ad
1024 .sp .6
1025 .RS 4n
1026 Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
1027 .sp
1028 .ne 2
1029 .mk
1030 .na
1031 \fB\fB-f\fR\fR
1032 .ad
1033 .RS 6n
1034 .rt
1035 Forces any active datasets contained within the pool to be unmounted.
1036 .RE
1037
1038 .RE
1039
1040 .sp
1041 .ne 2
1042 .mk
1043 .na
1044 \fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
1045 .ad
1046 .sp .6
1047 .RS 4n
1048 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.
1049 .RE
1050
1051 .sp
1052 .ne 2
1053 .mk
1054 .na
1055 \fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
1056 .ad
1057 .sp .6
1058 .RS 4n
1059 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.
1060 .sp
1061 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.
1062 .sp
1063 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.
1064 .sp
1065 .ne 2
1066 .mk
1067 .na
1068 \fB\fB-f\fR\fR
1069 .ad
1070 .RS 6n
1071 .rt
1072 Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
1073 .sp
1074 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.
1075 .RE
1076
1077 .RE
1078
1079 .sp
1080 .ne 2
1081 .mk
1082 .na
1083 \fB\fBzpool get\fR [\fB-p\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
1084 .ad
1085 .sp .6
1086 .RS 4n
1087 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:
1088 .sp
1089 .in +2
1090 .nf
1091 name Name of storage pool
1092 property Property name
1093 value Property value
1094 source Property source, either 'default' or 'local'.
1095 .fi
1096 .in -2
1097 .sp
1098
1099 See the "Properties" section for more information on the available pool properties.
1100 .sp
1101 .ne 2
1102 .mk
1103 .na
1104 \fB\fB-p\fR\fR
1105 .ad
1106 .RS 6n
1107 .rt
1108 Display numbers in parseable (exact) values.
1109 .RE
1110
1111 .sp
1112 .ne 2
1113 .mk
1114 .na
1115 \fB\fB-H\fR\fR
1116 .ad
1117 .RS 6n
1118 .rt
1119 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1120 .RE
1121
1122 .RE
1123
1124 .sp
1125 .ne 2
1126 .mk
1127 .na
1128 \fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
1129 .ad
1130 .sp .6
1131 .RS 4n
1132 Displays the command history of the specified pools or all pools if no pool is specified.
1133 .sp
1134 .ne 2
1135 .mk
1136 .na
1137 \fB\fB-i\fR\fR
1138 .ad
1139 .RS 6n
1140 .rt
1141 Displays internally logged \fBZFS\fR events in addition to user initiated events.
1142 .RE
1143
1144 .sp
1145 .ne 2
1146 .mk
1147 .na
1148 \fB\fB-l\fR\fR
1149 .ad
1150 .RS 6n
1151 .rt
1152 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.
1153 .RE
1154
1155 .RE
1156
1157 .sp
1158 .ne 2
1159 .mk
1160 .na
1161 \fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
1162 .ad
1163 .sp .6
1164 .RS 4n
1165 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.
1166 .sp
1167 The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
1168 .sp
1169 .ne 2
1170 .mk
1171 .na
1172 \fB\fB-c\fR \fIcachefile\fR\fR
1173 .ad
1174 .RS 16n
1175 .rt
1176 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.
1177 .RE
1178
1179 .sp
1180 .ne 2
1181 .mk
1182 .na
1183 \fB\fB-d\fR \fIdir\fR\fR
1184 .ad
1185 .RS 16n
1186 .rt
1187 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times.
1188 .RE
1189
1190 .sp
1191 .ne 2
1192 .mk
1193 .na
1194 \fB\fB-D\fR\fR
1195 .ad
1196 .RS 16n
1197 .rt
1198 Lists destroyed pools only.
1199 .RE
1200
1201 .RE
1202
1203 .sp
1204 .ne 2
1205 .mk
1206 .na
1207 \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
1208 .ad
1209 .sp .6
1210 .RS 4n
1211 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.
1212 .sp
1213 .ne 2
1214 .mk
1215 .na
1216 \fB\fB-o\fR \fImntopts\fR\fR
1217 .ad
1218 .RS 21n
1219 .rt
1220 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.
1221 .RE
1222
1223 .sp
1224 .ne 2
1225 .mk
1226 .na
1227 \fB\fB-o\fR \fIproperty=value\fR\fR
1228 .ad
1229 .RS 21n
1230 .rt
1231 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1232 .RE
1233
1234 .sp
1235 .ne 2
1236 .mk
1237 .na
1238 \fB\fB-c\fR \fIcachefile\fR\fR
1239 .ad
1240 .RS 21n
1241 .rt
1242 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.
1243 .RE
1244
1245 .sp
1246 .ne 2
1247 .mk
1248 .na
1249 \fB\fB-d\fR \fIdir\fR\fR
1250 .ad
1251 .RS 21n
1252 .rt
1253 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.
1254 .RE
1255
1256 .sp
1257 .ne 2
1258 .mk
1259 .na
1260 \fB\fB-D\fR\fR
1261 .ad
1262 .RS 21n
1263 .rt
1264 Imports destroyed pools only. The \fB-f\fR option is also required.
1265 .RE
1266
1267 .sp
1268 .ne 2
1269 .mk
1270 .na
1271 \fB\fB-f\fR\fR
1272 .ad
1273 .RS 21n
1274 .rt
1275 Forces import, even if the pool appears to be potentially active.
1276 .RE
1277
1278 .sp
1279 .ne 2
1280 .mk
1281 .na
1282 \fB\fB-F\fR\fR
1283 .ad
1284 .RS 21n
1285 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.
1286 .RE
1287
1288 .sp
1289 .ne 2
1290 .mk
1291 .na
1292 \fB\fB-a\fR\fR
1293 .ad
1294 .RS 21n
1295 .rt
1296 Searches for and imports all pools found.
1297 .RE
1298
1299 .sp
1300 .ne 2
1301 .mk
1302 .na
1303 \fB\fB-m\fR\fR
1304 .ad
1305 .RS 21n
1306 Allows a pool to import when there is a missing log device.
1307 .RE
1308
1309 .sp
1310 .ne 2
1311 .mk
1312 .na
1313 \fB\fB-R\fR \fIroot\fR\fR
1314 .ad
1315 .RS 21n
1316 .rt
1317 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1318 .RE
1319
1320 .sp
1321 .ne 2
1322 .mk
1323 .na
1324 \fB\fB-N\fR\fR
1325 .ad
1326 .RS 21n
1327 Import the pool without mounting any file systems.
1328 .RE
1329
1330 .sp
1331 .ne 2
1332 .mk
1333 .na
1334 \fB\fB-n\fR\fR
1335 .ad
1336 .RS 21n
1337 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.
1338 .RE
1339
1340 .sp
1341 .ne 2
1342 .mk
1343 .na
1344 \fB\fB-X\fR\fR
1345 .ad
1346 .RS 21n
1347 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.
1348 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1349 .RE
1350
1351 .sp
1352 .ne 2
1353 .mk
1354 .na
1355 \fB\fB-T\fR\fR
1356 .ad
1357 .RS 21n
1358 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.
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 .RE
1363
1364 .sp
1365 .ne 2
1366 .mk
1367 .na
1368 \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
1369 .ad
1370 .sp .6
1371 .RS 4n
1372 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.
1373 .sp
1374 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.
1375 .sp
1376 .ne 2
1377 .mk
1378 .na
1379 \fB\fB-o\fR \fImntopts\fR\fR
1380 .ad
1381 .sp .6
1382 .RS 4n
1383 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.
1384 .RE
1385
1386 .sp
1387 .ne 2
1388 .mk
1389 .na
1390 \fB\fB-o\fR \fIproperty=value\fR\fR
1391 .ad
1392 .sp .6
1393 .RS 4n
1394 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1395 .RE
1396
1397 .sp
1398 .ne 2
1399 .mk
1400 .na
1401 \fB\fB-c\fR \fIcachefile\fR\fR
1402 .ad
1403 .sp .6
1404 .RS 4n
1405 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.
1406 .RE
1407
1408 .sp
1409 .ne 2
1410 .mk
1411 .na
1412 \fB\fB-d\fR \fIdir\fR\fR
1413 .ad
1414 .sp .6
1415 .RS 4n
1416 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.
1417 .RE
1418
1419 .sp
1420 .ne 2
1421 .mk
1422 .na
1423 \fB\fB-D\fR\fR
1424 .ad
1425 .sp .6
1426 .RS 4n
1427 Imports destroyed pool. The \fB-f\fR option is also required.
1428 .RE
1429
1430 .sp
1431 .ne 2
1432 .mk
1433 .na
1434 \fB\fB-f\fR\fR
1435 .ad
1436 .sp .6
1437 .RS 4n
1438 Forces import, even if the pool appears to be potentially active.
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 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.
1450 .RE
1451
1452 .sp
1453 .ne 2
1454 .mk
1455 .na
1456 \fB\fB-R\fR \fIroot\fR\fR
1457 .ad
1458 .sp .6
1459 .RS 4n
1460 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1461 .RE
1462
1463 .sp
1464 .ne 2
1465 .mk
1466 .na
1467 \fB\fB-n\fR\fR
1468 .ad
1469 .sp .6
1470 .RS 4n
1471 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.
1472 .RE
1473
1474 .sp
1475 .ne 2
1476 .mk
1477 .na
1478 \fB\fB-X\fR\fR
1479 .ad
1480 .sp .6
1481 .RS 4n
1482 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.
1483 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1484 .RE
1485
1486 .sp
1487 .ne 2
1488 .mk
1489 .na
1490 \fB\fB-T\fR\fR
1491 .ad
1492 .sp .6
1493 .RS 4n
1494 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.
1495 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1496 .RE
1497
1498 .sp
1499 .ne 2
1500 .mk
1501 .na
1502 \fB\fB-t\fR\fR
1503 .ad
1504 .sp .6
1505 .RS 4n
1506 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.
1507 .RE
1508
1509 .sp
1510 .ne 2
1511 .mk
1512 .na
1513 \fB\fB-m\fR\fR
1514 .ad
1515 .sp .6
1516 .RS 4n
1517 Allows a pool to import when there is a missing log device.
1518 .RE
1519
1520 .RE
1521
1522 .sp
1523 .ne 2
1524 .mk
1525 .na
1526 \fB\fBzpool iostat\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1527 .ad
1528 .sp .6
1529 .RS 4n
1530 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.
1531 .sp
1532 .ne 2
1533 .mk
1534 .na
1535 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1536 .ad
1537 .RS 12n
1538 .rt
1539 Display a time stamp.
1540 .sp
1541 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).
1542 .RE
1543
1544 .sp
1545 .ne 2
1546 .mk
1547 .na
1548 \fB\fB-v\fR\fR
1549 .ad
1550 .RS 12n
1551 .rt
1552 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1553 .RE
1554
1555 .RE
1556
1557 .sp
1558 .ne 2
1559 .mk
1560 .na
1561 \fB\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
1562 .ad
1563 .sp .6
1564 .RS 4n
1565 Removes ZFS label information from the specified device. The device must not be part of an active pool configuration.
1566 .sp
1567 .ne 2
1568 .mk
1569 .na
1570 \fB\fB-f\fR\fR
1571 .ad
1572 .RS 12n
1573 .rt
1574 Treat exported or foreign devices as inactive.
1575 .RE
1576
1577 .RE
1578
1579 .sp
1580 .ne 2
1581 .mk
1582 .na
1583 \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
1584 .ad
1585 .sp .6
1586 .RS 4n
1587 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.
1588 .sp
1589 .ne 2
1590 .mk
1591 .na
1592 \fB\fB-H\fR\fR
1593 .ad
1594 .RS 12n
1595 .rt
1596 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1597 .RE
1598
1599 .ne 2
1600 .mk
1601 .na
1602 \fB\fB-T\fR \fBd\fR | \fBu\fR\fR
1603 .ad
1604 .RS 12n
1605 .rt
1606 Display a time stamp.
1607 .sp
1608 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).
1609 .RE
1610
1611 .sp
1612 .ne 2
1613 .mk
1614 .na
1615 \fB\fB-o\fR \fIprops\fR\fR
1616 .ad
1617 .RS 12n
1618 .rt
1619 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"
1620 .RE
1621
1622 .sp
1623 .ne 2
1624 .mk
1625 .na
1626 \fB\fB-v\fR\fR
1627 .ad
1628 .RS 12n
1629 .rt
1630 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wise statistics.
1631 .RE
1632
1633 .RE
1634
1635 .sp
1636 .ne 2
1637 .mk
1638 .na
1639 \fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1640 .ad
1641 .sp .6
1642 .RS 4n
1643 Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1644 .sp
1645 This command is not applicable to spares or cache devices.
1646 .sp
1647 .ne 2
1648 .mk
1649 .na
1650 \fB\fB-t\fR\fR
1651 .ad
1652 .RS 6n
1653 .rt
1654 Temporary. Upon reboot, the specified physical device reverts to its previous state.
1655 .RE
1656
1657 .RE
1658
1659 .sp
1660 .ne 2
1661 .mk
1662 .na
1663 \fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1664 .ad
1665 .sp .6
1666 .RS 4n
1667 Brings the specified physical device online.
1668 .sp
1669 This command is not applicable to spares or cache devices.
1670 .sp
1671 .ne 2
1672 .mk
1673 .na
1674 \fB\fB-e\fR\fR
1675 .ad
1676 .RS 6n
1677 .rt
1678 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.
1679 .RE
1680
1681 .RE
1682
1683 .sp
1684 .ne 2
1685 .mk
1686 .na
1687 \fB\fBzpool reguid\fR \fIpool\fR
1688 .ad
1689 .sp .6
1690 .RS 4n
1691 Generates a new unique identifier for the pool. You must ensure that all
1692 devices in this pool are online and healthy before performing this action.
1693 .RE
1694
1695 .sp
1696 .ne 2
1697 .na
1698 \fB\fBzpool reopen\fR \fIpool\fR
1699 .ad
1700 .sp .6
1701 .RS 4n
1702 Reopen all the vdevs associated with the pool.
1703 .RE
1704
1705 .sp
1706 .ne 2
1707 .na
1708 \fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1709 .ad
1710 .sp .6
1711 .RS 4n
1712 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.
1713 .RE
1714
1715 .sp
1716 .ne 2
1717 .mk
1718 .na
1719 \fB\fBzpool replace\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
1720 .ad
1721 .sp .6
1722 .RS 4n
1723 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.
1724 .sp
1725 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.
1726 .sp
1727 \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.
1728 .sp
1729 .ne 2
1730 .mk
1731 .na
1732 \fB\fB-f\fR\fR
1733 .ad
1734 .RS 6n
1735 .rt
1736 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1737 .RE
1738
1739 .sp
1740 .ne 2
1741 .mk
1742 .na
1743 \fB\fB-o\fR \fIproperty=value\fR
1744 .ad
1745 .sp .6n
1746 .RS 6n
1747 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.
1748 .RE
1749
1750 .RE
1751
1752 .sp
1753 .ne 2
1754 .mk
1755 .na
1756 \fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1757 .ad
1758 .sp .6
1759 .RS 4n
1760 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.
1761 .sp
1762 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.
1763 .sp
1764 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.
1765 .sp
1766 .ne 2
1767 .mk
1768 .na
1769 \fB\fB-s\fR\fR
1770 .ad
1771 .RS 6n
1772 .rt
1773 Stop scrubbing.
1774 .RE
1775
1776 .RE
1777
1778 .sp
1779 .ne 2
1780 .mk
1781 .na
1782 \fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1783 .ad
1784 .sp .6
1785 .RS 4n
1786 Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1787 .RE
1788
1789 .sp
1790 .ne 2
1791 .mk
1792 .na
1793 \fBzpool split\fR [\fB-n\fR] [\fB-R\fR \fIaltroot\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fInewpool\fR [\fIdevice\fR ...]
1794 .ad
1795 .sp .6
1796 .RS 4n
1797 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.
1798
1799 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.
1800
1801 .sp
1802 .ne 2
1803 .mk
1804 .na
1805 \fB\fB-n\fR \fR
1806 .ad
1807 .sp .6
1808 .RS 4n
1809 Do dry run, do not actually perform the split. Print out the expected configuration of \fInewpool\fR.
1810 .RE
1811
1812 .sp
1813 .ne 2
1814 .mk
1815 .na
1816 \fB\fB-R\fR \fIaltroot\fR \fR
1817 .ad
1818 .sp .6
1819 .RS 4n
1820 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.
1821 .RE
1822
1823 .sp
1824 .ne 2
1825 .mk
1826 .na
1827 \fB\fB-o\fR \fIproperty=value\fR \fR
1828 .ad
1829 .sp .6
1830 .RS 4n
1831 Sets the specified property for \fInewpool\fR. See the “Properties” section for more information on the available pool properties.
1832 .RE
1833
1834 .RE
1835
1836 .sp
1837 .ne 2
1838 .mk
1839 .na
1840 \fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR d | u] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
1841 .ad
1842 .sp .6
1843 .RS 4n
1844 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.
1845 .sp
1846 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.
1847 .sp
1848 .ne 2
1849 .mk
1850 .na
1851 \fB\fB-x\fR\fR
1852 .ad
1853 .RS 12n
1854 .rt
1855 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.
1856 .RE
1857
1858 .sp
1859 .ne 2
1860 .mk
1861 .na
1862 \fB\fB-v\fR\fR
1863 .ad
1864 .RS 12n
1865 .rt
1866 Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1867 .RE
1868
1869 .sp
1870 .ne 2
1871 .mk
1872 .na
1873 \fB\fB-D\fR\fR
1874 .ad
1875 .RS 12n
1876 .rt
1877 Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and
1878 referenced (logically referenced in the pool) block counts and sizes by reference count.
1879 .RE
1880
1881 .sp
1882 .ne 2
1883 .mk
1884 .na
1885 \fB\fB-T\fR \fBd\fR | \fBu\fR\fR
1886 .ad
1887 .RS 12n
1888 .rt
1889 Display a time stamp.
1890 .sp
1891 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).
1892 .RE
1893
1894 .sp
1895 .ne 2
1896 .mk
1897 .na
1898 \fB\fBzpool upgrade\fR\fR
1899 .ad
1900 .sp .6
1901 .RS 4n
1902 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.
1903 .RE
1904
1905 .sp
1906 .ne 2
1907 .mk
1908 .na
1909 \fB\fBzpool upgrade\fR \fB-v\fR\fR
1910 .ad
1911 .sp .6
1912 .RS 4n
1913 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.
1914 .RE
1915
1916 .sp
1917 .ne 2
1918 .mk
1919 .na
1920 \fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1921 .ad
1922 .sp .6
1923 .RS 4n
1924 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.
1925 .sp
1926 .ne 2
1927 .mk
1928 .na
1929 \fB\fB-a\fR\fR
1930 .ad
1931 .RS 14n
1932 .rt
1933 Enables all supported features on all pools.
1934 .RE
1935
1936 .sp
1937 .ne 2
1938 .mk
1939 .na
1940 \fB\fB-V\fR \fIversion\fR\fR
1941 .ad
1942 .RS 14n
1943 .rt
1944 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.
1945 .RE
1946
1947 .RE
1948
1949 .SH EXAMPLES
1950 .LP
1951 \fBExample 1 \fRCreating a RAID-Z Storage Pool
1952 .sp
1953 .LP
1954 The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
1955
1956 .sp
1957 .in +2
1958 .nf
1959 # \fBzpool create tank raidz sda sdb sdc sdd sde sdf\fR
1960 .fi
1961 .in -2
1962 .sp
1963
1964 .LP
1965 \fBExample 2 \fRCreating a Mirrored Storage Pool
1966 .sp
1967 .LP
1968 The following command creates a pool with two mirrors, where each mirror contains two disks.
1969
1970 .sp
1971 .in +2
1972 .nf
1973 # \fBzpool create tank mirror sda sdb mirror sdc sdd\fR
1974 .fi
1975 .in -2
1976 .sp
1977
1978 .LP
1979 \fBExample 3 \fRCreating a ZFS Storage Pool by Using Partitions
1980 .sp
1981 .LP
1982 The following command creates an unmirrored pool using two disk partitions.
1983
1984 .sp
1985 .in +2
1986 .nf
1987 # \fBzpool create tank sda1 sdb2\fR
1988 .fi
1989 .in -2
1990 .sp
1991
1992 .LP
1993 \fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
1994 .sp
1995 .LP
1996 The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
1997
1998 .sp
1999 .in +2
2000 .nf
2001 # \fBzpool create tank /path/to/file/a /path/to/file/b\fR
2002 .fi
2003 .in -2
2004 .sp
2005
2006 .LP
2007 \fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
2008 .sp
2009 .LP
2010 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.
2011
2012 .sp
2013 .in +2
2014 .nf
2015 # \fBzpool add tank mirror sda sdb\fR
2016 .fi
2017 .in -2
2018 .sp
2019
2020 .LP
2021 \fBExample 6 \fRListing Available ZFS Storage Pools
2022 .sp
2023 .LP
2024 The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
2025
2026 .sp
2027 .LP
2028 The results from this command are similar to the following:
2029
2030 .sp
2031 .in +2
2032 .nf
2033 # \fBzpool list\fR
2034 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2035 rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE -
2036 tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE -
2037 zion - - - - - - - FAULTED -
2038 .fi
2039 .in -2
2040 .sp
2041
2042 .LP
2043 \fBExample 7 \fRDestroying a ZFS Storage Pool
2044 .sp
2045 .LP
2046 The following command destroys the pool \fItank\fR and any datasets contained within.
2047
2048 .sp
2049 .in +2
2050 .nf
2051 # \fBzpool destroy -f tank\fR
2052 .fi
2053 .in -2
2054 .sp
2055
2056 .LP
2057 \fBExample 8 \fRExporting a ZFS Storage Pool
2058 .sp
2059 .LP
2060 The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
2061
2062 .sp
2063 .in +2
2064 .nf
2065 # \fBzpool export tank\fR
2066 .fi
2067 .in -2
2068 .sp
2069
2070 .LP
2071 \fBExample 9 \fRImporting a ZFS Storage Pool
2072 .sp
2073 .LP
2074 The following command displays available pools, and then imports the pool \fItank\fR for use on the system.
2075
2076 .sp
2077 .LP
2078 The results from this command are similar to the following:
2079
2080 .sp
2081 .in +2
2082 .nf
2083 # \fBzpool import\fR
2084 pool: tank
2085 id: 15451357997522795478
2086 state: ONLINE
2087 action: The pool can be imported using its name or numeric identifier.
2088 config:
2089
2090 tank ONLINE
2091 mirror ONLINE
2092 sda ONLINE
2093 sdb ONLINE
2094
2095 # \fBzpool import tank\fR
2096 .fi
2097 .in -2
2098 .sp
2099
2100 .LP
2101 \fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
2102 .sp
2103 .LP
2104 The following command upgrades all ZFS Storage pools to the current version of the software.
2105
2106 .sp
2107 .in +2
2108 .nf
2109 # \fBzpool upgrade -a\fR
2110 This system is currently running ZFS pool version 28.
2111 .fi
2112 .in -2
2113 .sp
2114
2115 .LP
2116 \fBExample 11 \fRManaging Hot Spares
2117 .sp
2118 .LP
2119 The following command creates a new pool with an available hot spare:
2120
2121 .sp
2122 .in +2
2123 .nf
2124 # \fBzpool create tank mirror sda sdb spare sdc\fR
2125 .fi
2126 .in -2
2127 .sp
2128
2129 .sp
2130 .LP
2131 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:
2132
2133 .sp
2134 .in +2
2135 .nf
2136 # \fBzpool replace tank sda sdd\fR
2137 .fi
2138 .in -2
2139 .sp
2140
2141 .sp
2142 .LP
2143 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:
2144
2145 .sp
2146 .in +2
2147 .nf
2148 # \fBzpool remove tank sdc\fR
2149 .fi
2150 .in -2
2151 .sp
2152
2153 .LP
2154 \fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
2155 .sp
2156 .LP
2157 The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
2158
2159 .sp
2160 .in +2
2161 .nf
2162 # \fBzpool create pool mirror sda sdb mirror sdc sdd log mirror \e
2163 sde sdf\fR
2164 .fi
2165 .in -2
2166 .sp
2167
2168 .LP
2169 \fBExample 13 \fRAdding Cache Devices to a ZFS Pool
2170 .sp
2171 .LP
2172 The following command adds two disks for use as cache devices to a ZFS storage pool:
2173
2174 .sp
2175 .in +2
2176 .nf
2177 # \fBzpool add pool cache sdc sdd\fR
2178 .fi
2179 .in -2
2180 .sp
2181
2182 .sp
2183 .LP
2184 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:
2185
2186 .sp
2187 .in +2
2188 .nf
2189 # \fBzpool iostat -v pool 5\fR
2190 .fi
2191 .in -2
2192 .sp
2193
2194 .LP
2195 \fBExample 14 \fRRemoving a Mirrored Log Device
2196 .sp
2197 .LP
2198 The following command removes the mirrored log device \fBmirror-2\fR.
2199
2200 .sp
2201 .LP
2202 Given this configuration:
2203
2204 .sp
2205 .in +2
2206 .nf
2207 pool: tank
2208 state: ONLINE
2209 scrub: none requested
2210 config:
2211
2212 NAME STATE READ WRITE CKSUM
2213 tank ONLINE 0 0 0
2214 mirror-0 ONLINE 0 0 0
2215 sda ONLINE 0 0 0
2216 sdb ONLINE 0 0 0
2217 mirror-1 ONLINE 0 0 0
2218 sdc ONLINE 0 0 0
2219 sdd ONLINE 0 0 0
2220 logs
2221 mirror-2 ONLINE 0 0 0
2222 sde ONLINE 0 0 0
2223 sdf ONLINE 0 0 0
2224 .fi
2225 .in -2
2226 .sp
2227
2228 .sp
2229 .LP
2230 The command to remove the mirrored log \fBmirror-2\fR is:
2231
2232 .sp
2233 .in +2
2234 .nf
2235 # \fBzpool remove tank mirror-2\fR
2236 .fi
2237 .in -2
2238 .sp
2239
2240 .LP
2241 \fBExample 15 \fRDisplaying expanded space on a device
2242 .sp
2243 .LP
2244 The following command displays the detailed information for the \fIdata\fR
2245 pool. This pool is comprised of a single \fIraidz\fR vdev where one of its
2246 devices increased its capacity by 10GB. In this example, the pool will not
2247 be able to utilized this extra capacity until all the devices under the
2248 \fIraidz\fR vdev have been expanded.
2249
2250 .sp
2251 .in +2
2252 .nf
2253 # \fBzpool list -v data\fR
2254 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2255 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
2256 raidz1 23.9G 14.6G 9.30G 48% -
2257 c1t1d0 - - - - -
2258 c1t2d0 - - - - 10G
2259 c1t3d0 - - - - -
2260 .fi
2261 .in -2
2262
2263 .SH EXIT STATUS
2264 .sp
2265 .LP
2266 The following exit values are returned:
2267 .sp
2268 .ne 2
2269 .mk
2270 .na
2271 \fB\fB0\fR\fR
2272 .ad
2273 .RS 5n
2274 .rt
2275 Successful completion.
2276 .RE
2277
2278 .sp
2279 .ne 2
2280 .mk
2281 .na
2282 \fB\fB1\fR\fR
2283 .ad
2284 .RS 5n
2285 .rt
2286 An error occurred.
2287 .RE
2288
2289 .sp
2290 .ne 2
2291 .mk
2292 .na
2293 \fB\fB2\fR\fR
2294 .ad
2295 .RS 5n
2296 .rt
2297 Invalid command line options were specified.
2298 .RE
2299
2300 .SH "ENVIRONMENT VARIABLES"
2301 .TP
2302 .B "ZFS_ABORT
2303 Cause \fBzpool\fR to dump core on exit for the purposes of running \fB::findleaks\fR.
2304 .TP
2305 .B "ZPOOL_IMPORT_PATH"
2306 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.
2307 Similar to the \fB-d\fR option in \fIzpool import\fR.
2308
2309 .SH SEE ALSO
2310 .sp
2311 .LP
2312 \fBzfs\fR(8), \fBzpool-features\fR(5)