Add "ashift" property to zpool create
[zfs.git] / man / man8 / zpool.8
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
4 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
5 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH zpool 8 "8 Apr 2011" "ZFS pool 28, filesystem 5" "System Administration Commands"
7 .SH NAME
8 zpool \- configures ZFS storage pools
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBzpool\fR [\fB-?\fR]
13 .fi
14
15 .LP
16 .nf
17 \fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...
18 .fi
19
20 .LP
21 .nf
22 \fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
23 .fi
24
25 .LP
26 .nf
27 \fBzpool clear\fR \fIpool\fR [\fIdevice\fR]
28 .fi
29
30 .LP
31 .nf
32 \fBzpool create\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR] 
33      ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...
34 .fi
35
36 .LP
37 .nf
38 \fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
39 .fi
40
41 .LP
42 .nf
43 \fBzpool detach\fR \fIpool\fR \fIdevice\fR
44 .fi
45
46 .LP
47 .nf
48 \fBzpool export\fR [\fB-f\fR] \fIpool\fR ...
49 .fi
50
51 .LP
52 .nf
53 \fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
54 .fi
55
56 .LP
57 .nf
58 \fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...
59 .fi
60
61 .LP
62 .nf
63 \fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
64 .fi
65
66 .LP
67 .nf
68 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] 
69      [\fB-D\fR] [\fB-f\fR] [\fB-R\fR \fIroot\fR] \fB-a\fR
70 .fi
71
72 .LP
73 .nf
74 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
75      [\fB-D\fR] [\fB-f\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR |\fIid\fR [\fInewpool\fR]
76 .fi
77
78 .LP
79 .nf
80 \fBzpool iostat\fR [\fB-T\fR u | d ] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
81 .fi
82
83 .LP
84 .nf
85 \fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
86 .fi
87
88 .LP
89 .nf
90 \fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
91 .fi
92
93 .LP
94 .nf
95 \fBzpool online\fR \fIpool\fR \fIdevice\fR ...
96 .fi
97
98 .LP
99 .nf
100 \fBzpool remove\fR \fIpool\fR \fIdevice\fR ...
101 .fi
102
103 .LP
104 .nf
105 \fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR [\fInew_device\fR]
106 .fi
107
108 .LP
109 .nf
110 \fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
111 .fi
112
113 .LP
114 .nf
115 \fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR
116 .fi
117
118 .LP
119 .nf
120 \fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...
121 .fi
122
123 .LP
124 .nf
125 \fBzpool upgrade\fR 
126 .fi
127
128 .LP
129 .nf
130 \fBzpool upgrade\fR \fB-v\fR
131 .fi
132
133 .LP
134 .nf
135 \fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...
136 .fi
137
138 .SH DESCRIPTION
139 .sp
140 .LP
141 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.
142 .sp
143 .LP
144 All datasets within a storage pool share the same space. See \fBzfs\fR(8) for information on managing datasets.
145 .SS "Virtual Devices (\fBvdev\fRs)"
146 .sp
147 .LP
148 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:
149 .sp
150 .ne 2
151 .mk
152 .na
153 \fB\fBdisk\fR\fR
154 .ad
155 .RS 10n
156 .rt  
157 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.
158 .RE
159
160 .sp
161 .ne 2
162 .mk
163 .na
164 \fB\fBfile\fR\fR
165 .ad
166 .RS 10n
167 .rt  
168 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.
169 .RE
170
171 .sp
172 .ne 2
173 .mk
174 .na
175 \fB\fBmirror\fR\fR
176 .ad
177 .RS 10n
178 .rt  
179 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.
180 .RE
181
182 .sp
183 .ne 2
184 .mk
185 .na
186 \fB\fBraidz\fR\fR
187 .ad
188 .br
189 .na
190 \fB\fBraidz1\fR\fR
191 .ad
192 .br
193 .na
194 \fB\fBraidz2\fR\fR
195 .ad
196 .br
197 .na
198 \fB\fBraidz3\fR\fR
199 .ad
200 .RS 10n
201 .rt  
202 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.
203 .sp
204 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.
205 .sp
206 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.
207 .RE
208
209 .sp
210 .ne 2
211 .mk
212 .na
213 \fB\fBspare\fR\fR
214 .ad
215 .RS 10n
216 .rt  
217 A special pseudo-\fBvdev\fR which keeps track of available hot spares for a pool. For more information, see the "Hot Spares" section.
218 .RE
219
220 .sp
221 .ne 2
222 .mk
223 .na
224 \fB\fBlog\fR\fR
225 .ad
226 .RS 10n
227 .rt  
228 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.
229 .RE
230
231 .sp
232 .ne 2
233 .mk
234 .na
235 \fB\fBcache\fR\fR
236 .ad
237 .RS 10n
238 .rt  
239 A device used to cache storage pool data. A cache device cannot be cannot be configured as a mirror or \fBraidz\fR group. For more information, see the "Cache Devices" section.
240 .RE
241
242 .sp
243 .LP
244 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.
245 .sp
246 .LP
247 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.
248 .sp
249 .LP
250 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:
251 .sp
252 .in +2
253 .nf
254 # \fBzpool create mypool mirror sda sdb mirror sdc sdd\fR
255 .fi
256 .in -2
257 .sp
258
259 .SS "Device Failure and Recovery"
260 .sp
261 .LP
262 \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.
263 .sp
264 .LP
265 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.
266 .sp
267 .LP
268 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. 
269 .sp
270 .LP
271 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:
272 .sp
273 .ne 2
274 .mk
275 .na
276 \fB\fBDEGRADED\fR\fR
277 .ad
278 .RS 12n
279 .rt  
280 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.
281 .sp
282 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:
283 .RS +4
284 .TP
285 .ie t \(bu
286 .el o
287 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.
288 .RE
289 .RS +4
290 .TP
291 .ie t \(bu
292 .el o
293 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.
294 .RE
295 .RE
296
297 .sp
298 .ne 2
299 .mk
300 .na
301 \fB\fBFAULTED\fR\fR
302 .ad
303 .RS 12n
304 .rt  
305 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. 
306 .sp
307 One or more component devices is in the faulted state, and insufficient replicas exist to continue functioning. The underlying conditions are as follows:
308 .RS +4
309 .TP
310 .ie t \(bu
311 .el o
312 The device could be opened, but the contents did not match expected values. 
313 .RE
314 .RS +4
315 .TP
316 .ie t \(bu
317 .el o
318 The number of I/O errors exceeds acceptable levels and the device is faulted to prevent further use of the device.
319 .RE
320 .RE
321
322 .sp
323 .ne 2
324 .mk
325 .na
326 \fB\fBOFFLINE\fR\fR
327 .ad
328 .RS 12n
329 .rt  
330 The device was explicitly taken offline by the "\fBzpool offline\fR" command.
331 .RE
332
333 .sp
334 .ne 2
335 .mk
336 .na
337 \fB\fBONLINE\fR\fR
338 .ad
339 .RS 12n
340 .rt  
341 The device is online and functioning.
342 .RE
343
344 .sp
345 .ne 2
346 .mk
347 .na
348 \fB\fBREMOVED\fR\fR
349 .ad
350 .RS 12n
351 .rt  
352 The device was physically removed while the system was running. Device removal detection is hardware-dependent and may not be supported on all platforms.
353 .RE
354
355 .sp
356 .ne 2
357 .mk
358 .na
359 \fB\fBUNAVAIL\fR\fR
360 .ad
361 .RS 12n
362 .rt  
363 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.
364 .RE
365
366 .sp
367 .LP
368 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.
369 .SS "Hot Spares"
370 .sp
371 .LP
372 \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, 
373 .sp
374 .in +2
375 .nf
376 # zpool create pool mirror sda sdb spare sdc sdd
377 .fi
378 .in -2
379 .sp
380
381 .sp
382 .LP
383 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.
384 .sp
385 .LP
386 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.
387 .sp
388 .LP
389 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.
390 .sp
391 .LP
392 Spares cannot replace log devices.
393 .SS "Intent Log"
394 .sp
395 .LP
396 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:
397 .sp
398 .in +2
399 .nf
400 \fB# zpool create pool sda sdb log sdc\fR
401 .fi
402 .in -2
403 .sp
404
405 .sp
406 .LP
407 Multiple log devices can also be specified, and they can be mirrored. See the EXAMPLES section for an example of mirroring multiple log devices.
408 .sp
409 .LP
410 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.
411 .SS "Cache Devices"
412 .sp
413 .LP
414 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.
415 .sp
416 .LP
417 To create a pool with cache devices, specify a "cache" \fBvdev\fR with any number of devices. For example:
418 .sp
419 .in +2
420 .nf
421 \fB# zpool create pool sda sdb cache sdc sdd\fR
422 .fi
423 .in -2
424 .sp
425
426 .sp
427 .LP
428 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.
429 .sp
430 .LP
431 The content of the cache devices is considered volatile, as is the case with other system caches.
432 .SS "Properties"
433 .sp
434 .LP
435 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:
436 .sp
437 .ne 2
438 .mk
439 .na
440 \fB\fBavailable\fR\fR
441 .ad
442 .RS 20n
443 .rt  
444 Amount of storage available within the pool. This property can also be referred to by its shortened column name, "avail".
445 .RE
446
447 .sp
448 .ne 2
449 .mk
450 .na
451 \fB\fBcapacity\fR\fR
452 .ad
453 .RS 20n
454 .rt  
455 Percentage of pool space used. This property can also be referred to by its shortened column name, "cap".
456 .RE
457
458 .sp
459 .ne 2
460 .mk
461 .na
462 \fB\fBhealth\fR\fR
463 .ad
464 .RS 20n
465 .rt  
466 The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR", "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
467 .RE
468
469 .sp
470 .ne 2
471 .mk
472 .na
473 \fB\fBguid\fR\fR
474 .ad
475 .RS 20n
476 .rt  
477 A unique identifier for the pool.
478 .RE
479
480 .sp
481 .ne 2
482 .mk
483 .na
484 \fB\fBsize\fR\fR
485 .ad
486 .RS 20n
487 .rt  
488 Total size of the storage pool.
489 .RE
490
491 .sp
492 .ne 2
493 .mk
494 .na
495 \fB\fBused\fR\fR
496 .ad
497 .RS 20n
498 .rt  
499 Amount of storage space used within the pool.
500 .RE
501
502 .sp
503 .LP
504 These 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.
505
506 .sp
507 .LP
508 The following property can be set at creation time:
509 .sp
510 .ne 2
511 .mk
512 .na
513 \fB\fBashift\fR\fR
514 .ad
515 .sp .6
516 .RS 4n
517 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).
518 .LP
519 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.
520 .RE
521
522 .sp
523 .LP
524 The following property can be set at creation time and import time:
525 .sp
526 .ne 2
527 .mk
528 .na
529 \fB\fBaltroot\fR\fR
530 .ad
531 .sp .6
532 .RS 4n
533 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.
534 .RE
535
536 .sp
537 .LP
538 The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
539 .sp
540 .ne 2
541 .mk
542 .na
543 \fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
544 .ad
545 .sp .6
546 .RS 4n
547 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.
548 .RE
549
550 .sp
551 .ne 2
552 .mk
553 .na
554 \fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
555 .ad
556 .sp .6
557 .RS 4n
558 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".
559 .RE
560
561 .sp
562 .ne 2
563 .mk
564 .na
565 \fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
566 .ad
567 .sp .6
568 .RS 4n
569 Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
570 .RE
571
572 .sp
573 .ne 2
574 .mk
575 .na
576 \fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
577 .ad
578 .sp .6
579 .RS 4n
580 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. 
581 .sp
582 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.
583 .RE
584
585 .sp
586 .ne 2
587 .mk
588 .na
589 \fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
590 .ad
591 .sp .6
592 .RS 4n
593 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.
594 .RE
595
596 .sp
597 .ne 2
598 .mk
599 .na
600 \fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
601 .ad
602 .sp .6
603 .RS 4n
604 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:
605 .sp
606 .ne 2
607 .mk
608 .na
609 \fB\fBwait\fR\fR
610 .ad
611 .RS 12n
612 .rt  
613 Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
614 .RE
615
616 .sp
617 .ne 2
618 .mk
619 .na
620 \fB\fBcontinue\fR\fR
621 .ad
622 .RS 12n
623 .rt  
624 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.
625 .RE
626
627 .sp
628 .ne 2
629 .mk
630 .na
631 \fB\fBpanic\fR\fR
632 .ad
633 .RS 12n
634 .rt  
635 Prints out a message to the console and generates a system crash dump.
636 .RE
637
638 .RE
639
640 .sp
641 .ne 2
642 .mk
643 .na
644 \fB\fBlistsnaps\fR=on | off\fR
645 .ad
646 .sp .6
647 .RS 4n
648 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".
649 .RE
650
651 .sp
652 .ne 2
653 .mk
654 .na
655 \fB\fBversion\fR=\fIversion\fR\fR
656 .ad
657 .sp .6
658 .RS 4n
659 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. This property can be any number between 1 and the current version reported by "\fBzpool upgrade -v\fR".
660 .RE
661
662 .SS "Subcommands"
663 .sp
664 .LP
665 All subcommands that modify state are logged persistently to the pool in their original form.
666 .sp
667 .LP
668 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:
669 .sp
670 .ne 2
671 .mk
672 .na
673 \fB\fBzpool\fR \fB-?\fR\fR
674 .ad
675 .sp .6
676 .RS 4n
677 Displays a help message.
678 .RE
679
680 .sp
681 .ne 2
682 .mk
683 .na
684 \fB\fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...\fR
685 .ad
686 .sp .6
687 .RS 4n
688 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.
689 .sp
690 .ne 2
691 .mk
692 .na
693 \fB\fB-f\fR\fR
694 .ad
695 .RS 6n
696 .rt  
697 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.
698 .RE
699
700 .sp
701 .ne 2
702 .mk
703 .na
704 \fB\fB-n\fR\fR
705 .ad
706 .RS 6n
707 .rt  
708 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.
709 .RE
710
711 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.
712 .RE
713
714 .sp
715 .ne 2
716 .mk
717 .na
718 \fB\fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
719 .ad
720 .sp .6
721 .RS 4n
722 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.
723 .sp
724 .ne 2
725 .mk
726 .na
727 \fB\fB-f\fR\fR
728 .ad
729 .RS 6n
730 .rt  
731 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
732 .RE
733
734 .RE
735
736 .sp
737 .ne 2
738 .mk
739 .na
740 \fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
741 .ad
742 .sp .6
743 .RS 4n
744 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.
745 .RE
746
747 .sp
748 .ne 2
749 .mk
750 .na
751 \fB\fBzpool create\fR [\fB-fn\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
752 .ad
753 .sp .6
754 .RS 4n
755 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 ("-"), and period ("."). 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.
756 .sp
757 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.
758 .sp
759 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.
760 .sp
761 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.
762 .sp
763 .ne 2
764 .mk
765 .na
766 \fB\fB-f\fR\fR
767 .ad
768 .sp .6
769 .RS 4n
770 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.
771 .RE
772
773 .sp
774 .ne 2
775 .mk
776 .na
777 \fB\fB-n\fR\fR
778 .ad
779 .sp .6
780 .RS 4n
781 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.
782 .RE
783
784 .sp
785 .ne 2
786 .mk
787 .na
788 \fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
789 .ad
790 .sp .6
791 .RS 4n
792 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
793 .RE
794
795 .sp
796 .ne 2
797 .mk
798 .na
799 \fB\fB-O\fR \fIfile-system-property=value\fR\fR
800 .ad
801 .br
802 .na
803 \fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
804 .ad
805 .sp .6
806 .RS 4n
807 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.
808 .RE
809
810 .sp
811 .ne 2
812 .mk
813 .na
814 \fB\fB-R\fR \fIroot\fR\fR
815 .ad
816 .sp .6
817 .RS 4n
818 Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
819 .RE
820
821 .sp
822 .ne 2
823 .mk
824 .na
825 \fB\fB-m\fR \fImountpoint\fR\fR
826 .ad
827 .sp .6
828 .RS 4n
829 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).
830 .RE
831
832 .RE
833
834 .sp
835 .ne 2
836 .mk
837 .na
838 \fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
839 .ad
840 .sp .6
841 .RS 4n
842 Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
843 .sp
844 .ne 2
845 .mk
846 .na
847 \fB\fB-f\fR\fR
848 .ad
849 .RS 6n
850 .rt  
851 Forces any active datasets contained within the pool to be unmounted.
852 .RE
853
854 .RE
855
856 .sp
857 .ne 2
858 .mk
859 .na
860 \fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
861 .ad
862 .sp .6
863 .RS 4n
864 Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data.
865 .RE
866
867 .sp
868 .ne 2
869 .mk
870 .na
871 \fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
872 .ad
873 .sp .6
874 .RS 4n
875 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.
876 .sp
877 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.
878 .sp
879 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.
880 .sp
881 .ne 2
882 .mk
883 .na
884 \fB\fB-f\fR\fR
885 .ad
886 .RS 6n
887 .rt  
888 Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
889 .sp
890 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.
891 .RE
892
893 .RE
894
895 .sp
896 .ne 2
897 .mk
898 .na
899 \fB\fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
900 .ad
901 .sp .6
902 .RS 4n
903 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:
904 .sp
905 .in +2
906 .nf
907        name          Name of storage pool
908         property      Property name
909         value         Property value
910         source        Property source, either 'default' or 'local'.
911 .fi
912 .in -2
913 .sp
914
915 See the "Properties" section for more information on the available pool properties.
916 .RE
917
918 .sp
919 .ne 2
920 .mk
921 .na
922 \fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
923 .ad
924 .sp .6
925 .RS 4n
926 Displays the command history of the specified pools or all pools if no pool is specified.
927 .sp
928 .ne 2
929 .mk
930 .na
931 \fB\fB-i\fR\fR
932 .ad
933 .RS 6n
934 .rt  
935 Displays internally logged \fBZFS\fR events in addition to user initiated events.
936 .RE
937
938 .sp
939 .ne 2
940 .mk
941 .na
942 \fB\fB-l\fR\fR
943 .ad
944 .RS 6n
945 .rt  
946 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.
947 .RE
948
949 .RE
950
951 .sp
952 .ne 2
953 .mk
954 .na
955 \fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
956 .ad
957 .sp .6
958 .RS 4n
959 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. 
960 .sp
961 The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
962 .sp
963 .ne 2
964 .mk
965 .na
966 \fB\fB-c\fR \fIcachefile\fR\fR
967 .ad
968 .RS 16n
969 .rt  
970 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.
971 .RE
972
973 .sp
974 .ne 2
975 .mk
976 .na
977 \fB\fB-d\fR \fIdir\fR\fR
978 .ad
979 .RS 16n
980 .rt  
981 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. 
982 .RE
983
984 .sp
985 .ne 2
986 .mk
987 .na
988 \fB\fB-D\fR\fR
989 .ad
990 .RS 16n
991 .rt  
992 Lists destroyed pools only.
993 .RE
994
995 .RE
996
997 .sp
998 .ne 2
999 .mk
1000 .na
1001 \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-R\fR \fIroot\fR] \fB-a\fR\fR
1002 .ad
1003 .sp .6
1004 .RS 4n
1005 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.
1006 .sp
1007 .ne 2
1008 .mk
1009 .na
1010 \fB\fB-o\fR \fImntopts\fR\fR
1011 .ad
1012 .RS 21n
1013 .rt  
1014 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.
1015 .RE
1016
1017 .sp
1018 .ne 2
1019 .mk
1020 .na
1021 \fB\fB-o\fR \fIproperty=value\fR\fR
1022 .ad
1023 .RS 21n
1024 .rt  
1025 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1026 .RE
1027
1028 .sp
1029 .ne 2
1030 .mk
1031 .na
1032 \fB\fB-c\fR \fIcachefile\fR\fR
1033 .ad
1034 .RS 21n
1035 .rt  
1036 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.
1037 .RE
1038
1039 .sp
1040 .ne 2
1041 .mk
1042 .na
1043 \fB\fB-d\fR \fIdir\fR\fR
1044 .ad
1045 .RS 21n
1046 .rt  
1047 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.
1048 .RE
1049
1050 .sp
1051 .ne 2
1052 .mk
1053 .na
1054 \fB\fB-D\fR\fR
1055 .ad
1056 .RS 21n
1057 .rt  
1058 Imports destroyed pools only. The \fB-f\fR option is also required.
1059 .RE
1060
1061 .sp
1062 .ne 2
1063 .mk
1064 .na
1065 \fB\fB-f\fR\fR
1066 .ad
1067 .RS 21n
1068 .rt  
1069 Forces import, even if the pool appears to be potentially active.
1070 .RE
1071
1072 .sp
1073 .ne 2
1074 .mk
1075 .na
1076 \fB\fB-a\fR\fR
1077 .ad
1078 .RS 21n
1079 .rt  
1080 Searches for and imports all pools found. 
1081 .RE
1082
1083 .sp
1084 .ne 2
1085 .mk
1086 .na
1087 \fB\fB-R\fR \fIroot\fR\fR
1088 .ad
1089 .RS 21n
1090 .rt  
1091 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1092 .RE
1093
1094 .RE
1095
1096 .sp
1097 .ne 2
1098 .mk
1099 .na
1100 \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-R\fR \fIroot\fR] \fIpool\fR | \fIid\fR [\fInewpool\fR]\fR
1101 .ad
1102 .sp .6
1103 .RS 4n
1104 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.
1105 .sp
1106 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.
1107 .sp
1108 .ne 2
1109 .mk
1110 .na
1111 \fB\fB-o\fR \fImntopts\fR\fR
1112 .ad
1113 .sp .6
1114 .RS 4n
1115 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.
1116 .RE
1117
1118 .sp
1119 .ne 2
1120 .mk
1121 .na
1122 \fB\fB-o\fR \fIproperty=value\fR\fR
1123 .ad
1124 .sp .6
1125 .RS 4n
1126 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1127 .RE
1128
1129 .sp
1130 .ne 2
1131 .mk
1132 .na
1133 \fB\fB-c\fR \fIcachefile\fR\fR
1134 .ad
1135 .sp .6
1136 .RS 4n
1137 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.
1138 .RE
1139
1140 .sp
1141 .ne 2
1142 .mk
1143 .na
1144 \fB\fB-d\fR \fIdir\fR\fR
1145 .ad
1146 .sp .6
1147 .RS 4n
1148 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.
1149 .RE
1150
1151 .sp
1152 .ne 2
1153 .mk
1154 .na
1155 \fB\fB-D\fR\fR
1156 .ad
1157 .sp .6
1158 .RS 4n
1159 Imports destroyed pool. The \fB-f\fR option is also required.
1160 .RE
1161
1162 .sp
1163 .ne 2
1164 .mk
1165 .na
1166 \fB\fB-f\fR\fR
1167 .ad
1168 .sp .6
1169 .RS 4n
1170 Forces import, even if the pool appears to be potentially active.
1171 .RE
1172
1173 .sp
1174 .ne 2
1175 .mk
1176 .na
1177 \fB\fB-R\fR \fIroot\fR\fR
1178 .ad
1179 .sp .6
1180 .RS 4n
1181 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1182 .RE
1183
1184 .RE
1185
1186 .sp
1187 .ne 2
1188 .mk
1189 .na
1190 \fB\fBzpool iostat\fR [\fB-T\fR \fBu\fR | \fBd\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1191 .ad
1192 .sp .6
1193 .RS 4n
1194 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.
1195 .sp
1196 .ne 2
1197 .mk
1198 .na
1199 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1200 .ad
1201 .RS 12n
1202 .rt  
1203 Display a time stamp.
1204 .sp
1205 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).
1206 .RE
1207
1208 .sp
1209 .ne 2
1210 .mk
1211 .na
1212 \fB\fB-v\fR\fR
1213 .ad
1214 .RS 12n
1215 .rt  
1216 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1217 .RE
1218
1219 .RE
1220
1221 .sp
1222 .ne 2
1223 .mk
1224 .na
1225 \fB\fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...\fR
1226 .ad
1227 .sp .6
1228 .RS 4n
1229 Lists the given pools along with a health status and space usage. When given no arguments, all pools in the system are listed.
1230 .sp
1231 .ne 2
1232 .mk
1233 .na
1234 \fB\fB-H\fR\fR
1235 .ad
1236 .RS 12n
1237 .rt  
1238 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1239 .RE
1240
1241 .sp
1242 .ne 2
1243 .mk
1244 .na
1245 \fB\fB-o\fR \fIprops\fR\fR
1246 .ad
1247 .RS 12n
1248 .rt  
1249 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, capacity, health, altroot"
1250 .RE
1251
1252 .RE
1253
1254 .sp
1255 .ne 2
1256 .mk
1257 .na
1258 \fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1259 .ad
1260 .sp .6
1261 .RS 4n
1262 Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1263 .sp
1264 This command is not applicable to spares or cache devices.
1265 .sp
1266 .ne 2
1267 .mk
1268 .na
1269 \fB\fB-t\fR\fR
1270 .ad
1271 .RS 6n
1272 .rt  
1273 Temporary. Upon reboot, the specified physical device reverts to its previous state.
1274 .RE
1275
1276 .RE
1277
1278 .sp
1279 .ne 2
1280 .mk
1281 .na
1282 \fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1283 .ad
1284 .sp .6
1285 .RS 4n
1286 Brings the specified physical device online.
1287 .sp
1288 This command is not applicable to spares or cache devices.
1289 .sp
1290 .ne 2
1291 .mk
1292 .na
1293 \fB\fB-e\fR\fR
1294 .ad
1295 .RS 6n
1296 .rt  
1297 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.
1298 .RE
1299
1300 .RE
1301
1302 .sp
1303 .ne 2
1304 .mk
1305 .na
1306 \fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1307 .ad
1308 .sp .6
1309 .RS 4n
1310 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.
1311 .RE
1312
1313 .sp
1314 .ne 2
1315 .mk
1316 .na
1317 \fB\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
1318 .ad
1319 .sp .6
1320 .RS 4n
1321 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.
1322 .sp
1323 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.
1324 .sp
1325 \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.
1326 .sp
1327 .ne 2
1328 .mk
1329 .na
1330 \fB\fB-f\fR\fR
1331 .ad
1332 .RS 6n
1333 .rt  
1334 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1335 .RE
1336
1337 .RE
1338
1339 .sp
1340 .ne 2
1341 .mk
1342 .na
1343 \fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1344 .ad
1345 .sp .6
1346 .RS 4n
1347 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.
1348 .sp
1349 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.
1350 .sp
1351 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.
1352 .sp
1353 .ne 2
1354 .mk
1355 .na
1356 \fB\fB-s\fR\fR
1357 .ad
1358 .RS 6n
1359 .rt  
1360 Stop scrubbing.
1361 .RE
1362
1363 .RE
1364
1365 .sp
1366 .ne 2
1367 .mk
1368 .na
1369 \fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1370 .ad
1371 .sp .6
1372 .RS 4n
1373 Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1374 .RE
1375
1376 .sp
1377 .ne 2
1378 .mk
1379 .na
1380 \fB\fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...\fR
1381 .ad
1382 .sp .6
1383 .RS 4n
1384 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.
1385 .sp
1386 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.
1387 .sp
1388 .ne 2
1389 .mk
1390 .na
1391 \fB\fB-x\fR\fR
1392 .ad
1393 .RS 6n
1394 .rt  
1395 Only display status for pools that are exhibiting errors or are otherwise unavailable.
1396 .RE
1397
1398 .sp
1399 .ne 2
1400 .mk
1401 .na
1402 \fB\fB-v\fR\fR
1403 .ad
1404 .RS 6n
1405 .rt  
1406 Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1407 .RE
1408
1409 .RE
1410
1411 .sp
1412 .ne 2
1413 .mk
1414 .na
1415 \fB\fBzpool upgrade\fR\fR
1416 .ad
1417 .sp .6
1418 .RS 4n
1419 Displays all pools formatted using a different \fBZFS\fR on-disk version. Older versions can continue to be used, but some features may not be available. These pools can be upgraded using "\fBzpool upgrade -a\fR". Pools that are formatted with a more recent version are also displayed, although these pools will be inaccessible on the system.
1420 .RE
1421
1422 .sp
1423 .ne 2
1424 .mk
1425 .na
1426 \fB\fBzpool upgrade\fR \fB-v\fR\fR
1427 .ad
1428 .sp .6
1429 .RS 4n
1430 Displays \fBZFS\fR versions supported by the current software. The current \fBZFS\fR versions and all previous supported versions are displayed, along with an explanation of the features provided with each version.
1431 .RE
1432
1433 .sp
1434 .ne 2
1435 .mk
1436 .na
1437 \fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1438 .ad
1439 .sp .6
1440 .RS 4n
1441 Upgrades the given pool to the latest on-disk version. Once this is done, the pool will no longer be accessible on systems running older versions of the software.
1442 .sp
1443 .ne 2
1444 .mk
1445 .na
1446 \fB\fB-a\fR\fR
1447 .ad
1448 .RS 14n
1449 .rt  
1450 Upgrades all pools.
1451 .RE
1452
1453 .sp
1454 .ne 2
1455 .mk
1456 .na
1457 \fB\fB-V\fR \fIversion\fR\fR
1458 .ad
1459 .RS 14n
1460 .rt  
1461 Upgrade to the specified version. If the \fB-V\fR flag is not specified, the pool is upgraded to the most recent version. This option can only be used to increase the version number, and only up to the most recent version supported by this software.
1462 .RE
1463
1464 .RE
1465
1466 .SH EXAMPLES
1467 .LP
1468 \fBExample 1 \fRCreating a RAID-Z Storage Pool
1469 .sp
1470 .LP
1471 The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
1472
1473 .sp
1474 .in +2
1475 .nf
1476 # \fBzpool create tank raidz sda sdb sdc sdd sde sdf\fR
1477 .fi
1478 .in -2
1479 .sp
1480
1481 .LP
1482 \fBExample 2 \fRCreating a Mirrored Storage Pool
1483 .sp
1484 .LP
1485 The following command creates a pool with two mirrors, where each mirror contains two disks.
1486
1487 .sp
1488 .in +2
1489 .nf
1490 # \fBzpool create tank mirror sda sdb mirror sdc sdd\fR
1491 .fi
1492 .in -2
1493 .sp
1494
1495 .LP
1496 \fBExample 3 \fRCreating a ZFS Storage Pool by Using Partitions
1497 .sp
1498 .LP
1499 The following command creates an unmirrored pool using two disk partitions.
1500
1501 .sp
1502 .in +2
1503 .nf
1504 # \fBzpool create tank sda1 sdb2\fR
1505 .fi
1506 .in -2
1507 .sp
1508
1509 .LP
1510 \fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
1511 .sp
1512 .LP
1513 The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
1514
1515 .sp
1516 .in +2
1517 .nf
1518 # \fBzpool create tank /path/to/file/a /path/to/file/b\fR
1519 .fi
1520 .in -2
1521 .sp
1522
1523 .LP
1524 \fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
1525 .sp
1526 .LP
1527 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.
1528
1529 .sp
1530 .in +2
1531 .nf
1532 # \fBzpool add tank mirror sda sdb\fR
1533 .fi
1534 .in -2
1535 .sp
1536
1537 .LP
1538 \fBExample 6 \fRListing Available ZFS Storage Pools
1539 .sp
1540 .LP
1541 The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
1542
1543 .sp
1544 .LP
1545 The results from this command are similar to the following:
1546
1547 .sp
1548 .in +2
1549 .nf
1550 # \fBzpool list\fR
1551      NAME              SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
1552      pool             67.5G   2.92M   67.5G     0%  ONLINE     -
1553      tank             67.5G   2.92M   67.5G     0%  ONLINE     -
1554      zion                 -       -       -     0%  FAULTED    -
1555 .fi
1556 .in -2
1557 .sp
1558
1559 .LP
1560 \fBExample 7 \fRDestroying a ZFS Storage Pool
1561 .sp
1562 .LP
1563 The following command destroys the pool \fItank\fR and any datasets contained within.
1564
1565 .sp
1566 .in +2
1567 .nf
1568 # \fBzpool destroy -f tank\fR
1569 .fi
1570 .in -2
1571 .sp
1572
1573 .LP
1574 \fBExample 8 \fRExporting a ZFS Storage Pool
1575 .sp
1576 .LP
1577 The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
1578
1579 .sp
1580 .in +2
1581 .nf
1582 # \fBzpool export tank\fR
1583 .fi
1584 .in -2
1585 .sp
1586
1587 .LP
1588 \fBExample 9 \fRImporting a ZFS Storage Pool
1589 .sp
1590 .LP
1591 The following command displays available pools, and then imports the pool \fItank\fR for use on the system.
1592
1593 .sp
1594 .LP
1595 The results from this command are similar to the following:
1596
1597 .sp
1598 .in +2
1599 .nf
1600 # \fBzpool import\fR
1601   pool: tank
1602     id: 15451357997522795478
1603  state: ONLINE
1604 action: The pool can be imported using its name or numeric identifier.
1605 config:
1606
1607         tank        ONLINE
1608           mirror    ONLINE
1609             sda     ONLINE
1610             sdb     ONLINE
1611
1612 # \fBzpool import tank\fR
1613 .fi
1614 .in -2
1615 .sp
1616
1617 .LP
1618 \fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
1619 .sp
1620 .LP
1621 The following command upgrades all ZFS Storage pools to the current version of the software.
1622
1623 .sp
1624 .in +2
1625 .nf
1626 # \fBzpool upgrade -a\fR
1627 This system is currently running ZFS pool version 28.
1628 .fi
1629 .in -2
1630 .sp
1631
1632 .LP
1633 \fBExample 11 \fRManaging Hot Spares
1634 .sp
1635 .LP
1636 The following command creates a new pool with an available hot spare:
1637
1638 .sp
1639 .in +2
1640 .nf
1641 # \fBzpool create tank mirror sda sdb spare sdc\fR
1642 .fi
1643 .in -2
1644 .sp
1645
1646 .sp
1647 .LP
1648 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:
1649
1650 .sp
1651 .in +2
1652 .nf
1653 # \fBzpool replace tank sda sdd\fR
1654 .fi
1655 .in -2
1656 .sp
1657
1658 .sp
1659 .LP
1660 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:
1661
1662 .sp
1663 .in +2
1664 .nf
1665 # \fBzpool remove tank sdc\fR
1666 .fi
1667 .in -2
1668 .sp
1669
1670 .LP
1671 \fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
1672 .sp
1673 .LP
1674 The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
1675
1676 .sp
1677 .in +2
1678 .nf
1679 # \fBzpool create pool mirror sda sdb mirror sdc sdd log mirror \e
1680    sde sdf\fR
1681 .fi
1682 .in -2
1683 .sp
1684
1685 .LP
1686 \fBExample 13 \fRAdding Cache Devices to a ZFS Pool
1687 .sp
1688 .LP
1689 The following command adds two disks for use as cache devices to a ZFS storage pool:
1690
1691 .sp
1692 .in +2
1693 .nf
1694 # \fBzpool add pool cache sdc sdd\fR
1695 .fi
1696 .in -2
1697 .sp
1698
1699 .sp
1700 .LP
1701 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: 
1702
1703 .sp
1704 .in +2
1705 .nf
1706 # \fBzpool iostat -v pool 5\fR
1707 .fi
1708 .in -2
1709 .sp
1710
1711 .LP
1712 \fBExample 14 \fRRemoving a Mirrored Log Device
1713 .sp
1714 .LP
1715 The following command removes the mirrored log device \fBmirror-2\fR.
1716
1717 .sp
1718 .LP
1719 Given this configuration:
1720
1721 .sp
1722 .in +2
1723 .nf
1724    pool: tank
1725   state: ONLINE
1726   scrub: none requested
1727 config:
1728
1729          NAME        STATE     READ WRITE CKSUM
1730          tank        ONLINE       0     0     0
1731            mirror-0  ONLINE       0     0     0
1732              sda     ONLINE       0     0     0
1733              sdb     ONLINE       0     0     0
1734            mirror-1  ONLINE       0     0     0
1735              sdc     ONLINE       0     0     0
1736              sdd     ONLINE       0     0     0
1737          logs
1738            mirror-2  ONLINE       0     0     0
1739              sde     ONLINE       0     0     0
1740              sdf     ONLINE       0     0     0
1741 .fi
1742 .in -2
1743 .sp
1744
1745 .sp
1746 .LP
1747 The command to remove the mirrored log \fBmirror-2\fR is:
1748
1749 .sp
1750 .in +2
1751 .nf
1752 # \fBzpool remove tank mirror-2\fR
1753 .fi
1754 .in -2
1755 .sp
1756
1757 .SH EXIT STATUS
1758 .sp
1759 .LP
1760 The following exit values are returned:
1761 .sp
1762 .ne 2
1763 .mk
1764 .na
1765 \fB\fB0\fR\fR
1766 .ad
1767 .RS 5n
1768 .rt  
1769 Successful completion. 
1770 .RE
1771
1772 .sp
1773 .ne 2
1774 .mk
1775 .na
1776 \fB\fB1\fR\fR
1777 .ad
1778 .RS 5n
1779 .rt  
1780 An error occurred.
1781 .RE
1782
1783 .sp
1784 .ne 2
1785 .mk
1786 .na
1787 \fB\fB2\fR\fR
1788 .ad
1789 .RS 5n
1790 .rt  
1791 Invalid command line options were specified.
1792 .RE
1793
1794 .SH SEE ALSO
1795 .sp
1796 .LP
1797 \fBzfs\fR(8)