]> git.proxmox.com Git - mirror_zfs.git/blob - man/man8/zpool.8
Fix man zpool property feature_guid
[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) 2012 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-p\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] \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
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\fBfree\fR\fR
510 .ad
511 .RS 20n
512 .rt
513 The amount of free space available in the pool.
514 .RE
515
516 .sp
517 .ne 2
518 .mk
519 .na
520 \fB\fBfreeing\fR\fR
521 .ad
522 .RS 20n
523 .rt
524 After a file system or snapshot is destroyed, the space it was using is
525 returned to the pool asynchronously. \fB\fBfreeing\fR\fR is the amount of
526 space remaining to be reclaimed. Over time \fB\fBfreeing\fR\fR will decrease
527 while \fB\fBfree\fR\fR increases.
528 .RE
529
530 .sp
531 .ne 2
532 .mk
533 .na
534 \fB\fBhealth\fR\fR
535 .ad
536 .RS 20n
537 .rt
538 The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR", "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
539 .RE
540
541 .sp
542 .ne 2
543 .mk
544 .na
545 \fB\fBguid\fR\fR
546 .ad
547 .RS 20n
548 .rt
549 A unique identifier for the pool.
550 .RE
551
552 .sp
553 .ne 2
554 .mk
555 .na
556 \fB\fBsize\fR\fR
557 .ad
558 .RS 20n
559 .rt
560 Total size of the storage pool.
561 .RE
562
563 .sp
564 .ne 2
565 .mk
566 .na
567 \fB\fBunsupported@\fR\fIfeature_guid\fR\fR
568 .ad
569 .RS 20n
570 .rt
571 .sp
572 Information about unsupported features that are enabled on the pool. See
573 \fBzpool-features\fR(5) for details.
574 .RE
575
576 .sp
577 .ne 2
578 .mk
579 .na
580 \fB\fBused\fR\fR
581 .ad
582 .RS 20n
583 .rt
584 Amount of storage space used within the pool.
585 .RE
586
587 .sp
588 .LP
589 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.
590
591 .sp
592 .LP
593 The following property can be set at creation time:
594 .sp
595 .ne 2
596 .mk
597 .na
598 \fB\fBashift\fR\fR
599 .ad
600 .sp .6
601 .RS 4n
602 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).
603 .LP
604 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.
605 .LP
606 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.
607 .RE
608
609 .sp
610 .LP
611 The following property can be set at creation time and import time:
612 .sp
613 .ne 2
614 .mk
615 .na
616 \fB\fBaltroot\fR\fR
617 .ad
618 .sp .6
619 .RS 4n
620 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.
621 .RE
622
623 .sp
624 .LP
625 The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
626 .sp
627 .ne 2
628 .mk
629 .na
630 \fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
631 .ad
632 .sp .6
633 .RS 4n
634 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.
635 .RE
636
637 .sp
638 .ne 2
639 .mk
640 .na
641 \fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
642 .ad
643 .sp .6
644 .RS 4n
645 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".
646 .RE
647
648 .sp
649 .ne 2
650 .mk
651 .na
652 \fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
653 .ad
654 .sp .6
655 .RS 4n
656 Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
657 .RE
658
659 .sp
660 .ne 2
661 .mk
662 .na
663 \fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
664 .ad
665 .sp .6
666 .RS 4n
667 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.
668 .sp
669 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.
670 .RE
671
672 .sp
673 .ne 2
674 .mk
675 .na
676 \fB\fBcomment\fR=\fB\fItext\fR\fR
677 .ad
678 .sp .6
679 .RS 4n
680 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.
681 .RE
682
683 .sp
684 .ne 2
685 .mk
686 .na
687 \fB\fBdedupditto\fR=\fB\fInumber\fR\fR
688 .ad
689 .sp .6
690 .RS 4n
691 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.
692 .RE
693
694 .sp
695 .ne 2
696 .mk
697 .na
698 \fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
699 .ad
700 .sp .6
701 .RS 4n
702 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.
703 .RE
704
705 .sp
706 .ne 2
707 .mk
708 .na
709 \fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
710 .ad
711 .sp .6
712 .RS 4n
713 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:
714 .sp
715 .ne 2
716 .mk
717 .na
718 \fB\fBwait\fR\fR
719 .ad
720 .RS 12n
721 .rt
722 Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
723 .RE
724
725 .sp
726 .ne 2
727 .mk
728 .na
729 \fB\fBcontinue\fR\fR
730 .ad
731 .RS 12n
732 .rt
733 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.
734 .RE
735
736 .sp
737 .ne 2
738 .mk
739 .na
740 \fB\fBpanic\fR\fR
741 .ad
742 .RS 12n
743 .rt
744 Prints out a message to the console and generates a system crash dump.
745 .RE
746
747 .RE
748
749 .sp
750 .ne 2
751 .na
752 \fB\fBfeature@\fR\fIfeature_name\fR=\fBenabled\fR\fR
753 .ad
754 .RS 4n
755 The value of this property is the current state of \fIfeature_name\fR. The
756 only valid value when setting this property is \fBenabled\fR which moves
757 \fIfeature_name\fR to the enabled state. See \fBzpool-features\fR(5) for
758 details on feature states.
759 .RE
760
761 .sp
762 .ne 2
763 .mk
764 .na
765 \fB\fBlistsnaps\fR=on | off\fR
766 .ad
767 .sp .6
768 .RS 4n
769 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".
770 .RE
771
772 .sp
773 .ne 2
774 .mk
775 .na
776 \fB\fBversion\fR=\fIversion\fR\fR
777 .ad
778 .sp .6
779 .RS 4n
780 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.
781 .RE
782
783 .SS "Subcommands"
784 .sp
785 .LP
786 All subcommands that modify state are logged persistently to the pool in their original form.
787 .sp
788 .LP
789 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:
790 .sp
791 .ne 2
792 .mk
793 .na
794 \fB\fBzpool\fR \fB-?\fR\fR
795 .ad
796 .sp .6
797 .RS 4n
798 Displays a help message.
799 .RE
800
801 .sp
802 .ne 2
803 .mk
804 .na
805 \fB\fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...\fR
806 .ad
807 .sp .6
808 .RS 4n
809 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.
810 .sp
811 .ne 2
812 .mk
813 .na
814 \fB\fB-f\fR\fR
815 .ad
816 .RS 6n
817 .rt
818 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.
819 .RE
820
821 .sp
822 .ne 2
823 .mk
824 .na
825 \fB\fB-n\fR\fR
826 .ad
827 .RS 6n
828 .rt
829 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.
830 .RE
831
832 .sp
833 .ne 2
834 .mk
835 .na
836 \fB\fB-o\fR \fIproperty=value\fR
837 .ad
838 .sp .6
839 .RS 4n
840 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.
841 .RE
842
843 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.
844 .RE
845
846 .sp
847 .ne 2
848 .mk
849 .na
850 \fB\fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
851 .ad
852 .sp .6
853 .RS 4n
854 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.
855 .sp
856 .ne 2
857 .mk
858 .na
859 \fB\fB-f\fR\fR
860 .ad
861 .RS 6n
862 .rt
863 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
864 .RE
865
866 .sp
867 .ne 2
868 .mk
869 .na
870 \fB\fB-o\fR \fIproperty=value\fR
871 .ad
872 .sp .6
873 .RS 4n
874 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".
875 .RE
876
877 .RE
878
879 .sp
880 .ne 2
881 .mk
882 .na
883 \fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
884 .ad
885 .sp .6
886 .RS 4n
887 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.
888 .RE
889
890 .sp
891 .ne 2
892 .mk
893 .na
894 \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
895 .ad
896 .sp .6
897 .RS 4n
898 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.
899 .sp
900 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.
901 .sp
902 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.
903 .sp
904 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.
905 .sp
906 By default all supported features are enabled on the new pool unless the \fB-d\fR option is specified.
907 .sp
908 .ne 2
909 .mk
910 .na
911 \fB\fB-f\fR\fR
912 .ad
913 .sp .6
914 .RS 4n
915 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.
916 .RE
917
918 .sp
919 .ne 2
920 .mk
921 .na
922 \fB\fB-n\fR\fR
923 .ad
924 .sp .6
925 .RS 4n
926 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.
927 .RE
928
929 .sp
930 .ne 2
931 .mk
932 .na
933 \fB\fB-d\fR\fR
934 .ad
935 .sp .6
936 .RS 4n
937 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.
938 .RE
939
940 .sp
941 .ne 2
942 .na
943 \fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
944 .ad
945 .sp .6
946 .RS 4n
947 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
948 .RE
949
950 .sp
951 .ne 2
952 .mk
953 .na
954 \fB\fB-O\fR \fIfile-system-property=value\fR\fR
955 .ad
956 .br
957 .na
958 \fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
959 .ad
960 .sp .6
961 .RS 4n
962 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.
963 .RE
964
965 .sp
966 .ne 2
967 .mk
968 .na
969 \fB\fB-R\fR \fIroot\fR\fR
970 .ad
971 .sp .6
972 .RS 4n
973 Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
974 .RE
975
976 .sp
977 .ne 2
978 .mk
979 .na
980 \fB\fB-m\fR \fImountpoint\fR\fR
981 .ad
982 .sp .6
983 .RS 4n
984 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).
985 .RE
986
987 .RE
988
989 .sp
990 .ne 2
991 .mk
992 .na
993 \fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
994 .ad
995 .sp .6
996 .RS 4n
997 Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
998 .sp
999 .ne 2
1000 .mk
1001 .na
1002 \fB\fB-f\fR\fR
1003 .ad
1004 .RS 6n
1005 .rt
1006 Forces any active datasets contained within the pool to be unmounted.
1007 .RE
1008
1009 .RE
1010
1011 .sp
1012 .ne 2
1013 .mk
1014 .na
1015 \fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
1016 .ad
1017 .sp .6
1018 .RS 4n
1019 Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data. If \fIdevice\fR may be re-added to the pool later on then consider the "\fBzpool offline\fR" command instead.
1020 .RE
1021
1022 .sp
1023 .ne 2
1024 .mk
1025 .na
1026 \fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
1027 .ad
1028 .sp .6
1029 .RS 4n
1030 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.
1031 .sp
1032 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.
1033 .sp
1034 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.
1035 .sp
1036 .ne 2
1037 .mk
1038 .na
1039 \fB\fB-f\fR\fR
1040 .ad
1041 .RS 6n
1042 .rt
1043 Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
1044 .sp
1045 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.
1046 .RE
1047
1048 .RE
1049
1050 .sp
1051 .ne 2
1052 .mk
1053 .na
1054 \fB\fBzpool get\fR [\fB-p\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
1055 .ad
1056 .sp .6
1057 .RS 4n
1058 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:
1059 .sp
1060 .in +2
1061 .nf
1062 name Name of storage pool
1063 property Property name
1064 value Property value
1065 source Property source, either 'default' or 'local'.
1066 .fi
1067 .in -2
1068 .sp
1069
1070 See the "Properties" section for more information on the available pool properties.
1071 .sp
1072 .ne 2
1073 .mk
1074 .na
1075 \fB\fB-p\fR\fR
1076 .ad
1077 .RS 6n
1078 .rt
1079 Display numbers in parseable (exact) values.
1080 .RE
1081
1082 .RE
1083
1084 .sp
1085 .ne 2
1086 .mk
1087 .na
1088 \fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
1089 .ad
1090 .sp .6
1091 .RS 4n
1092 Displays the command history of the specified pools or all pools if no pool is specified.
1093 .sp
1094 .ne 2
1095 .mk
1096 .na
1097 \fB\fB-i\fR\fR
1098 .ad
1099 .RS 6n
1100 .rt
1101 Displays internally logged \fBZFS\fR events in addition to user initiated events.
1102 .RE
1103
1104 .sp
1105 .ne 2
1106 .mk
1107 .na
1108 \fB\fB-l\fR\fR
1109 .ad
1110 .RS 6n
1111 .rt
1112 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.
1113 .RE
1114
1115 .RE
1116
1117 .sp
1118 .ne 2
1119 .mk
1120 .na
1121 \fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
1122 .ad
1123 .sp .6
1124 .RS 4n
1125 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.
1126 .sp
1127 The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
1128 .sp
1129 .ne 2
1130 .mk
1131 .na
1132 \fB\fB-c\fR \fIcachefile\fR\fR
1133 .ad
1134 .RS 16n
1135 .rt
1136 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.
1137 .RE
1138
1139 .sp
1140 .ne 2
1141 .mk
1142 .na
1143 \fB\fB-d\fR \fIdir\fR\fR
1144 .ad
1145 .RS 16n
1146 .rt
1147 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times.
1148 .RE
1149
1150 .sp
1151 .ne 2
1152 .mk
1153 .na
1154 \fB\fB-D\fR\fR
1155 .ad
1156 .RS 16n
1157 .rt
1158 Lists destroyed pools only.
1159 .RE
1160
1161 .RE
1162
1163 .sp
1164 .ne 2
1165 .mk
1166 .na
1167 \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
1168 .ad
1169 .sp .6
1170 .RS 4n
1171 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.
1172 .sp
1173 .ne 2
1174 .mk
1175 .na
1176 \fB\fB-o\fR \fImntopts\fR\fR
1177 .ad
1178 .RS 21n
1179 .rt
1180 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.
1181 .RE
1182
1183 .sp
1184 .ne 2
1185 .mk
1186 .na
1187 \fB\fB-o\fR \fIproperty=value\fR\fR
1188 .ad
1189 .RS 21n
1190 .rt
1191 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1192 .RE
1193
1194 .sp
1195 .ne 2
1196 .mk
1197 .na
1198 \fB\fB-c\fR \fIcachefile\fR\fR
1199 .ad
1200 .RS 21n
1201 .rt
1202 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.
1203 .RE
1204
1205 .sp
1206 .ne 2
1207 .mk
1208 .na
1209 \fB\fB-d\fR \fIdir\fR\fR
1210 .ad
1211 .RS 21n
1212 .rt
1213 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.
1214 .RE
1215
1216 .sp
1217 .ne 2
1218 .mk
1219 .na
1220 \fB\fB-D\fR\fR
1221 .ad
1222 .RS 21n
1223 .rt
1224 Imports destroyed pools only. The \fB-f\fR option is also required.
1225 .RE
1226
1227 .sp
1228 .ne 2
1229 .mk
1230 .na
1231 \fB\fB-f\fR\fR
1232 .ad
1233 .RS 21n
1234 .rt
1235 Forces import, even if the pool appears to be potentially active.
1236 .RE
1237
1238 .sp
1239 .ne 2
1240 .mk
1241 .na
1242 \fB\fB-F\fR\fR
1243 .ad
1244 .RS 21n
1245 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.
1246 .RE
1247
1248 .sp
1249 .ne 2
1250 .mk
1251 .na
1252 \fB\fB-a\fR\fR
1253 .ad
1254 .RS 21n
1255 .rt
1256 Searches for and imports all pools found.
1257 .RE
1258
1259 .sp
1260 .ne 2
1261 .mk
1262 .na
1263 \fB\fB-m\fR\fR
1264 .ad
1265 .RS 21n
1266 Allows a pool to import when there is a missing log device.
1267 .RE
1268
1269 .sp
1270 .ne 2
1271 .mk
1272 .na
1273 \fB\fB-R\fR \fIroot\fR\fR
1274 .ad
1275 .RS 21n
1276 .rt
1277 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1278 .RE
1279
1280 .sp
1281 .ne 2
1282 .mk
1283 .na
1284 \fB\fB-N\fR\fR
1285 .ad
1286 .RS 21n
1287 Import the pool without mounting any file systems.
1288 .RE
1289
1290 .sp
1291 .ne 2
1292 .mk
1293 .na
1294 \fB\fB-n\fR\fR
1295 .ad
1296 .RS 21n
1297 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.
1298 .RE
1299
1300 .sp
1301 .ne 2
1302 .mk
1303 .na
1304 \fB\fB-X\fR\fR
1305 .ad
1306 .RS 21n
1307 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.
1308 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1309 .RE
1310
1311 .sp
1312 .ne 2
1313 .mk
1314 .na
1315 \fB\fB-T\fR\fR
1316 .ad
1317 .RS 21n
1318 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.
1319 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1320 .RE
1321
1322 .RE
1323
1324 .sp
1325 .ne 2
1326 .mk
1327 .na
1328 \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
1329 .ad
1330 .sp .6
1331 .RS 4n
1332 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.
1333 .sp
1334 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.
1335 .sp
1336 .ne 2
1337 .mk
1338 .na
1339 \fB\fB-o\fR \fImntopts\fR\fR
1340 .ad
1341 .sp .6
1342 .RS 4n
1343 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.
1344 .RE
1345
1346 .sp
1347 .ne 2
1348 .mk
1349 .na
1350 \fB\fB-o\fR \fIproperty=value\fR\fR
1351 .ad
1352 .sp .6
1353 .RS 4n
1354 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1355 .RE
1356
1357 .sp
1358 .ne 2
1359 .mk
1360 .na
1361 \fB\fB-c\fR \fIcachefile\fR\fR
1362 .ad
1363 .sp .6
1364 .RS 4n
1365 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.
1366 .RE
1367
1368 .sp
1369 .ne 2
1370 .mk
1371 .na
1372 \fB\fB-d\fR \fIdir\fR\fR
1373 .ad
1374 .sp .6
1375 .RS 4n
1376 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.
1377 .RE
1378
1379 .sp
1380 .ne 2
1381 .mk
1382 .na
1383 \fB\fB-D\fR\fR
1384 .ad
1385 .sp .6
1386 .RS 4n
1387 Imports destroyed pool. The \fB-f\fR option is also required.
1388 .RE
1389
1390 .sp
1391 .ne 2
1392 .mk
1393 .na
1394 \fB\fB-f\fR\fR
1395 .ad
1396 .sp .6
1397 .RS 4n
1398 Forces import, even if the pool appears to be potentially active.
1399 .RE
1400
1401 .sp
1402 .ne 2
1403 .mk
1404 .na
1405 \fB\fB-F\fR\fR
1406 .ad
1407 .sp .6
1408 .RS 4n
1409 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.
1410 .RE
1411
1412 .sp
1413 .ne 2
1414 .mk
1415 .na
1416 \fB\fB-R\fR \fIroot\fR\fR
1417 .ad
1418 .sp .6
1419 .RS 4n
1420 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1421 .RE
1422
1423 .sp
1424 .ne 2
1425 .mk
1426 .na
1427 \fB\fB-n\fR\fR
1428 .ad
1429 .sp .6
1430 .RS 4n
1431 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.
1432 .RE
1433
1434 .sp
1435 .ne 2
1436 .mk
1437 .na
1438 \fB\fB-X\fR\fR
1439 .ad
1440 .sp .6
1441 .RS 4n
1442 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.
1443 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1444 .RE
1445
1446 .sp
1447 .ne 2
1448 .mk
1449 .na
1450 \fB\fB-T\fR\fR
1451 .ad
1452 .sp .6
1453 .RS 4n
1454 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.
1455 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1456 .RE
1457
1458 .sp
1459 .ne 2
1460 .mk
1461 .na
1462 \fB\fB-t\fR\fR
1463 .ad
1464 .sp .6
1465 .RS 4n
1466 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.
1467 .RE
1468
1469 .sp
1470 .ne 2
1471 .mk
1472 .na
1473 \fB\fB-m\fR\fR
1474 .ad
1475 .sp .6
1476 .RS 4n
1477 Allows a pool to import when there is a missing log device.
1478 .RE
1479
1480 .RE
1481
1482 .sp
1483 .ne 2
1484 .mk
1485 .na
1486 \fB\fBzpool iostat\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1487 .ad
1488 .sp .6
1489 .RS 4n
1490 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.
1491 .sp
1492 .ne 2
1493 .mk
1494 .na
1495 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1496 .ad
1497 .RS 12n
1498 .rt
1499 Display a time stamp.
1500 .sp
1501 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).
1502 .RE
1503
1504 .sp
1505 .ne 2
1506 .mk
1507 .na
1508 \fB\fB-v\fR\fR
1509 .ad
1510 .RS 12n
1511 .rt
1512 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1513 .RE
1514
1515 .RE
1516
1517 .sp
1518 .ne 2
1519 .mk
1520 .na
1521 \fB\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
1522 .ad
1523 .sp .6
1524 .RS 4n
1525 Removes ZFS label information from the specified device. The device must not be part of an active pool configuration.
1526 .sp
1527 .ne 2
1528 .mk
1529 .na
1530 \fB\fB-f\fR\fR
1531 .ad
1532 .RS 12n
1533 .rt
1534 Treat exported or foreign devices as inactive.
1535 .RE
1536
1537 .RE
1538
1539 .sp
1540 .ne 2
1541 .mk
1542 .na
1543 \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
1544 .ad
1545 .sp .6
1546 .RS 4n
1547 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.
1548 .sp
1549 .ne 2
1550 .mk
1551 .na
1552 \fB\fB-H\fR\fR
1553 .ad
1554 .RS 12n
1555 .rt
1556 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1557 .RE
1558
1559 .ne 2
1560 .mk
1561 .na
1562 \fB\fB-T\fR \fBd\fR | \fBu\fR\fR
1563 .ad
1564 .RS 12n
1565 .rt
1566 Display a time stamp.
1567 .sp
1568 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).
1569 .RE
1570
1571 .sp
1572 .ne 2
1573 .mk
1574 .na
1575 \fB\fB-o\fR \fIprops\fR\fR
1576 .ad
1577 .RS 12n
1578 .rt
1579 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, expandsize, capacity, dedupratio, health, altroot"
1580 .RE
1581
1582 .sp
1583 .ne 2
1584 .mk
1585 .na
1586 \fB\fB-v\fR\fR
1587 .ad
1588 .RS 12n
1589 .rt
1590 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wise statistics.
1591 .RE
1592
1593 .RE
1594
1595 .sp
1596 .ne 2
1597 .mk
1598 .na
1599 \fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1600 .ad
1601 .sp .6
1602 .RS 4n
1603 Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1604 .sp
1605 This command is not applicable to spares or cache devices.
1606 .sp
1607 .ne 2
1608 .mk
1609 .na
1610 \fB\fB-t\fR\fR
1611 .ad
1612 .RS 6n
1613 .rt
1614 Temporary. Upon reboot, the specified physical device reverts to its previous state.
1615 .RE
1616
1617 .RE
1618
1619 .sp
1620 .ne 2
1621 .mk
1622 .na
1623 \fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1624 .ad
1625 .sp .6
1626 .RS 4n
1627 Brings the specified physical device online.
1628 .sp
1629 This command is not applicable to spares or cache devices.
1630 .sp
1631 .ne 2
1632 .mk
1633 .na
1634 \fB\fB-e\fR\fR
1635 .ad
1636 .RS 6n
1637 .rt
1638 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.
1639 .RE
1640
1641 .RE
1642
1643 .sp
1644 .ne 2
1645 .mk
1646 .na
1647 \fB\fBzpool reguid\fR \fIpool\fR
1648 .ad
1649 .sp .6
1650 .RS 4n
1651 Generates a new unique identifier for the pool. You must ensure that all
1652 devices in this pool are online and healthy before performing this action.
1653 .RE
1654
1655 .sp
1656 .ne 2
1657 .na
1658 \fB\fBzpool reopen\fR \fIpool\fR
1659 .ad
1660 .sp .6
1661 .RS 4n
1662 Reopen all the vdevs associated with the pool.
1663 .RE
1664
1665 .sp
1666 .ne 2
1667 .na
1668 \fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1669 .ad
1670 .sp .6
1671 .RS 4n
1672 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.
1673 .RE
1674
1675 .sp
1676 .ne 2
1677 .mk
1678 .na
1679 \fB\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
1680 .ad
1681 .sp .6
1682 .RS 4n
1683 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.
1684 .sp
1685 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.
1686 .sp
1687 \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.
1688 .sp
1689 .ne 2
1690 .mk
1691 .na
1692 \fB\fB-f\fR\fR
1693 .ad
1694 .RS 6n
1695 .rt
1696 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1697 .RE
1698
1699 .RE
1700
1701 .sp
1702 .ne 2
1703 .mk
1704 .na
1705 \fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1706 .ad
1707 .sp .6
1708 .RS 4n
1709 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.
1710 .sp
1711 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.
1712 .sp
1713 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.
1714 .sp
1715 .ne 2
1716 .mk
1717 .na
1718 \fB\fB-s\fR\fR
1719 .ad
1720 .RS 6n
1721 .rt
1722 Stop scrubbing.
1723 .RE
1724
1725 .RE
1726
1727 .sp
1728 .ne 2
1729 .mk
1730 .na
1731 \fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1732 .ad
1733 .sp .6
1734 .RS 4n
1735 Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1736 .RE
1737
1738 .sp
1739 .ne 2
1740 .mk
1741 .na
1742 \fBzpool split\fR [\fB-n\fR] [\fB-R\fR \fIaltroot\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fInewpool\fR
1743 .ad
1744 .sp .6
1745 .RS 4n
1746 Split devices off \fIpool\fR creating \fInewpool\fR.  All \fBvdev\fRs in \fIpool\fR must be mirrors.  At the time of the split, \fInewpool\fR will be a replica of \fIpool\fR.
1747
1748 .sp
1749 .ne 2
1750 .mk
1751 .na
1752 \fB\fB-n\fR \fR
1753 .ad
1754 .sp .6
1755 .RS 4n
1756 Do dry run, do not actually perform the split. Print out the expected configuration of \fInewpool\fR.
1757 .RE
1758
1759 .sp
1760 .ne 2
1761 .mk
1762 .na
1763 \fB\fB-R\fR \fIaltroot\fR \fR
1764 .ad
1765 .sp .6
1766 .RS 4n
1767 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.
1768 .RE
1769
1770 .sp
1771 .ne 2
1772 .mk
1773 .na
1774 \fB\fB-o\fR \fIproperty=value\fR \fR
1775 .ad
1776 .sp .6
1777 .RS 4n
1778 Sets the specified property for \fInewpool\fR. See the “Properties” section for more information on the available pool properties.
1779 .RE
1780
1781 .RE
1782
1783 .sp
1784 .ne 2
1785 .mk
1786 .na
1787 \fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR d | u] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
1788 .ad
1789 .sp .6
1790 .RS 4n
1791 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.
1792 .sp
1793 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.
1794 .sp
1795 .ne 2
1796 .mk
1797 .na
1798 \fB\fB-x\fR\fR
1799 .ad
1800 .RS 12n
1801 .rt
1802 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.
1803 .RE
1804
1805 .sp
1806 .ne 2
1807 .mk
1808 .na
1809 \fB\fB-v\fR\fR
1810 .ad
1811 .RS 12n
1812 .rt
1813 Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1814 .RE
1815
1816 .sp
1817 .ne 2
1818 .mk
1819 .na
1820 \fB\fB-D\fR\fR
1821 .ad
1822 .RS 12n
1823 .rt
1824 Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and
1825 referenced (logically referenced in the pool) block counts and sizes by reference count.
1826 .RE
1827
1828 .sp
1829 .ne 2
1830 .mk
1831 .na
1832 \fB\fB-T\fR \fBd\fR | \fBu\fR\fR
1833 .ad
1834 .RS 12n
1835 .rt
1836 Display a time stamp.
1837 .sp
1838 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).
1839 .RE
1840
1841 .sp
1842 .ne 2
1843 .mk
1844 .na
1845 \fB\fBzpool upgrade\fR\fR
1846 .ad
1847 .sp .6
1848 .RS 4n
1849 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.
1850 .RE
1851
1852 .sp
1853 .ne 2
1854 .mk
1855 .na
1856 \fB\fBzpool upgrade\fR \fB-v\fR\fR
1857 .ad
1858 .sp .6
1859 .RS 4n
1860 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.
1861 .RE
1862
1863 .sp
1864 .ne 2
1865 .mk
1866 .na
1867 \fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1868 .ad
1869 .sp .6
1870 .RS 4n
1871 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.
1872 .sp
1873 .ne 2
1874 .mk
1875 .na
1876 \fB\fB-a\fR\fR
1877 .ad
1878 .RS 14n
1879 .rt
1880 Enables all supported features on all pools.
1881 .RE
1882
1883 .sp
1884 .ne 2
1885 .mk
1886 .na
1887 \fB\fB-V\fR \fIversion\fR\fR
1888 .ad
1889 .RS 14n
1890 .rt
1891 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.
1892 .RE
1893
1894 .RE
1895
1896 .SH EXAMPLES
1897 .LP
1898 \fBExample 1 \fRCreating a RAID-Z Storage Pool
1899 .sp
1900 .LP
1901 The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
1902
1903 .sp
1904 .in +2
1905 .nf
1906 # \fBzpool create tank raidz sda sdb sdc sdd sde sdf\fR
1907 .fi
1908 .in -2
1909 .sp
1910
1911 .LP
1912 \fBExample 2 \fRCreating a Mirrored Storage Pool
1913 .sp
1914 .LP
1915 The following command creates a pool with two mirrors, where each mirror contains two disks.
1916
1917 .sp
1918 .in +2
1919 .nf
1920 # \fBzpool create tank mirror sda sdb mirror sdc sdd\fR
1921 .fi
1922 .in -2
1923 .sp
1924
1925 .LP
1926 \fBExample 3 \fRCreating a ZFS Storage Pool by Using Partitions
1927 .sp
1928 .LP
1929 The following command creates an unmirrored pool using two disk partitions.
1930
1931 .sp
1932 .in +2
1933 .nf
1934 # \fBzpool create tank sda1 sdb2\fR
1935 .fi
1936 .in -2
1937 .sp
1938
1939 .LP
1940 \fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
1941 .sp
1942 .LP
1943 The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
1944
1945 .sp
1946 .in +2
1947 .nf
1948 # \fBzpool create tank /path/to/file/a /path/to/file/b\fR
1949 .fi
1950 .in -2
1951 .sp
1952
1953 .LP
1954 \fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
1955 .sp
1956 .LP
1957 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.
1958
1959 .sp
1960 .in +2
1961 .nf
1962 # \fBzpool add tank mirror sda sdb\fR
1963 .fi
1964 .in -2
1965 .sp
1966
1967 .LP
1968 \fBExample 6 \fRListing Available ZFS Storage Pools
1969 .sp
1970 .LP
1971 The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
1972
1973 .sp
1974 .LP
1975 The results from this command are similar to the following:
1976
1977 .sp
1978 .in +2
1979 .nf
1980 # \fBzpool list\fR
1981 NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT
1982 rpool 19.9G 8.43G 11.4G - 42% 1.00x ONLINE -
1983 tank 61.5G 20.0G 41.5G - 32% 1.00x ONLINE -
1984 zion - - - - - - FAULTED -
1985 .fi
1986 .in -2
1987 .sp
1988
1989 .LP
1990 \fBExample 7 \fRDestroying a ZFS Storage Pool
1991 .sp
1992 .LP
1993 The following command destroys the pool \fItank\fR and any datasets contained within.
1994
1995 .sp
1996 .in +2
1997 .nf
1998 # \fBzpool destroy -f tank\fR
1999 .fi
2000 .in -2
2001 .sp
2002
2003 .LP
2004 \fBExample 8 \fRExporting a ZFS Storage Pool
2005 .sp
2006 .LP
2007 The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
2008
2009 .sp
2010 .in +2
2011 .nf
2012 # \fBzpool export tank\fR
2013 .fi
2014 .in -2
2015 .sp
2016
2017 .LP
2018 \fBExample 9 \fRImporting a ZFS Storage Pool
2019 .sp
2020 .LP
2021 The following command displays available pools, and then imports the pool \fItank\fR for use on the system.
2022
2023 .sp
2024 .LP
2025 The results from this command are similar to the following:
2026
2027 .sp
2028 .in +2
2029 .nf
2030 # \fBzpool import\fR
2031 pool: tank
2032 id: 15451357997522795478
2033 state: ONLINE
2034 action: The pool can be imported using its name or numeric identifier.
2035 config:
2036
2037 tank ONLINE
2038 mirror ONLINE
2039 sda ONLINE
2040 sdb ONLINE
2041
2042 # \fBzpool import tank\fR
2043 .fi
2044 .in -2
2045 .sp
2046
2047 .LP
2048 \fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
2049 .sp
2050 .LP
2051 The following command upgrades all ZFS Storage pools to the current version of the software.
2052
2053 .sp
2054 .in +2
2055 .nf
2056 # \fBzpool upgrade -a\fR
2057 This system is currently running ZFS pool version 28.
2058 .fi
2059 .in -2
2060 .sp
2061
2062 .LP
2063 \fBExample 11 \fRManaging Hot Spares
2064 .sp
2065 .LP
2066 The following command creates a new pool with an available hot spare:
2067
2068 .sp
2069 .in +2
2070 .nf
2071 # \fBzpool create tank mirror sda sdb spare sdc\fR
2072 .fi
2073 .in -2
2074 .sp
2075
2076 .sp
2077 .LP
2078 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:
2079
2080 .sp
2081 .in +2
2082 .nf
2083 # \fBzpool replace tank sda sdd\fR
2084 .fi
2085 .in -2
2086 .sp
2087
2088 .sp
2089 .LP
2090 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:
2091
2092 .sp
2093 .in +2
2094 .nf
2095 # \fBzpool remove tank sdc\fR
2096 .fi
2097 .in -2
2098 .sp
2099
2100 .LP
2101 \fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
2102 .sp
2103 .LP
2104 The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
2105
2106 .sp
2107 .in +2
2108 .nf
2109 # \fBzpool create pool mirror sda sdb mirror sdc sdd log mirror \e
2110 sde sdf\fR
2111 .fi
2112 .in -2
2113 .sp
2114
2115 .LP
2116 \fBExample 13 \fRAdding Cache Devices to a ZFS Pool
2117 .sp
2118 .LP
2119 The following command adds two disks for use as cache devices to a ZFS storage pool:
2120
2121 .sp
2122 .in +2
2123 .nf
2124 # \fBzpool add pool cache sdc sdd\fR
2125 .fi
2126 .in -2
2127 .sp
2128
2129 .sp
2130 .LP
2131 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:
2132
2133 .sp
2134 .in +2
2135 .nf
2136 # \fBzpool iostat -v pool 5\fR
2137 .fi
2138 .in -2
2139 .sp
2140
2141 .LP
2142 \fBExample 14 \fRRemoving a Mirrored Log Device
2143 .sp
2144 .LP
2145 The following command removes the mirrored log device \fBmirror-2\fR.
2146
2147 .sp
2148 .LP
2149 Given this configuration:
2150
2151 .sp
2152 .in +2
2153 .nf
2154 pool: tank
2155 state: ONLINE
2156 scrub: none requested
2157 config:
2158
2159 NAME STATE READ WRITE CKSUM
2160 tank ONLINE 0 0 0
2161 mirror-0 ONLINE 0 0 0
2162 sda ONLINE 0 0 0
2163 sdb ONLINE 0 0 0
2164 mirror-1 ONLINE 0 0 0
2165 sdc ONLINE 0 0 0
2166 sdd ONLINE 0 0 0
2167 logs
2168 mirror-2 ONLINE 0 0 0
2169 sde ONLINE 0 0 0
2170 sdf ONLINE 0 0 0
2171 .fi
2172 .in -2
2173 .sp
2174
2175 .sp
2176 .LP
2177 The command to remove the mirrored log \fBmirror-2\fR is:
2178
2179 .sp
2180 .in +2
2181 .nf
2182 # \fBzpool remove tank mirror-2\fR
2183 .fi
2184 .in -2
2185 .sp
2186
2187 .LP
2188 \fBExample 15 \fRDisplaying expanded space on a device
2189 .sp
2190 .LP
2191 The following command dipslays the detailed information for the \fIdata\fR
2192 pool. This pool is comprised of a single \fIraidz\fR vdev where one of its
2193 devices increased its capacity by 1GB. In this example, the pool will not
2194 be able to utilized this extra capacity until all the devices under the
2195 \fIraidz\fR vdev have been expanded.
2196
2197 .sp
2198 .in +2
2199 .nf
2200 # \fBzpool list -v data\fR
2201 NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT
2202 data 17.9G 174K 17.9G - 0% 1.00x ONLINE -
2203 raidz1 17.9G 174K 17.9G -
2204 c4t2d0 - - - 1G
2205 c4t3d0 - - - -
2206 c4t4d0 - - - -
2207 .fi
2208 .in -2
2209
2210 .SH EXIT STATUS
2211 .sp
2212 .LP
2213 The following exit values are returned:
2214 .sp
2215 .ne 2
2216 .mk
2217 .na
2218 \fB\fB0\fR\fR
2219 .ad
2220 .RS 5n
2221 .rt
2222 Successful completion.
2223 .RE
2224
2225 .sp
2226 .ne 2
2227 .mk
2228 .na
2229 \fB\fB1\fR\fR
2230 .ad
2231 .RS 5n
2232 .rt
2233 An error occurred.
2234 .RE
2235
2236 .sp
2237 .ne 2
2238 .mk
2239 .na
2240 \fB\fB2\fR\fR
2241 .ad
2242 .RS 5n
2243 .rt
2244 Invalid command line options were specified.
2245 .RE
2246
2247 .SH SEE ALSO
2248 .sp
2249 .LP
2250 \fBzfs\fR(8), \fBzpool-features\fR(5)