]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - cddl/contrib/opensolaris/cmd/zpool/zpool.8
MFC ZFS version 28 and related revisions:
[FreeBSD/stable/8.git] / cddl / contrib / opensolaris / cmd / zpool / 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 1M "21 Sep 2009" "SunOS 5.11" "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(1M) 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/dsk\fR. \fBZFS\fR can use individual slices or 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/dsk"). A whole disk can be specified by omitting the slice or partition designation. For example, "c0t0d0" is equivalent to "/dev/dsk/c0t0d0s2". 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 c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0\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 c0d0 c1d0 spare c2d0 c3d0
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 if another device fails.
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 c0d0 c1d0 log c2d0\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 c0d0 c1d0 cache c2d0 c3d0\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(1M) 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 .sp
506 .LP
507 The following property can be set at creation time and import time:
508 .sp
509 .ne 2
510 .mk
511 .na
512 \fB\fBaltroot\fR\fR
513 .ad
514 .sp .6
515 .RS 4n
516 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.
517 .RE
518
519 .sp
520 .LP
521 The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
522 .sp
523 .ne 2
524 .mk
525 .na
526 \fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
527 .ad
528 .sp .6
529 .RS 4n
530 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.
531 .RE
532
533 .sp
534 .ne 2
535 .mk
536 .na
537 \fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
538 .ad
539 .sp .6
540 .RS 4n
541 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".
542 .RE
543
544 .sp
545 .ne 2
546 .mk
547 .na
548 \fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
549 .ad
550 .sp .6
551 .RS 4n
552 Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
553 .RE
554
555 .sp
556 .ne 2
557 .mk
558 .na
559 \fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
560 .ad
561 .sp .6
562 .RS 4n
563 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. 
564 .sp
565 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.
566 .RE
567
568 .sp
569 .ne 2
570 .mk
571 .na
572 \fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
573 .ad
574 .sp .6
575 .RS 4n
576 Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See \fBzfs\fR(1M) for more information on \fBZFS\fR delegated administration.
577 .RE
578
579 .sp
580 .ne 2
581 .mk
582 .na
583 \fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
584 .ad
585 .sp .6
586 .RS 4n
587 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:
588 .sp
589 .ne 2
590 .mk
591 .na
592 \fB\fBwait\fR\fR
593 .ad
594 .RS 12n
595 .rt  
596 Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
597 .RE
598
599 .sp
600 .ne 2
601 .mk
602 .na
603 \fB\fBcontinue\fR\fR
604 .ad
605 .RS 12n
606 .rt  
607 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.
608 .RE
609
610 .sp
611 .ne 2
612 .mk
613 .na
614 \fB\fBpanic\fR\fR
615 .ad
616 .RS 12n
617 .rt  
618 Prints out a message to the console and generates a system crash dump.
619 .RE
620
621 .RE
622
623 .sp
624 .ne 2
625 .mk
626 .na
627 \fB\fBlistsnaps\fR=on | off\fR
628 .ad
629 .sp .6
630 .RS 4n
631 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".
632 .RE
633
634 .sp
635 .ne 2
636 .mk
637 .na
638 \fB\fBversion\fR=\fIversion\fR\fR
639 .ad
640 .sp .6
641 .RS 4n
642 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".
643 .RE
644
645 .SS "Subcommands"
646 .sp
647 .LP
648 All subcommands that modify state are logged persistently to the pool in their original form.
649 .sp
650 .LP
651 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:
652 .sp
653 .ne 2
654 .mk
655 .na
656 \fB\fBzpool\fR \fB-?\fR\fR
657 .ad
658 .sp .6
659 .RS 4n
660 Displays a help message.
661 .RE
662
663 .sp
664 .ne 2
665 .mk
666 .na
667 \fB\fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR ...\fR
668 .ad
669 .sp .6
670 .RS 4n
671 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.
672 .sp
673 .ne 2
674 .mk
675 .na
676 \fB\fB-f\fR\fR
677 .ad
678 .RS 6n
679 .rt  
680 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.
681 .RE
682
683 .sp
684 .ne 2
685 .mk
686 .na
687 \fB\fB-n\fR\fR
688 .ad
689 .RS 6n
690 .rt  
691 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.
692 .RE
693
694 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.
695 .RE
696
697 .sp
698 .ne 2
699 .mk
700 .na
701 \fB\fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
702 .ad
703 .sp .6
704 .RS 4n
705 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.
706 .sp
707 .ne 2
708 .mk
709 .na
710 \fB\fB-f\fR\fR
711 .ad
712 .RS 6n
713 .rt  
714 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
715 .RE
716
717 .RE
718
719 .sp
720 .ne 2
721 .mk
722 .na
723 \fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
724 .ad
725 .sp .6
726 .RS 4n
727 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.
728 .RE
729
730 .sp
731 .ne 2
732 .mk
733 .na
734 \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
735 .ad
736 .sp .6
737 .RS 4n
738 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.
739 .sp
740 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.
741 .sp
742 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.
743 .sp
744 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.
745 .sp
746 .ne 2
747 .mk
748 .na
749 \fB\fB-f\fR\fR
750 .ad
751 .sp .6
752 .RS 4n
753 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.
754 .RE
755
756 .sp
757 .ne 2
758 .mk
759 .na
760 \fB\fB-n\fR\fR
761 .ad
762 .sp .6
763 .RS 4n
764 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.
765 .RE
766
767 .sp
768 .ne 2
769 .mk
770 .na
771 \fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
772 .ad
773 .sp .6
774 .RS 4n
775 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
776 .RE
777
778 .sp
779 .ne 2
780 .mk
781 .na
782 \fB\fB-O\fR \fIfile-system-property=value\fR\fR
783 .ad
784 .br
785 .na
786 \fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
787 .ad
788 .sp .6
789 .RS 4n
790 Sets the given file system properties in the root file system of the pool. See the "Properties" section of \fBzfs\fR(1M) for a list of valid properties that can be set.
791 .RE
792
793 .sp
794 .ne 2
795 .mk
796 .na
797 \fB\fB-R\fR \fIroot\fR\fR
798 .ad
799 .sp .6
800 .RS 4n
801 Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
802 .RE
803
804 .sp
805 .ne 2
806 .mk
807 .na
808 \fB\fB-m\fR \fImountpoint\fR\fR
809 .ad
810 .sp .6
811 .RS 4n
812 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(1M).
813 .RE
814
815 .RE
816
817 .sp
818 .ne 2
819 .mk
820 .na
821 \fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
822 .ad
823 .sp .6
824 .RS 4n
825 Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
826 .sp
827 .ne 2
828 .mk
829 .na
830 \fB\fB-f\fR\fR
831 .ad
832 .RS 6n
833 .rt  
834 Forces any active datasets contained within the pool to be unmounted.
835 .RE
836
837 .RE
838
839 .sp
840 .ne 2
841 .mk
842 .na
843 \fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
844 .ad
845 .sp .6
846 .RS 4n
847 Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data.
848 .RE
849
850 .sp
851 .ne 2
852 .mk
853 .na
854 \fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
855 .ad
856 .sp .6
857 .RS 4n
858 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.
859 .sp
860 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.
861 .sp
862 For pools to be portable, you must give the \fBzpool\fR command whole disks, not just slices, 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.
863 .sp
864 .ne 2
865 .mk
866 .na
867 \fB\fB-f\fR\fR
868 .ad
869 .RS 6n
870 .rt  
871 Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
872 .sp
873 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.
874 .RE
875
876 .RE
877
878 .sp
879 .ne 2
880 .mk
881 .na
882 \fB\fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
883 .ad
884 .sp .6
885 .RS 4n
886 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:
887 .sp
888 .in +2
889 .nf
890        name          Name of storage pool
891         property      Property name
892         value         Property value
893         source        Property source, either 'default' or 'local'.
894 .fi
895 .in -2
896 .sp
897
898 See the "Properties" section for more information on the available pool properties.
899 .RE
900
901 .sp
902 .ne 2
903 .mk
904 .na
905 \fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
906 .ad
907 .sp .6
908 .RS 4n
909 Displays the command history of the specified pools or all pools if no pool is specified.
910 .sp
911 .ne 2
912 .mk
913 .na
914 \fB\fB-i\fR\fR
915 .ad
916 .RS 6n
917 .rt  
918 Displays internally logged \fBZFS\fR events in addition to user initiated events.
919 .RE
920
921 .sp
922 .ne 2
923 .mk
924 .na
925 \fB\fB-l\fR\fR
926 .ad
927 .RS 6n
928 .rt  
929 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.
930 .RE
931
932 .RE
933
934 .sp
935 .ne 2
936 .mk
937 .na
938 \fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
939 .ad
940 .sp .6
941 .RS 4n
942 Lists pools available to import. If the \fB-d\fR option is not specified, this command searches for devices in "/dev/dsk". 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. 
943 .sp
944 The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
945 .sp
946 .ne 2
947 .mk
948 .na
949 \fB\fB-c\fR \fIcachefile\fR\fR
950 .ad
951 .RS 16n
952 .rt  
953 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.
954 .RE
955
956 .sp
957 .ne 2
958 .mk
959 .na
960 \fB\fB-d\fR \fIdir\fR\fR
961 .ad
962 .RS 16n
963 .rt  
964 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. 
965 .RE
966
967 .sp
968 .ne 2
969 .mk
970 .na
971 \fB\fB-D\fR\fR
972 .ad
973 .RS 16n
974 .rt  
975 Lists destroyed pools only.
976 .RE
977
978 .RE
979
980 .sp
981 .ne 2
982 .mk
983 .na
984 \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
985 .ad
986 .sp .6
987 .RS 4n
988 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.
989 .sp
990 .ne 2
991 .mk
992 .na
993 \fB\fB-o\fR \fImntopts\fR\fR
994 .ad
995 .RS 21n
996 .rt  
997 Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(1M) for a description of dataset properties and mount options.
998 .RE
999
1000 .sp
1001 .ne 2
1002 .mk
1003 .na
1004 \fB\fB-o\fR \fIproperty=value\fR\fR
1005 .ad
1006 .RS 21n
1007 .rt  
1008 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1009 .RE
1010
1011 .sp
1012 .ne 2
1013 .mk
1014 .na
1015 \fB\fB-c\fR \fIcachefile\fR\fR
1016 .ad
1017 .RS 21n
1018 .rt  
1019 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.
1020 .RE
1021
1022 .sp
1023 .ne 2
1024 .mk
1025 .na
1026 \fB\fB-d\fR \fIdir\fR\fR
1027 .ad
1028 .RS 21n
1029 .rt  
1030 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.
1031 .RE
1032
1033 .sp
1034 .ne 2
1035 .mk
1036 .na
1037 \fB\fB-D\fR\fR
1038 .ad
1039 .RS 21n
1040 .rt  
1041 Imports destroyed pools only. The \fB-f\fR option is also required.
1042 .RE
1043
1044 .sp
1045 .ne 2
1046 .mk
1047 .na
1048 \fB\fB-f\fR\fR
1049 .ad
1050 .RS 21n
1051 .rt  
1052 Forces import, even if the pool appears to be potentially active.
1053 .RE
1054
1055 .sp
1056 .ne 2
1057 .mk
1058 .na
1059 \fB\fB-a\fR\fR
1060 .ad
1061 .RS 21n
1062 .rt  
1063 Searches for and imports all pools found. 
1064 .RE
1065
1066 .sp
1067 .ne 2
1068 .mk
1069 .na
1070 \fB\fB-R\fR \fIroot\fR\fR
1071 .ad
1072 .RS 21n
1073 .rt  
1074 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1075 .RE
1076
1077 .RE
1078
1079 .sp
1080 .ne 2
1081 .mk
1082 .na
1083 \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
1084 .ad
1085 .sp .6
1086 .RS 4n
1087 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.
1088 .sp
1089 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.
1090 .sp
1091 .ne 2
1092 .mk
1093 .na
1094 \fB\fB-o\fR \fImntopts\fR\fR
1095 .ad
1096 .sp .6
1097 .RS 4n
1098 Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(1M) for a description of dataset properties and mount options.
1099 .RE
1100
1101 .sp
1102 .ne 2
1103 .mk
1104 .na
1105 \fB\fB-o\fR \fIproperty=value\fR\fR
1106 .ad
1107 .sp .6
1108 .RS 4n
1109 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1110 .RE
1111
1112 .sp
1113 .ne 2
1114 .mk
1115 .na
1116 \fB\fB-c\fR \fIcachefile\fR\fR
1117 .ad
1118 .sp .6
1119 .RS 4n
1120 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.
1121 .RE
1122
1123 .sp
1124 .ne 2
1125 .mk
1126 .na
1127 \fB\fB-d\fR \fIdir\fR\fR
1128 .ad
1129 .sp .6
1130 .RS 4n
1131 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.
1132 .RE
1133
1134 .sp
1135 .ne 2
1136 .mk
1137 .na
1138 \fB\fB-D\fR\fR
1139 .ad
1140 .sp .6
1141 .RS 4n
1142 Imports destroyed pool. The \fB-f\fR option is also required.
1143 .RE
1144
1145 .sp
1146 .ne 2
1147 .mk
1148 .na
1149 \fB\fB-f\fR\fR
1150 .ad
1151 .sp .6
1152 .RS 4n
1153 Forces import, even if the pool appears to be potentially active.
1154 .RE
1155
1156 .sp
1157 .ne 2
1158 .mk
1159 .na
1160 \fB\fB-R\fR \fIroot\fR\fR
1161 .ad
1162 .sp .6
1163 .RS 4n
1164 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1165 .RE
1166
1167 .RE
1168
1169 .sp
1170 .ne 2
1171 .mk
1172 .na
1173 \fB\fBzpool iostat\fR [\fB-T\fR \fBu\fR | \fBd\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1174 .ad
1175 .sp .6
1176 .RS 4n
1177 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.
1178 .sp
1179 .ne 2
1180 .mk
1181 .na
1182 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1183 .ad
1184 .RS 12n
1185 .rt  
1186 Display a time stamp.
1187 .sp
1188 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).
1189 .RE
1190
1191 .sp
1192 .ne 2
1193 .mk
1194 .na
1195 \fB\fB-v\fR\fR
1196 .ad
1197 .RS 12n
1198 .rt  
1199 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1200 .RE
1201
1202 .RE
1203
1204 .sp
1205 .ne 2
1206 .mk
1207 .na
1208 \fB\fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...\fR
1209 .ad
1210 .sp .6
1211 .RS 4n
1212 Lists the given pools along with a health status and space usage. When given no arguments, all pools in the system are listed.
1213 .sp
1214 .ne 2
1215 .mk
1216 .na
1217 \fB\fB-H\fR\fR
1218 .ad
1219 .RS 12n
1220 .rt  
1221 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1222 .RE
1223
1224 .sp
1225 .ne 2
1226 .mk
1227 .na
1228 \fB\fB-o\fR \fIprops\fR\fR
1229 .ad
1230 .RS 12n
1231 .rt  
1232 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"
1233 .RE
1234
1235 .RE
1236
1237 .sp
1238 .ne 2
1239 .mk
1240 .na
1241 \fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1242 .ad
1243 .sp .6
1244 .RS 4n
1245 Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1246 .sp
1247 This command is not applicable to spares or cache devices.
1248 .sp
1249 .ne 2
1250 .mk
1251 .na
1252 \fB\fB-t\fR\fR
1253 .ad
1254 .RS 6n
1255 .rt  
1256 Temporary. Upon reboot, the specified physical device reverts to its previous state.
1257 .RE
1258
1259 .RE
1260
1261 .sp
1262 .ne 2
1263 .mk
1264 .na
1265 \fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1266 .ad
1267 .sp .6
1268 .RS 4n
1269 Brings the specified physical device online.
1270 .sp
1271 This command is not applicable to spares or cache devices.
1272 .sp
1273 .ne 2
1274 .mk
1275 .na
1276 \fB\fB-e\fR\fR
1277 .ad
1278 .RS 6n
1279 .rt  
1280 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.
1281 .RE
1282
1283 .RE
1284
1285 .sp
1286 .ne 2
1287 .mk
1288 .na
1289 \fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1290 .ad
1291 .sp .6
1292 .RS 4n
1293 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.
1294 .RE
1295
1296 .sp
1297 .ne 2
1298 .mk
1299 .na
1300 \fB\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
1301 .ad
1302 .sp .6
1303 .RS 4n
1304 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.
1305 .sp
1306 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.
1307 .sp
1308 \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/dsk\fR path as the old device, even though it is actually a different disk. \fBZFS\fR recognizes this.
1309 .sp
1310 .ne 2
1311 .mk
1312 .na
1313 \fB\fB-f\fR\fR
1314 .ad
1315 .RS 6n
1316 .rt  
1317 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1318 .RE
1319
1320 .RE
1321
1322 .sp
1323 .ne 2
1324 .mk
1325 .na
1326 \fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1327 .ad
1328 .sp .6
1329 .RS 4n
1330 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.
1331 .sp
1332 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.
1333 .sp
1334 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.
1335 .sp
1336 .ne 2
1337 .mk
1338 .na
1339 \fB\fB-s\fR\fR
1340 .ad
1341 .RS 6n
1342 .rt  
1343 Stop scrubbing.
1344 .RE
1345
1346 .RE
1347
1348 .sp
1349 .ne 2
1350 .mk
1351 .na
1352 \fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1353 .ad
1354 .sp .6
1355 .RS 4n
1356 Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1357 .RE
1358
1359 .sp
1360 .ne 2
1361 .mk
1362 .na
1363 \fB\fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...\fR
1364 .ad
1365 .sp .6
1366 .RS 4n
1367 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.
1368 .sp
1369 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.
1370 .sp
1371 .ne 2
1372 .mk
1373 .na
1374 \fB\fB-x\fR\fR
1375 .ad
1376 .RS 6n
1377 .rt  
1378 Only display status for pools that are exhibiting errors or are otherwise unavailable.
1379 .RE
1380
1381 .sp
1382 .ne 2
1383 .mk
1384 .na
1385 \fB\fB-v\fR\fR
1386 .ad
1387 .RS 6n
1388 .rt  
1389 Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1390 .RE
1391
1392 .RE
1393
1394 .sp
1395 .ne 2
1396 .mk
1397 .na
1398 \fB\fBzpool upgrade\fR\fR
1399 .ad
1400 .sp .6
1401 .RS 4n
1402 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.
1403 .RE
1404
1405 .sp
1406 .ne 2
1407 .mk
1408 .na
1409 \fB\fBzpool upgrade\fR \fB-v\fR\fR
1410 .ad
1411 .sp .6
1412 .RS 4n
1413 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.
1414 .RE
1415
1416 .sp
1417 .ne 2
1418 .mk
1419 .na
1420 \fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1421 .ad
1422 .sp .6
1423 .RS 4n
1424 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.
1425 .sp
1426 .ne 2
1427 .mk
1428 .na
1429 \fB\fB-a\fR\fR
1430 .ad
1431 .RS 14n
1432 .rt  
1433 Upgrades all pools.
1434 .RE
1435
1436 .sp
1437 .ne 2
1438 .mk
1439 .na
1440 \fB\fB-V\fR \fIversion\fR\fR
1441 .ad
1442 .RS 14n
1443 .rt  
1444 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.
1445 .RE
1446
1447 .RE
1448
1449 .SH EXAMPLES
1450 .LP
1451 \fBExample 1 \fRCreating a RAID-Z Storage Pool
1452 .sp
1453 .LP
1454 The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
1455
1456 .sp
1457 .in +2
1458 .nf
1459 # \fBzpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0\fR
1460 .fi
1461 .in -2
1462 .sp
1463
1464 .LP
1465 \fBExample 2 \fRCreating a Mirrored Storage Pool
1466 .sp
1467 .LP
1468 The following command creates a pool with two mirrors, where each mirror contains two disks.
1469
1470 .sp
1471 .in +2
1472 .nf
1473 # \fBzpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0\fR
1474 .fi
1475 .in -2
1476 .sp
1477
1478 .LP
1479 \fBExample 3 \fRCreating a ZFS Storage Pool by Using Slices
1480 .sp
1481 .LP
1482 The following command creates an unmirrored pool using two disk slices.
1483
1484 .sp
1485 .in +2
1486 .nf
1487 # \fBzpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4\fR
1488 .fi
1489 .in -2
1490 .sp
1491
1492 .LP
1493 \fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
1494 .sp
1495 .LP
1496 The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
1497
1498 .sp
1499 .in +2
1500 .nf
1501 # \fBzpool create tank /path/to/file/a /path/to/file/b\fR
1502 .fi
1503 .in -2
1504 .sp
1505
1506 .LP
1507 \fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
1508 .sp
1509 .LP
1510 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.
1511
1512 .sp
1513 .in +2
1514 .nf
1515 # \fBzpool add tank mirror c1t0d0 c1t1d0\fR
1516 .fi
1517 .in -2
1518 .sp
1519
1520 .LP
1521 \fBExample 6 \fRListing Available ZFS Storage Pools
1522 .sp
1523 .LP
1524 The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
1525
1526 .sp
1527 .LP
1528 The results from this command are similar to the following:
1529
1530 .sp
1531 .in +2
1532 .nf
1533 # \fBzpool list\fR
1534      NAME              SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
1535      pool             67.5G   2.92M   67.5G     0%  ONLINE     -
1536      tank             67.5G   2.92M   67.5G     0%  ONLINE     -
1537      zion                 -       -       -     0%  FAULTED    -
1538 .fi
1539 .in -2
1540 .sp
1541
1542 .LP
1543 \fBExample 7 \fRDestroying a ZFS Storage Pool
1544 .sp
1545 .LP
1546 The following command destroys the pool "\fItank\fR" and any datasets contained within.
1547
1548 .sp
1549 .in +2
1550 .nf
1551 # \fBzpool destroy -f tank\fR
1552 .fi
1553 .in -2
1554 .sp
1555
1556 .LP
1557 \fBExample 8 \fRExporting a ZFS Storage Pool
1558 .sp
1559 .LP
1560 The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
1561
1562 .sp
1563 .in +2
1564 .nf
1565 # \fBzpool export tank\fR
1566 .fi
1567 .in -2
1568 .sp
1569
1570 .LP
1571 \fBExample 9 \fRImporting a ZFS Storage Pool
1572 .sp
1573 .LP
1574 The following command displays available pools, and then imports the pool "tank" for use on the system.
1575
1576 .sp
1577 .LP
1578 The results from this command are similar to the following:
1579
1580 .sp
1581 .in +2
1582 .nf
1583 # \fBzpool import\fR
1584   pool: tank
1585     id: 15451357997522795478
1586  state: ONLINE
1587 action: The pool can be imported using its name or numeric identifier.
1588 config:
1589
1590         tank        ONLINE
1591           mirror    ONLINE
1592             c1t2d0  ONLINE
1593             c1t3d0  ONLINE
1594
1595 # \fBzpool import tank\fR
1596 .fi
1597 .in -2
1598 .sp
1599
1600 .LP
1601 \fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
1602 .sp
1603 .LP
1604 The following command upgrades all ZFS Storage pools to the current version of the software.
1605
1606 .sp
1607 .in +2
1608 .nf
1609 # \fBzpool upgrade -a\fR
1610 This system is currently running ZFS version 2.
1611 .fi
1612 .in -2
1613 .sp
1614
1615 .LP
1616 \fBExample 11 \fRManaging Hot Spares
1617 .sp
1618 .LP
1619 The following command creates a new pool with an available hot spare:
1620
1621 .sp
1622 .in +2
1623 .nf
1624 # \fBzpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0\fR
1625 .fi
1626 .in -2
1627 .sp
1628
1629 .sp
1630 .LP
1631 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:
1632
1633 .sp
1634 .in +2
1635 .nf
1636 # \fBzpool replace tank c0t0d0 c0t3d0\fR
1637 .fi
1638 .in -2
1639 .sp
1640
1641 .sp
1642 .LP
1643 Once the data has been resilvered, the spare is automatically removed and is made available should another device fails. The hot spare can be permanently removed from the pool using the following command:
1644
1645 .sp
1646 .in +2
1647 .nf
1648 # \fBzpool remove tank c0t2d0\fR
1649 .fi
1650 .in -2
1651 .sp
1652
1653 .LP
1654 \fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
1655 .sp
1656 .LP
1657 The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
1658
1659 .sp
1660 .in +2
1661 .nf
1662 # \fBzpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
1663    c4d0 c5d0\fR
1664 .fi
1665 .in -2
1666 .sp
1667
1668 .LP
1669 \fBExample 13 \fRAdding Cache Devices to a ZFS Pool
1670 .sp
1671 .LP
1672 The following command adds two disks for use as cache devices to a ZFS storage pool:
1673
1674 .sp
1675 .in +2
1676 .nf
1677 # \fBzpool add pool cache c2d0 c3d0\fR
1678 .fi
1679 .in -2
1680 .sp
1681
1682 .sp
1683 .LP
1684 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: 
1685
1686 .sp
1687 .in +2
1688 .nf
1689 # \fBzpool iostat -v pool 5\fR
1690 .fi
1691 .in -2
1692 .sp
1693
1694 .LP
1695 \fBExample 14 \fRRemoving a Mirrored Log Device
1696 .sp
1697 .LP
1698 The following command removes the mirrored log device \fBmirror-2\fR.
1699
1700 .sp
1701 .LP
1702 Given this configuration:
1703
1704 .sp
1705 .in +2
1706 .nf
1707    pool: tank
1708   state: ONLINE
1709   scrub: none requested
1710 config:
1711
1712          NAME        STATE     READ WRITE CKSUM
1713          tank        ONLINE       0     0     0
1714            mirror-0  ONLINE       0     0     0
1715              c6t0d0  ONLINE       0     0     0
1716              c6t1d0  ONLINE       0     0     0
1717            mirror-1  ONLINE       0     0     0
1718              c6t2d0  ONLINE       0     0     0
1719              c6t3d0  ONLINE       0     0     0
1720          logs
1721            mirror-2  ONLINE       0     0     0
1722              c4t0d0  ONLINE       0     0     0
1723              c4t1d0  ONLINE       0     0     0
1724 .fi
1725 .in -2
1726 .sp
1727
1728 .sp
1729 .LP
1730 The command to remove the mirrored log \fBmirror-2\fR is:
1731
1732 .sp
1733 .in +2
1734 .nf
1735 # \fBzpool remove tank mirror-2\fR
1736 .fi
1737 .in -2
1738 .sp
1739
1740 .SH EXIT STATUS
1741 .sp
1742 .LP
1743 The following exit values are returned:
1744 .sp
1745 .ne 2
1746 .mk
1747 .na
1748 \fB\fB0\fR\fR
1749 .ad
1750 .RS 5n
1751 .rt  
1752 Successful completion. 
1753 .RE
1754
1755 .sp
1756 .ne 2
1757 .mk
1758 .na
1759 \fB\fB1\fR\fR
1760 .ad
1761 .RS 5n
1762 .rt  
1763 An error occurred.
1764 .RE
1765
1766 .sp
1767 .ne 2
1768 .mk
1769 .na
1770 \fB\fB2\fR\fR
1771 .ad
1772 .RS 5n
1773 .rt  
1774 Invalid command line options were specified.
1775 .RE
1776
1777 .SH ATTRIBUTES
1778 .sp
1779 .LP
1780 See \fBattributes\fR(5) for descriptions of the following attributes:
1781 .sp
1782
1783 .sp
1784 .TS
1785 tab(\a) box;
1786 cw(2.75i) |cw(2.75i) 
1787 lw(2.75i) |lw(2.75i) 
1788 .
1789 ATTRIBUTE TYPE\aATTRIBUTE VALUE
1790 _
1791 Availability\aSUNWzfsu
1792 _
1793 Interface Stability\aEvolving
1794 .TE
1795
1796 .SH SEE ALSO
1797 .sp
1798 .LP
1799 \fBzfs\fR(1M), \fBattributes\fR(5)