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