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