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