]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - cddl/contrib/opensolaris/cmd/zpool/zpool.8
MFC zfs manpage update
[FreeBSD/stable/9.git] / cddl / contrib / opensolaris / cmd / zpool / zpool.8
1 '\" te
2 .\" Copyright (c) 2011, Martin Matuska <mm@FreeBSD.org>.
3 .\" All Rights Reserved.
4 .\"
5 .\" The contents of this file are subject to the terms of the
6 .\" Common Development and Distribution License (the "License").
7 .\" You may not use this file except in compliance with the License.
8 .\"
9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 .\" or http://www.opensolaris.org/os/licensing.
11 .\" See the License for the specific language governing permissions
12 .\" and limitations under the License.
13 .\"
14 .\" When distributing Covered Code, include this CDDL HEADER in each
15 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 .\" If applicable, add the following below this CDDL HEADER, with the
17 .\" fields enclosed by brackets "[]" replaced with your own identifying
18 .\" information: Portions Copyright [yyyy] [name of copyright owner]
19 .\"
20 .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved.
21 .\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved.
22 .\" Copyright (c) 2011, Justin T. Gibbs <gibbs@FreeBSD.org>
23 .\"
24 .\" $FreeBSD$
25 .\"
26 .Dd November 26, 2011
27 .Dt ZPOOL 8
28 .Os
29 .Sh NAME
30 .Nm zpool
31 .Nd configures ZFS storage pools
32 .Sh SYNOPSIS
33 .Nm
34 .Op Fl \&?
35 .Nm
36 .Cm add
37 .Op Fl fn
38 .Ar pool vdev ...
39 .Nm
40 .Cm attach
41 .Op Fl f
42 .Ar pool device new_device
43 .Nm
44 .Cm clear
45 .Op Fl F Op Fl n
46 .Ar pool
47 .Op Ar device
48 .Nm
49 .Cm create
50 .Op Fl fn
51 .Op Fl o Ar property Ns = Ns Ar value
52 .Ar ...
53 .Op Fl O Ar file-system-property Ns = Ns Ar value
54 .Ar ...
55 .Op Fl m Ar mountpoint
56 .Op Fl R Ar root
57 .Ar pool vdev ...
58 .Nm
59 .Cm destroy
60 .Op Fl f
61 .Ar pool
62 .Nm
63 .Cm detach
64 .Ar pool device
65 .Nm
66 .Cm export
67 .Op Fl f
68 .Ar pool ...
69 .Nm
70 .Cm get
71 .Ar all | property Ns Op , Ns Ar ...
72 .Ar pool ...
73 .Nm
74 .Cm history
75 .Op Fl il
76 .Op Ar pool
77 .Ar ...
78 .Nm
79 .Cm import
80 .Op Fl d Ar dir | Fl c Ar cachefile
81 .Op Fl D
82 .Nm
83 .Cm import
84 .Op Fl o Ar mntopts
85 .Op Fl o Ar property Ns = Ns Ar value
86 .Ar ...
87 .Op Fl d Ar dir | Fl c Ar cachefile
88 .Op Fl D
89 .Op Fl f
90 .Op Fl m
91 .Op Fl N
92 .Op Fl R Ar root
93 .Op Fl F Op Fl n
94 .Fl a
95 .Nm
96 .Cm import
97 .Op Fl o Ar mntopts
98 .Op Fl o Ar property Ns = Ns Ar value
99 .Ar ...
100 .Op Fl d Ar dir | Fl c Ar cachefile
101 .Op Fl D
102 .Op Fl f
103 .Op Fl m
104 .Op Fl N
105 .Op Fl R Ar root
106 .Op Fl F Op Fl n
107 .Ar pool | id
108 .Op Ar newpool
109 .Nm
110 .Cm iostat
111 .Op Fl T Cm d Ns | Ns Cm u
112 .Op Fl v
113 .Op Ar pool
114 .Ar ...
115 .Nm
116 .Cm labelclear
117 .Op Fl f
118 .Ar device
119 .Nm
120 .Cm list
121 .Op Fl H
122 .Op Fl o Ar property Ns Op , Ns Ar ...
123 .Op Fl T Cm d Ns | Ns Cm u
124 .Op Ar pool
125 .Ar ...
126 .Op Ar inverval Op Ar count
127 .Nm
128 .Cm offline
129 .Op Fl t
130 .Ar pool device ...
131 .Nm
132 .Cm online
133 .Op Fl e
134 .Ar pool device ...
135 .Nm
136 .Cm remove
137 .Ar pool device ...
138 .Nm
139 .Cm replace
140 .Op Fl f
141 .Ar pool device
142 .Op Ar new_device
143 .Nm
144 .Cm scrub
145 .Op Fl s
146 .Ar pool ...
147 .Nm
148 .Cm set
149 .Ar property Ns = Ns Ar value pool
150 .Nm
151 .Cm split
152 .Op Fl n
153 .Op Fl R Ar altroot
154 .Op Fl o Ar mntopts
155 .Op Fl o Ar property Ns = Ns Ar value
156 .Ar pool newpool
157 .Op Ar device ...
158 .Nm
159 .Cm status
160 .Op Fl vx
161 .Op Fl T Cm d Ns | Ns Cm u
162 .Op Ar pool
163 .Ar ...
164 .Op Ar interval Op Ar count
165 .Nm
166 .Cm upgrade
167 .Op Fl v
168 .Nm
169 .Cm upgrade
170 .Op Fl V Ar version
171 .Fl a | Ar pool ...
172 .Sh DESCRIPTION
173 The
174 .Nm
175 command configures
176 .Tn ZFS
177 storage pools. A storage pool is a collection of devices that provides physical
178 storage and data replication for
179 .Tn ZFS
180 datasets.
181 .Pp
182 All datasets within a storage pool share the same space. See
183 .Xr zfs 8
184 for information on managing datasets.
185 .Ss Virtual Devices (vdevs)
186 A
187 .Qq virtual device
188 .Pq No vdev
189 describes a single device or a collection of devices organized according to 
190 certain performance and fault characteristics. The following virtual devices
191 are supported:
192 .Bl -tag
193 .It Sy disk
194 A block device, typically located under
195 .Pa /dev Ns .
196 .Tn ZFS
197 can use individual slices or partitions, though the recommended mode of
198 operation is to use whole disks. A disk can be specified by a full path to the
199 device or the
200 .Xr geom 4
201 provider name. When given a whole disk,
202 .Tn ZFS
203 automatically labels the disk, if necessary.
204 .It Sy file
205 A regular file. The use of files as a backing store is strongly discouraged. It
206 is designed primarily for experimental purposes, as the fault tolerance of a
207 file is only as good the file system of which it is a part. A file must be
208 specified by a full path.
209 .It Sy mirror
210 A mirror of two or more devices. Data is replicated in an identical fashion
211 across all components of a mirror. A mirror with
212 .Em N
213 disks of size
214 .Em X
215 can hold
216 .Em X
217 bytes and can withstand
218 .Pq Em N-1
219 devices failing before data integrity is compromised.
220 .It Sy raidz
221 .No ( or Sy raidz1 raidz2 raidz3 Ns ).
222 A variation on
223 .Sy RAID-5
224 that allows for better distribution of parity and eliminates the
225 .Qq Sy RAID-5 No write hole
226 (in which data and parity become inconsistent after a power loss). Data and
227 parity is striped across all disks within a
228 .No raidz
229 group.
230 .Pp
231 A
232 .No raidz
233 group can have single-, double- , or triple parity, meaning that the
234 .No raidz
235 group can sustain one, two, or three failures, respectively, without
236 losing any data. The 
237 .Sy raidz1 No vdev
238 type specifies a single-parity
239 .No raidz
240 group; the
241 .Sy raidz2 No vdev
242 type specifies a double-parity
243 .No raidz
244 group; and the
245 .Sy raidz3 No vdev
246 type specifies a triple-parity
247 .No raidz
248 group. The
249 .Sy raidz No vdev
250 type is an alias for
251 .Sy raidz1 Ns .
252 .Pp
253 A
254 .No raidz
255 group with
256 .Em N
257 disks of size
258 .Em X
259 with
260 .Em P
261 parity disks can hold approximately
262 .Sm off
263 .Pq Em N-P
264 *X
265 .Sm on
266 bytes and can withstand
267 .Em P
268 device(s) failing before data integrity is compromised. The minimum number of
269 devices in a
270 .No raidz
271 group is one more than the number of parity disks. The
272 recommended number is between 3 and 9 to help increase performance.
273 .It Sy spare
274 A special
275 .No pseudo- Ns No vdev
276 which keeps track of available hot spares for a pool.
277 For more information, see the
278 .Qq Sx Hot Spares
279 section.
280 .It Sy log
281 A separate-intent log device. If more than one log device is specified, then
282 writes are load-balanced between devices. Log devices can be mirrored. However,
283 .No raidz
284 .No vdev
285 types are not supported for the intent log. For more information,
286 see the 
287 .Qq Sx Intent Log
288 section.
289 .It Sy cache
290 A device used to cache storage pool data. A cache device cannot be configured
291 as a mirror or
292 .No raidz
293 group. For more information, see the
294 .Qq Sx Cache Devices
295 section.
296 .El
297 .Pp
298 Virtual devices cannot be nested, so a mirror or
299 .No raidz
300 virtual device can only
301 contain files or disks. Mirrors of mirrors (or other combinations) are not
302 allowed.
303 .Pp
304 A pool can have any number of virtual devices at the top of the configuration
305 (known as
306 .Qq root
307 .No vdev Ns s).
308 Data is dynamically distributed across all top-level devices to balance data 
309 among devices. As new virtual devices are added,
310 .Tn ZFS
311 automatically places data on the newly available devices.
312 .Pp
313 Virtual devices are specified one at a time on the command line, separated by
314 whitespace. The keywords 
315 .Qq mirror
316 and
317 .Qq raidz
318 are used to distinguish where a group ends and another begins. For example, the
319 following creates two root
320 .No vdev Ns s,
321 each a mirror of two disks:
322 .Ss Device Failure and Recovery
323 .Tn ZFS
324 supports a rich set of mechanisms for handling device failure and data
325 corruption. All metadata and data is checksummed, and
326 .Tn ZFS
327 automatically repairs bad data from a good copy when corruption is detected.
328 .Pp
329 In order to take advantage of these features, a pool must make use of some form
330 of redundancy, using either mirrored or
331 .No raidz
332 groups. While
333 .Tn ZFS
334 supports running in a non-redundant configuration, where each root
335 .No vdev
336 is simply a disk or file, this is strongly discouraged. A single case of bit
337 corruption can render some or all of your data unavailable.
338 .Pp
339 A pool's health status is described by one of three states: online, degraded,
340 or faulted. An online pool has all devices operating normally. A degraded pool
341 is one in which one or more devices have failed, but the data is still
342 available due to a redundant configuration. A faulted pool has corrupted
343 metadata, or one or more faulted devices, and insufficient replicas to continue
344 functioning.
345 .Pp
346 The health of the top-level
347 .No vdev ,
348 such as mirror or
349 .No raidz
350 device, is
351 potentially impacted by the state of its associated
352 .No vdev Ns s,
353 or component devices. A top-level
354 .No vdev
355 or component device is in one of the following states:
356 .Bl -tag -width "DEGRADED"
357 .It Sy DEGRADED
358 One or more top-level
359 .No vdev Ns s
360 is in the degraded state because one or more
361 component devices are offline. Sufficient replicas exist to continue
362 functioning.
363 .Pp
364 One or more component devices is in the degraded or faulted state, but
365 sufficient replicas exist to continue functioning. The underlying conditions
366 are as follows:
367 .Bl -bullet -offset 2n
368 .It
369 The number of checksum errors exceeds acceptable levels and the device is
370 degraded as an indication that something may be wrong.
371 .Tn ZFS
372 continues to use the device as necessary.
373 .It
374 The number of
375 .Tn I/O
376 errors exceeds acceptable levels. The device could not be
377 marked as faulted because there are insufficient replicas to continue
378 functioning.
379 .El
380 .It Sy FAULTED
381 One or more top-level
382 .No vdev Ns s
383 is in the faulted state because one or more
384 component devices are offline. Insufficient replicas exist to continue
385 functioning.
386 .Pp
387 One or more component devices is in the faulted state, and insufficient
388 replicas exist to continue functioning. The underlying conditions are as
389 follows:
390 .Bl -bullet -offset 2n
391 .It
392 The device could be opened, but the contents did not match expected values.
393 .It
394 The number of
395 .Tn I/O
396 errors exceeds acceptable levels and the device is faulted to
397 prevent further use of the device.
398 .El
399 .It Sy OFFLINE
400 The device was explicitly taken offline by the
401 .Qq Nm Cm offline
402 command.
403 .It Sy ONLINE
404 The device is online and functioning.
405 .It Sy REMOVED
406 The device was physically removed while the system was running. Device removal
407 detection is hardware-dependent and may not be supported on all platforms.
408 .It Sy UNAVAIL
409 The device could not be opened. If a pool is imported when a device was
410 unavailable, then the device will be identified by a unique identifier instead
411 of its path since the path was never correct in the first place.
412 .El
413 .Pp
414 If a device is removed and later reattached to the system,
415 .Tn ZFS
416 attempts to put the device online automatically. Device attach detection is
417 hardware-dependent and might not be supported on all platforms.
418 .Ss Hot Spares
419 .Tn ZFS
420 allows devices to be associated with pools as
421 .Qq hot spares Ns .
422 These devices are not actively used in the pool, but when an active device
423 fails, it is automatically replaced by a hot spare. To create a pool with hot
424 spares, specify a 
425 .Qq spare
426 .No vdev
427 with any number of devices. For example,
428 .Bd -literal -offset 2n
429 .Li # Ic zpool create pool mirror da0 da1 spare da2 da3
430 .Ed
431 .Pp
432 Spares can be shared across multiple pools, and can be added with the
433 .Qq Nm Cm add
434 command and removed with the
435 .Qq Nm Cm remove
436 command. Once a spare replacement is initiated, a new "spare"
437 .No vdev
438 is created
439 within the configuration that will remain there until the original device is
440 replaced. At this point, the hot spare becomes available again if another
441 device fails.
442 .Pp
443 If a pool has a shared spare that is currently being used, the pool can not be
444 exported since other pools may use this shared spare, which may lead to
445 potential data corruption.
446 .Pp
447 An in-progress spare replacement can be cancelled by detaching the hot spare.
448 If the original faulted device is detached, then the hot spare assumes its
449 place in the configuration, and is removed from the spare list of all active
450 pools.
451 .Pp
452 Spares cannot replace log devices.
453 .Ss Intent Log
454 The 
455 .Tn ZFS
456 Intent Log
457 .Pq Tn ZIL
458 satisfies
459 .Tn POSIX
460 requirements for synchronous transactions. For instance, databases often
461 require their transactions to be on stable storage devices when returning from
462 a system call.
463 .Tn NFS
464 and other applications can also use
465 .Xr fsync 2
466 to ensure data stability. By default, the intent log is allocated from blocks
467 within the main pool. However, it might be possible to get better performance
468 using separate intent log devices such as
469 .Tn NVRAM
470 or a dedicated disk. For example:
471 .Bd -literal -offset 2n
472 .Li # Ic zpool create pool da0 da1 log da2
473 .Ed
474 .Pp
475 Multiple log devices can also be specified, and they can be mirrored. See the
476 .Sx EXAMPLES
477 section for an example of mirroring multiple log devices.
478 .Pp
479 Log devices can be added, replaced, attached, detached, imported and exported
480 as part of the larger pool. Mirrored log devices can be removed by specifying
481 the top-level mirror for the log.
482 .Ss Cache devices
483 Devices can be added to a storage pool as "cache devices." These devices
484 provide an additional layer of caching between main memory and disk. For
485 read-heavy workloads, where the working set size is much larger than what can
486 be cached in main memory, using cache devices allow much more of this working
487 set to be served from low latency media. Using cache devices provides the
488 greatest performance improvement for random read-workloads of mostly static
489 content.
490 .Pp
491 To create a pool with cache devices, specify a "cache"
492 .No vdev
493 with any number of devices. For example:
494 .Bd -literal -offset 2n
495 .Li # Ic zpool create pool da0 da1 cache da2 da3
496 .Ed
497 .Pp
498 Cache devices cannot be mirrored or part of a
499 .No raidz
500 configuration. If a read
501 error is encountered on a cache device, that read
502 .Tn I/O
503 is reissued to the original storage pool device, which might be part of a
504 mirrored or
505 .No raidz
506 configuration.
507 .Pp
508 The content of the cache devices is considered volatile, as is the case with
509 other system caches.
510 .Ss Properties
511 Each pool has several properties associated with it. Some properties are
512 read-only statistics while others are configurable and change the behavior of
513 the pool. The following are read-only properties:
514 .Bl -tag -width "dedupratio"
515 .It Sy alloc
516 Amount of storage space within the pool that has been physically allocated.
517 .It Sy capacity
518 Percentage of pool space used. This property can also be referred to by its
519 shortened column name, "cap".
520 .It Sy comment
521 A text string consisting of printable ASCII characters that will be stored
522 such that it is available even if the pool becomes faulted.  An administrator
523 can provide additional information about a pool using this property.
524 .It Sy dedupratio
525 The deduplication ratio specified for a pool, expressed as a multiplier.
526 For example, a
527 .S dedupratio
528 value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See
529 .Xr zfs 8
530 for a description of the deduplication feature.
531 .It Sy free
532 Number of blocks within the pool that are not allocated.
533 .It Sy guid
534 A unique identifier for the pool.
535 .It Sy health
536 The current health of the pool. Health can be
537 .Qq Sy ONLINE Ns ,
538 .Qq Sy DEGRADED Ns ,
539 .Qq Sy FAULTED Ns ,
540 .Qq Sy OFFLINE Ns ,
541 .Qq Sy REMOVED Ns , or
542 .Qq Sy UNAVAIL Ns .
543 .It Sy size
544 Total size of the storage pool.
545 .It Sy used
546 Amount of storage space used within the pool.
547 .El
548 .Pp
549 These space usage properties report actual physical space available to the
550 storage pool. The physical space can be different from the total amount of
551 space that any contained datasets can actually use. The amount of space used in
552 a
553 .No raidz
554 configuration depends on the characteristics of the data being written.
555 In addition,
556 .Tn ZFS
557 reserves some space for internal accounting that the
558 .Xr zfs 8
559 command takes into account, but the
560 .Xr zpool 8
561 command does not. For non-full pools of a reasonable size, these effects should
562 be invisible. For small pools, or pools that are close to being completely
563 full, these discrepancies may become more noticeable.
564 .Pp
565 The following property can be set at creation time and import time:
566 .Bl -tag -width 2n
567 .It Sy altroot
568 Alternate root directory. If set, this directory is prepended to any mount
569 points within the pool. This can be used when examining an unknown pool where
570 the mount points cannot be trusted, or in an alternate boot environment, where
571 the typical paths are not valid.
572 .Sy altroot
573 is not a persistent property. It is valid only while the system is up.
574 Setting
575 .Sy altroot 
576 defaults to using
577 .Cm cachefile=none Ns ,
578 though this may be overridden using an explicit setting.
579 .El
580 .Pp
581 The following property can only be set at import time:
582 .Bl -tag -width 2n
583 .It Sy readonly Ns = Ns Cm on No | Cm off
584 If set to
585 .Cm on Ns ,
586 pool will be imported in read-only mode with the following restrictions:
587 .Bl -bullet -offset 2n
588 .It
589 Synchronous data in the intent log will not be accessible
590 .It
591 Properties of the pool can not be changed
592 .It
593 Datasets of this pool can only be mounted read-only
594 .It
595 To write to a read-only pool, a export and import of the pool is required.
596 .El
597 .El
598 .Pp
599 The following properties can be set at creation time and import time, and later
600 changed with the
601 .Ic zpool set
602 command:
603 .Bl -tag -width 2n
604 .It Sy autoexpand Ns = Ns Cm on No | Cm off
605 Controls automatic pool expansion when the underlying LUN is grown. If set to
606 .Qq Cm on Ns ,
607 the pool will be resized according to the size of the expanded
608 device. If the device is part of a mirror or
609 .No raidz
610 then all devices within that
611 .No mirror/ Ns No raidz
612 group must be expanded before the new space is made available to
613 the pool. The default behavior is
614 .Qq off Ns .
615 This property can also be referred to by its shortened column name,
616 .Sy expand Ns .
617 .It Sy autoreplace Ns = Ns Cm on No | Cm off
618 Controls automatic device replacement. If set to
619 .Qq Cm off Ns ,
620 device replacement must be initiated by the administrator by using the 
621 .Qq Nm Cm replace
622 command. If set to 
623 .Qq Cm on Ns ,
624 any new device, found in the same
625 physical location as a device that previously belonged to the pool, is
626 automatically formatted and replaced. The default behavior is
627 .Qq Cm off Ns .
628 This property can also be referred to by its shortened column name, "replace".
629 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
630 Identifies the default bootable dataset for the root pool. This property is
631 expected to be set mainly by the installation and upgrade programs.
632 .It Sy cachefile Ns = Ns Ar path No | Cm none
633 Controls the location of where the pool configuration is cached. Discovering
634 all pools on system startup requires a cached copy of the configuration data
635 that is stored on the root file system. All pools in this cache are
636 automatically imported when the system boots. Some environments, such as
637 install and clustering, need to cache this information in a different location
638 so that pools are not automatically imported. Setting this property caches the
639 pool configuration in a different location that can later be imported with
640 .Qq Nm Cm import Fl c .
641 Setting it to the special value
642 .Qq Cm none
643 creates a temporary pool that is never cached, and the special value 
644 .Cm ''
645 (empty string) uses the default location.
646 .It Sy dedupditto Ns = Ns Ar number
647 Threshold for the number of block ditto copies. If the reference count for a
648 deduplicated block increases above this number, a new ditto copy of this block
649 is automatically stored. Deafult setting is
650 .Cm 0 Ns .
651 .It Sy delegation Ns = Ns Cm on No | Cm off
652 Controls whether a non-privileged user is granted access based on the dataset
653 permissions defined on the dataset. See
654 .Xr zfs 8
655 for more information on
656 .Tn ZFS
657 delegated administration.
658 .It Sy failmode Ns = Ns Cm wait No | Cm continue No | Cm panic
659 Controls the system behavior in the event of catastrophic pool failure. This
660 condition is typically a result of a loss of connectivity to the underlying
661 storage device(s) or a failure of all devices within the pool. The behavior of
662 such an event is determined as follows:
663 .Bl -tag -width indent
664 .It Sy wait
665 Blocks all
666 .Tn I/O
667 access until the device connectivity is recovered and the errors are cleared.
668 This is the default behavior.
669 .It Sy continue
670 Returns
671 .Em EIO
672 to any new write
673 .Tn I/O
674 requests but allows reads to any of the remaining healthy devices. Any write
675 requests that have yet to be committed to disk would be blocked.
676 .It Sy panic
677 Prints out a message to the console and generates a system crash dump.
678 .El
679 .It Sy listsnaps Ns = Ns Cm on No | Cm off
680 Controls whether information about snapshots associated with this pool is
681 output when
682 .Qq Nm zfs Cm list
683 is run without the
684 .Fl t
685 option. The default value is
686 .Cm off .
687 .It Sy version Ns = Ns Ar version
688 The current on-disk version of the pool. This can be increased, but never
689 decreased. The preferred method of updating pools is with the
690 .Qq Nm Cm upgrade
691 command, though this property can be used when a specific version is needed
692 for backwards compatibility. This property can be any number between 1 and the
693 current version reported by
694 .Qo Ic zpool upgrade -v Qc Ns .
695 .El
696 .Sh SUBCOMMANDS
697 All subcommands that modify state are logged persistently to the pool in their
698 original form.
699 .Pp
700 The
701 .Nm
702 command provides subcommands to create and destroy storage pools, add capacity
703 to storage pools, and provide information about the storage pools. The following
704 subcommands are supported:
705 .Bl -tag -width 2n
706 .It Xo
707 .Nm
708 .Op Fl \&?
709 .Xc
710 .Pp
711 Displays a help message.
712 .It Xo
713 .Nm
714 .Cm add
715 .Op Fl fn
716 .Ar pool vdev ...
717 .Xc
718 .Pp
719 Adds the specified virtual devices to the given pool. The
720 .No vdev
721 specification is described in the
722 .Qq Sx Virtual Devices
723 section. The behavior of the
724 .Fl f
725 option, and the device checks performed are described in the
726 .Qq Nm Cm create
727 subcommand.
728 .Bl -tag -width indent
729 .It Fl f
730 Forces use of
731 .Ar vdev Ns ,
732 even if they appear in use or specify a conflicting replication level.
733 Not all devices can be overridden in this manner.
734 .It Fl n
735 Displays the configuration that would be used without actually adding the
736 .Ar vdev Ns s.
737 The actual pool creation can still fail due to insufficient privileges or device
738 sharing.
739 .Pp
740 Do not add a disk that is currently configured as a quorum device to a zpool.
741 After a disk is in the pool, that disk can then be configured as a quorum
742 device.
743 .El
744 .It Xo
745 .Nm
746 .Cm attach
747 .Op Fl f
748 .Ar pool device new_device
749 .Xc
750 .Pp
751 Attaches
752 .Ar new_device
753 to an existing
754 .Sy zpool
755 device. The existing device cannot be part of a
756 .No raidz
757 configuration. If
758 .Ar device
759 is not currently part of a mirrored configuration,
760 .Ar device
761 automatically transforms into a two-way mirror of
762 .Ar device No and Ar new_device Ns . If
763 .Ar device
764 is part of a two-way mirror, attaching
765 .Ar new_device
766 creates a three-way mirror, and so on. In either case,
767 .Ar new_device
768 begins to resilver immediately.
769 .Bl -tag -width indent
770 .It Fl f
771 Forces use of
772 .Ar new_device Ns ,
773 even if its appears to be in use. Not all devices can be overridden in this
774 manner.
775 .El
776 .It Xo
777 .Nm
778 .Cm clear
779 .Op Fl F Op Fl n
780 .Ar pool
781 .Op Ar device
782 .Xc
783 .Pp
784 Clears device errors in a pool. If no arguments are specified, all device
785 errors within the pool are cleared. If one or more devices is specified, only
786 those errors associated with the specified device or devices are cleared.
787 .Bl -tag -width indent
788 .It Fl F
789 Initiates recovery mode for an unopenable pool. Attempts to discard the last
790 few transactions in the pool to return it to an openable state. Not all damaged
791 pools can be recovered by using this option. If successful, the data from the
792 discarded transactions is irretrievably lost.
793 .It Fl n
794 Used in combination with the
795 .Fl F
796 flag. Check whether discarding transactions would make the pool openable, but
797 do not actually discard any transactions.
798 .El
799 .It Xo
800 .Nm
801 .Cm create
802 .Op Fl fn
803 .Op Fl o Ar property Ns = Ns Ar value
804 .Ar ...
805 .Op Fl O Ar file-system-property Ns = Ns Ar value
806 .Ar ...
807 .Op Fl m Ar mountpoint
808 .Op Fl R Ar root
809 .Ar pool vdev ...
810 .Xc
811 .Pp
812 Creates a new storage pool containing the virtual devices specified on the
813 command line. The pool name must begin with a letter, and can only contain
814 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
815 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
816 names beginning with the pattern "c[0-9]". The
817 .No vdev
818 specification is described in the
819 .Qq Sx Virtual Devices
820 section.
821 .Pp
822 The command verifies that each device specified is accessible and not currently
823 in use by another subsystem. There are some uses, such as being currently
824 mounted, or specified as the dedicated dump device, that prevents a device from
825 ever being used by
826 .Tn ZFS
827 Other uses, such as having a preexisting
828 .Sy UFS
829 file system, can be overridden with the
830 .Fl f
831 option.
832 .Pp
833 The command also checks that the replication strategy for the pool is
834 consistent. An attempt to combine redundant and non-redundant storage in a
835 single pool, or to mix disks and files, results in an error unless
836 .Fl f
837 is specified. The use of differently sized devices within a single
838 .No raidz
839 or mirror group is also flagged as an error unless
840 .Fl f
841 is specified.
842 .Pp
843 Unless the
844 .Fl R
845 option is specified, the default mount point is
846 .Qq Pa /pool Ns .
847 The mount point must not exist or must be empty, or else the
848 root dataset cannot be mounted. This can be overridden with the
849 .Fl m
850 option.
851 .Bl -tag -width indent
852 .It Fl f
853 Forces use of 
854 .Ar vdev Ns s,
855 even if they appear in use or specify a conflicting replication level.
856 Not all devices can be overridden in this manner.
857 .It Fl n
858 Displays the configuration that would be used without actually creating the
859 pool. The actual pool creation can still fail due to insufficient privileges or
860 device sharing.
861 .It Xo
862 .Fl o Ar property Ns = Ns Ar value
863 .Op Fl o Ar property Ns = Ns Ar value
864 .Ar ...
865 .Xc
866 Sets the given pool properties. See the
867 .Qq Sx Properties
868 section for a list of valid properties that can be set.
869 .It Xo
870 .Fl O
871 .Ar file-system-property Ns = Ns Ar value
872 .Op Fl O Ar file-system-property Ns = Ns Ar value
873 .Ar ...
874 .Xc
875 Sets the given file system properties in the root file system of the pool. See
876 .Xr zfs 8 Properties
877 for a list of valid properties that
878 can be set.
879 .It Fl R Ar root
880 Equivalent to
881 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
882 .It Fl m Ar mountpoint
883 Sets the mount point for the root dataset. The default mount point is
884 .Qq Pa /pool
885 or
886 .Qq Cm altroot Ns Pa /pool
887 if
888 .Sy altroot
889 is specified. The mount point must be an absolute path, 
890 .Qq Cm legacy Ns , or Qq Cm none Ns .
891 For more information on dataset mount points, see
892 .Xr zfs 8 Ns \&.
893 .El
894 .It Xo
895 .Nm
896 .Cm destroy
897 .Op Fl f
898 .Ar pool
899 .Xc
900 .Pp
901 Destroys the given pool, freeing up any devices for other use. This command
902 tries to unmount any active datasets before destroying the pool.
903 .Bl -tag -width indent
904 .It Fl f
905 Forces any active datasets contained within the pool to be unmounted.
906 .El
907 .It Xo
908 .Nm
909 .Cm detach
910 .Ar pool device
911 .Xc
912 .Pp
913 Detaches
914 .Ar device
915 from a mirror. The operation is refused if there are no other valid replicas
916 of the data.
917 .It Xo
918 .Nm
919 .Cm export
920 .Op Fl f
921 .Ar pool ...
922 .Xc
923 .Pp
924 Exports the given pools from the system. All devices are marked as exported,
925 but are still considered in use by other subsystems. The devices can be moved
926 between systems (even those of different endianness) and imported as long as a
927 sufficient number of devices are present.
928 .Pp
929 Before exporting the pool, all datasets within the pool are unmounted. A pool
930 can not be exported if it has a shared spare that is currently being used.
931 .Pp
932 For pools to be portable, you must give the
933 .Nm
934 command whole disks, not just slices, so that
935 .Tn ZFS
936 can label the disks with portable
937 .Sy EFI
938 labels. Otherwise, disk drivers on platforms of different endianness will not
939 recognize the disks.
940 .Bl -tag -width indent
941 .It Fl f
942 Forcefully unmount all datasets, using the
943 .Qq Nm unmount Fl f
944 command.
945 .Pp
946 This command will forcefully export the pool even if it has a shared spare that
947 is currently being used. This may lead to potential data corruption.
948 .El
949 .It Xo
950 .Nm
951 .Cm get
952 .Ar all | property Ns Op , Ns Ar ...
953 .Ar pool ...
954 .Xc
955 .Pp
956 Retrieves the given list of properties (or all properties if
957 .Qq Cm all
958 is used) for the specified storage pool(s). These properties are displayed with
959 the following fields:
960 .Bl -column -offset indent "property"
961 .It name Ta Name of storage pool
962 .It property Ta Property name
963 .It value Ta Property value
964 .It source Ta Property source, either 'default' or 'local'.
965 .El
966 .Pp
967 See the
968 .Qq Sx Properties
969 section for more information on the available pool properties.
970 .It Xo
971 .Nm
972 .Cm history
973 .Op Fl il
974 .Op Ar pool
975 .Ar ...
976 .Xc
977 .Pp
978 Displays the command history of the specified pools or all pools if no pool is
979 specified.
980 .Bl -tag -width indent
981 .It Fl i
982 Displays internally logged
983 .Tn ZFS
984 events in addition to user initiated events.
985 .It Fl l
986 Displays log records in long format, which in addition to standard format
987 includes, the user name, the hostname, and the zone in which the operation was
988 performed.
989 .El
990 .It Xo
991 .Nm
992 .Cm import
993 .Op Fl d Ar dir | Fl c Ar cachefile
994 .Op Fl D
995 .Xc
996 .Pp
997 Lists pools available to import. If the
998 .Fl d
999 option is not specified, this command searches for devices in
1000 .Qq Pa /dev Ns .
1001 The
1002 .Fl d
1003 option can be specified multiple times, and all directories are searched. If
1004 the device appears to be part of an exported pool, this command displays a
1005 summary of the pool with the name of the pool, a numeric identifier, as well as
1006 the
1007 .No vdev
1008 layout and current health of the device for each device or file.
1009 Destroyed pools, pools that were previously destroyed with the
1010 .Qq Nm Cm destroy
1011 command, are not listed unless the
1012 .Fl D
1013 option is specified.
1014 .Pp
1015 The numeric identifier is unique, and can be used instead of the pool name when
1016 multiple exported pools of the same name are available.
1017 .Bl -tag -width indent
1018 .It Fl c Ar cachefile
1019 Reads configuration from the given
1020 .Ar cachefile
1021 that was created with the
1022 .Qq Sy cachefile
1023 pool property. This
1024 .Ar cachefile
1025 is used instead of searching for devices.
1026 .It Fl d Ar dir
1027 Searches for devices or files in
1028 .Ar dir Ns .
1029 The
1030 .Fl d
1031 option can be specified multiple times.
1032 .It Fl D
1033 Lists destroyed pools only.
1034 .El
1035 .It Xo
1036 .Nm
1037 .Cm import
1038 .Op Fl o Ar mntopts
1039 .Op Fl o Ar property Ns = Ns Ar value
1040 .Ar ...
1041 .Op Fl d Ar dir | Fl c Ar cachefile
1042 .Op Fl D
1043 .Op Fl f
1044 .Op Fl m
1045 .Op Fl N
1046 .Op Fl R Ar root
1047 .Op Fl F Op Fl n
1048 .Fl a
1049 .Xc
1050 .Pp
1051 Imports all pools found in the search directories. Identical to the previous
1052 command, except that all pools with a sufficient number of devices available
1053 are imported. Destroyed pools, pools that were previously destroyed with the
1054 .Qq Nm Cm destroy
1055 command, will not be imported unless the
1056 .Fl D
1057 option is specified.
1058 .Bl -tag -width indent
1059 .It Fl o Ar mntopts
1060 Comma-separated list of mount options to use when mounting datasets within the
1061 pool. See
1062 .Xr zfs 8
1063 for a description of dataset properties and mount options.
1064 .It Fl o Ar property Ns = Ns Ar value
1065 Sets the specified property on the imported pool. See the
1066 .Qq Sx Properties
1067 section for more information on the available pool properties.
1068 .It Fl c Ar cachefile
1069 Reads configuration from the given
1070 .Ar cachefile
1071 that was created with the
1072 .Qq Sy cachefile
1073 pool property. This
1074 .Ar cachefile
1075 is used instead of searching for devices.
1076 .It Fl d Ar dir
1077 Searches for devices or files in
1078 .Ar dir Ns .
1079 The
1080 .Fl d
1081 option can be specified multiple times. This option is incompatible with the
1082 .Fl c
1083 option.
1084 .It Fl D
1085 Imports destroyed pools only. The
1086 .Fl f
1087 option is also required.
1088 .It Fl f
1089 Forces import, even if the pool appears to be potentially active.
1090 .It Fl m
1091 Enables import with missing log devices.
1092 .It Fl N
1093 Do not mount any filesystems from the imported pool.
1094 .It Fl R Ar root
1095 Sets the
1096 .Qq Sy cachefile
1097 property to
1098 .Qq Cm none
1099 and the
1100 .Qq Sy altroot
1101 property to
1102 .Qq Ar root
1103 .It Fl F
1104 Recovery mode for a non-importable pool. Attempt to return the pool to an
1105 importable state by discarding the last few transactions. Not all damaged pools
1106 can be recovered by using this option. If successful, the data from the
1107 discarded transactions is irretrievably lost. This option is ignored if the
1108 pool is importable or already imported.
1109 .It Fl n
1110 Used with the
1111 .Fl F
1112 recovery option. Determines whether a non-importable pool can be made
1113 importable again, but does not actually perform the pool recovery. For more
1114 details about pool recovery mode, see the
1115 .Fl F
1116 option, above.
1117 .It Fl a
1118 Searches for and imports all pools found.
1119 .El
1120 .It Xo
1121 .Nm
1122 .Cm import
1123 .Op Fl o Ar mntopts
1124 .Op Fl o Ar property Ns = Ns Ar value
1125 .Ar ...
1126 .Op Fl d Ar dir | Fl c Ar cachefile
1127 .Op Fl D
1128 .Op Fl f
1129 .Op Fl m
1130 .Op Fl N
1131 .Op Fl R Ar root
1132 .Op Fl F Op Fl n
1133 .Ar pool | id
1134 .Op Ar newpool
1135 .Xc
1136 .Pp
1137 Imports a specific pool. A pool can be identified by its name or the numeric
1138 identifier. If
1139 .Ar newpool
1140 is specified, the pool is imported using the name
1141 .Ar newpool Ns .
1142 Otherwise, it is imported with the same name as its exported name.
1143 .Pp
1144 If a device is removed from a system without running
1145 .Qq Nm Cm export
1146 first, the device appears as potentially active. It cannot be determined if
1147 this was a failed export, or whether the device is really in use from another
1148 host. To import a pool in this state, the
1149 .Fl f
1150 option is required.
1151 .Bl -tag -width indent
1152 .It Fl o Ar mntopts
1153 Comma-separated list of mount options to use when mounting datasets within the
1154 pool. See
1155 .Xr zfs 8
1156 for a description of dataset properties and mount options.
1157 .It Fl o Ar property Ns = Ns Ar value
1158 Sets the specified property on the imported pool. See the
1159 .Qq Sx Properties
1160 section for more information on the available pool properties.
1161 .It Fl c Ar cachefile
1162 Reads configuration from the given
1163 .Ar cachefile
1164 that was created with the
1165 .Qq Sy cachefile
1166 pool property. This
1167 .Ar cachefile
1168 is used instead of searching for devices.
1169 .It Fl d Ar dir
1170 Searches for devices or files in
1171 .Ar dir Ns .
1172 The
1173 .Fl d
1174 option can be specified multiple times. This option is incompatible with the
1175 .Fl c
1176 option.
1177 .It Fl D
1178 Imports destroyed pools only. The
1179 .Fl f
1180 option is also required.
1181 .It Fl f
1182 Forces import, even if the pool appears to be potentially active.
1183 .It Fl m
1184 Enables import with missing log devices.
1185 .It Fl N
1186 Do not mount any filesystems from the imported pool.
1187 .It Fl R Ar root
1188 Equivalent to
1189 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1190 .It Fl F
1191 Recovery mode for a non-importable pool. Attempt to return the pool to an
1192 importable state by discarding the last few transactions. Not all damaged pools
1193 can be recovered by using this option. If successful, the data from the
1194 discarded transactions is irretrievably lost. This option is ignored if the
1195 pool is importable or already imported.
1196 .It Fl n
1197 Used with the
1198 .Fl F
1199 recovery option. Determines whether a non-importable pool can be made
1200 importable again, but does not actually perform the pool recovery. For more
1201 details about pool recovery mode, see the
1202 .Fl F
1203 option, above.
1204 .El
1205 .It Xo
1206 .Nm
1207 .Cm iostat
1208 .Op Fl T Cm d Ns | Ns Cm u
1209 .Op Fl v
1210 .Op Ar pool
1211 .Ar ...
1212 .Op Ar interval Op Ar count
1213 .Xc
1214 .Pp
1215 Displays
1216 .Tn I/O
1217 statistics for the given pools. When given an interval, the statistics are
1218 printed every
1219 .Ar interval
1220 seconds until
1221 .Sy Ctrl-C
1222 is pressed. If no
1223 .Ar pools
1224 are specified, statistics for every pool in the system is shown. If 
1225 .Ar count
1226 is specified, the command exits after
1227 .Ar count
1228 reports are printed.
1229 .Bl -tag -width indent
1230 .It Fl T Cm d Ns | Ns Cm u
1231 Print a timestamp.
1232 .Pp
1233 Use modifier
1234 .Cm d
1235 for standard date format. See
1236 .Xr date 1 Ns .
1237 Use modifier
1238 .Cm u
1239 for unixtime
1240 .Pq equals Qq Ic date +%s Ns .
1241 .It Fl v
1242 Verbose statistics. Reports usage statistics for individual
1243 .No vdev Ns s
1244 within the pool, in addition to the pool-wide statistics.
1245 .El
1246 .It Xo
1247 .Nm
1248 .Cm labelclear
1249 .Op Fl f
1250 .Ar device
1251 .Xc
1252 .Pp
1253 Removes
1254 .Tn ZFS
1255 label information from the specified
1256 .Ar device Ns .
1257 The
1258 .Ar device
1259 must not be part of an active pool configuration.
1260 .Bl -tag -width indent
1261 .It Fl v
1262 Treat exported or foreign devices as inactive.
1263 .El
1264 .It Xo
1265 .Nm
1266 .Cm list
1267 .Op Fl H
1268 .Op Fl o Ar property Ns Op , Ns Ar ...
1269 .Op Fl T Cm d Ns | Ns Cm u
1270 .Op Ar pool
1271 .Ar ...
1272 .Op Ar inverval Op Ar count
1273 .Xc
1274 .Pp
1275 Lists the given pools along with a health status and space usage. When given no
1276 arguments, all pools in the system are listed.
1277 .Pp
1278 When given an interval, the output is printed every
1279 .Ar interval
1280 seconds until
1281 .Sy Ctrl-C
1282 is pressed. If 
1283 .Ar count
1284 is specified, the command exits after
1285 .Ar count
1286 reports are printed.
1287 .Bl -tag -width indent
1288 .It Fl H
1289 Scripted mode. Do not display headers, and separate fields by a single tab
1290 instead of arbitrary space.
1291 .It Fl o Ar property Ns Op , Ns Ar ...
1292 Comma-separated list of properties to display. See the
1293 .Qq Sx Properties
1294 section for a list of valid properties. The default list is
1295 .Sy name Ns ,
1296 .Sy size Ns ,
1297 .Sy used Ns ,
1298 .Sy available Ns ,
1299 .Sy capacity Ns ,
1300 .Sy health Ns ,
1301 .Sy altroot Ns .
1302 .It Fl T Cm d Ns | Ns Cm u
1303 Print a timestamp.
1304 .Pp
1305 Use modifier
1306 .Cm d
1307 for standard date format. See
1308 .Xr date 1 Ns .
1309 Use modifier
1310 .Cm u
1311 for unixtime
1312 .Pq equals Qq Ic date +%s Ns .
1313 .El
1314 .It Xo
1315 .Nm
1316 .Cm offline
1317 .Op Fl t
1318 .Ar pool device ...
1319 .Xc
1320 .Pp
1321 Takes the specified physical device offline. While the
1322 .Ar device
1323 is offline, no attempt is made to read or write to the device.
1324 .Bl -tag -width indent
1325 .It Fl t
1326 Temporary. Upon reboot, the specified physical device reverts to its previous
1327 state.
1328 .El
1329 .It Xo
1330 .Nm
1331 .Cm online
1332 .Op Fl e
1333 .Ar pool device ...
1334 .Xc
1335 .Pp
1336 Brings the specified physical device online.
1337 .Pp
1338 This command is not applicable to spares or cache devices.
1339 .Bl -tag -width indent
1340 .It Fl e
1341 Expand the device to use all available space. If the device is part of a mirror
1342 or
1343 .No raidz
1344 then all devices must be expanded before the new space will become
1345 available to the pool.
1346 .El
1347 .It Xo
1348 .Nm
1349 .Cm remove
1350 .Ar pool device ...
1351 .Xc
1352 .Pp
1353 Removes the specified device from the pool. This command currently only
1354 supports removing hot spares, cache, and log devices. A mirrored log device can
1355 be removed by specifying the top-level mirror for the log. Non-log devices that
1356 are part of a mirrored configuration can be removed using the
1357 .Qq Nm Cm detach
1358 command. Non-redundant and
1359 .No raidz
1360 devices cannot be removed from a pool.
1361 .It Xo
1362 .Nm
1363 .Cm replace
1364 .Op Fl f
1365 .Ar pool device
1366 .Op Ar new_device
1367 .Xc
1368 .Pp
1369 Replaces
1370 .Ar old_device
1371 with
1372 .Ar new_device Ns .
1373 This is equivalent to attaching
1374 .Ar new_device Ns ,
1375 waiting for it to resilver, and then detaching
1376 .Ar old_device Ns .
1377 .Pp
1378 The size of 
1379 .Ar new_device
1380 must be greater than or equal to the minimum size
1381 of all the devices in a mirror or
1382 .No raidz
1383 configuration.
1384 .Pp
1385 .Ar new_device
1386 is required if the pool is not redundant. If
1387 .Ar new_device
1388 is not specified, it defaults to
1389 .Ar old_device Ns . 
1390 This form of replacement is useful after an existing disk has failed and has
1391 been physically replaced. In this case, the new disk may have the same
1392 .Pa /dev
1393 path as the old device, even though it is actually a different disk.
1394 .Tn ZFS
1395 recognizes this.
1396 .Bl -tag -width indent
1397 .It Fl f
1398 Forces use of
1399 .Ar new_device Ns ,
1400 even if its appears to be in use. Not all devices can be overridden in this
1401 manner.
1402 .El
1403 .It Xo
1404 .Nm
1405 .Cm scrub
1406 .Op Fl s
1407 .Ar pool ...
1408 .Xc
1409 .Pp
1410 Begins a scrub. The scrub examines all data in the specified pools to verify
1411 that it checksums correctly. For replicated (mirror or
1412 .No raidz Ns )
1413 devices,
1414 .Tn ZFS
1415 automatically repairs any damage discovered during the scrub. The
1416 .Qq Nm Cm status
1417 command reports the progress of the scrub and summarizes the results of the
1418 scrub upon completion.
1419 .Pp
1420 Scrubbing and resilvering are very similar operations. The difference is that
1421 resilvering only examines data that
1422 .Tn ZFS
1423 knows to be out of date (for example, when attaching a new device to a mirror
1424 or replacing an existing device), whereas scrubbing examines all data to
1425 discover silent errors due to hardware faults or disk failure.
1426 .Pp
1427 Because scrubbing and resilvering are
1428 .Tn I/O Ns -intensive
1429 operations,
1430 .Tn ZFS
1431 only allows one at a time. If a scrub is already in progress, the
1432 .Qq Nm Cm scrub
1433 command returns an error. To start a new scrub, you have to stop the old scrub
1434 with the
1435 .Qq Nm Cm scrub Fl s
1436 command first. If a resilver is in progress,
1437 .Tn ZFS
1438 does not allow a scrub to be started until the resilver completes.
1439 .Bl -tag -width indent
1440 .It Fl s
1441 Stop scrubbing.
1442 .El
1443 .It Xo
1444 .Nm
1445 .Cm set
1446 .Ar property Ns = Ns Ar value pool
1447 .Xc
1448 .Pp
1449 Sets the given property on the specified pool. See the
1450 .Qq Sx Properties
1451 section for more information on what properties can be set and acceptable
1452 values.
1453 .It Xo
1454 .Nm
1455 .Cm split
1456 .Op Fl n
1457 .Op Fl R Ar altroot
1458 .Op Fl o Ar mntopts
1459 .Op Fl o Ar property Ns = Ns Ar value
1460 .Ar pool newpool
1461 .Op Ar device ...
1462 .Xc
1463 .Pp
1464 Splits off one disk from each mirrored top-level
1465 .No vdev
1466 in a pool and creates a new pool from the split-off disks. The original pool
1467 must be made up of one or more mirrors and must not be in the process of
1468 resilvering. The
1469 .Cm split
1470 subcommand chooses the last device in each mirror
1471 .No vdev
1472 unless overridden by a device specification on the command line.
1473 .Pp
1474 When using a
1475 .Ar device
1476 argument, 
1477 .Cm split
1478 includes the specified device(s) in a new pool and, should any devices remain 
1479 unspecified, assigns the last device in each mirror
1480 .No vdev
1481 to that pool, as it does normally. If you are uncertain about the outcome of a 
1482 .Cm split
1483 command, use the
1484 .Fl n
1485 ("dry-run") option to ensure your command will have the effect you intend.
1486 .Bl -tag -width indent
1487 .It Fl R Ar altroot
1488 Automatically import the newly created pool after splitting, using the
1489 specified
1490 .Ar altroot
1491 parameter for the new pool's alternate root. See the
1492 .Sy altroot
1493 description in the
1494 .Qq Sx Properties
1495 section, above.
1496 .It Fl n
1497 Displays the configuration that would be created without actually splitting the
1498 pool. The actual pool split could still fail due to insufficient privileges or
1499 device status.
1500 .It Fl o Ar mntopts
1501 Comma-separated list of mount options to use when mounting datasets within the
1502 pool. See
1503 .Xr zfs 8
1504 for a description of dataset properties and mount options. Valid only in
1505 conjunction with the
1506 .Fl R
1507 option.
1508 .It Fl o Ar property Ns = Ns Ar value
1509 Sets the specified property on the new pool. See the
1510 .Qq Sx Properties
1511 section, above, for more information on the available pool properties.
1512 .El
1513 .It Xo
1514 .Nm
1515 .Cm status
1516 .Op Fl vx
1517 .Op Fl T Cm d Ns | Ns Cm u
1518 .Op Ar pool
1519 .Ar ...
1520 .Op Ar interval Op Ar count
1521 .Xc
1522 .Pp
1523 Displays the detailed health status for the given pools. If no
1524 .Ar pool
1525 is specified, then the status of each pool in the system is displayed. For more
1526 information on pool and device health, see the
1527 .Qq Sx Device Failure and Recovery
1528 section.
1529 .Pp
1530 When given an interval, the output is printed every
1531 .Ar interval
1532 seconds until
1533 .Sy Ctrl-C
1534 is pressed. If 
1535 .Ar count
1536 is specified, the command exits after
1537 .Ar count
1538 reports are printed.
1539 .Pp
1540 If a scrub or resilver is in progress, this command reports the percentage done
1541 and the estimated time to completion. Both of these are only approximate,
1542 because the amount of data in the pool and the other workloads on the system
1543 can change.
1544 .Bl -tag -width indent
1545 .It Fl x
1546 Only display status for pools that are exhibiting errors or are otherwise
1547 unavailable.
1548 .It Fl v
1549 Displays verbose data error information, printing out a complete list of all
1550 data errors since the last complete pool scrub.
1551 .It Fl T Cm d Ns | Ns Cm u
1552 Print a timestamp.
1553 .Pp
1554 Use modifier
1555 .Cm d
1556 for standard date format. See
1557 .Xr date 1 Ns .
1558 Use modifier
1559 .Cm u
1560 for unixtime
1561 .Pq equals Qq Ic date +%s Ns .
1562 .El
1563 .It Xo
1564 .Nm
1565 .Cm upgrade
1566 .Op Fl v
1567 .Xc
1568 .Pp
1569 Displays all pools formatted using a different
1570 .Tn ZFS
1571 pool on-disk version. Older versions can continue to be used, but some
1572 features may not be available. These pools can be upgraded using
1573 .Qq Nm Cm upgrade Fl a .
1574 Pools that are formatted with a more recent version are also displayed,
1575 although these pools will be inaccessible on the system.
1576 .Bl -tag -width indent
1577 .It Fl v
1578 Displays
1579 .Tn ZFS
1580 pool versions supported by the current software. The current
1581 .Tn ZFS
1582 pool version and all previous supported versions are displayed, along
1583 with an explanation of the features provided with each version.
1584 .El
1585 .It Xo
1586 .Nm
1587 .Cm upgrade
1588 .Op Fl V Ar version
1589 .Fl a | Ar pool ...
1590 .Xc
1591 .Pp
1592 Upgrades the given pool to the latest on-disk pool version. Once this is done,
1593 the pool will no longer be accessible on systems running older versions of the
1594 software.
1595 .Bl -tag -width indent
1596 .It Fl a
1597 Upgrades all pools.
1598 .It Fl V Ar version
1599 Upgrade to the specified version. If the
1600 .Fl V
1601 flag is not specified, the pool is upgraded to the most recent version. This
1602 option can only be used to increase the version number, and only up to the most
1603 recent version supported by this software.
1604 .El
1605 .El
1606 .Sh EXAMPLES
1607 .Bl -tag -width 0n
1608 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1609 .Pp
1610 The following command creates a pool with a single
1611 .No raidz
1612 root
1613 .No vdev
1614 that consists of six disks.
1615 .Bd -literal -offset 2n
1616 .Li # Ic zpool create tank raidz da0 da1 da2 da3 da4 da5
1617 .Ed
1618 .It Sy Example 2 No Creating a Mirrored Storage Pool
1619 .Pp
1620 The following command creates a pool with two mirrors, where each mirror
1621 contains two disks.
1622 .Bd -literal -offset 2n
1623 .Li # Ic zpool create tank mirror da0 da1 mirror da2 da3
1624 .Ed
1625 .It Sy Example 3 No Creating a Tn ZFS No Storage Pool by Using Partitions
1626 .Pp
1627 The following command creates an unmirrored pool using two GPT partitions.
1628 .Bd -literal -offset 2n
1629 .Li # Ic zpool create tank da0p3 da1p3
1630 .Ed
1631 .It Sy Example 4 No Creating a Tn ZFS No Storage Pool by Using Files
1632 .Pp
1633 The following command creates an unmirrored pool using files. While not
1634 recommended, a pool based on files can be useful for experimental purposes.
1635 .Bd -literal -offset 2n
1636 .Li # Ic zpool create tank /path/to/file/a /path/to/file/b
1637 .Ed
1638 .It Sy Example 5 No Adding a Mirror to a Tn ZFS No Storage Pool
1639 .Pp
1640 The following command adds two mirrored disks to the pool
1641 .Em tank Ns ,
1642 assuming the pool is already made up of two-way mirrors. The additional space
1643 is immediately available to any datasets within the pool.
1644 .Bd -literal -offset 2n
1645 .Li # Ic zpool add tank mirror da2 da3
1646 .Ed
1647 .It Sy Example 6 No Listing Available Tn ZFS No Storage Pools
1648 .Pp
1649 The following command lists all available pools on the system.
1650 .Bd -literal -offset 2n
1651 .Li # Ic zpool list
1652 NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
1653 pool  2.70T   473G  2.24T    17%  1.00x  ONLINE  -
1654 test  1.98G  89.5K  1.98G     0%  1.00x  ONLINE  -
1655 .Ed
1656 .It Sy Example 7 No Listing All Properties for a Pool
1657 .Pp
1658 The following command lists all the properties for a pool.
1659 .Bd -literal -offset 2n
1660 .Li # Ic zpool get all pool
1661 pool  size           2.70T       -
1662 pool  capacity       17%         -
1663 pool  altroot        -           default
1664 pool  health         ONLINE      -
1665 pool  guid           2501120270416322443  default
1666 pool  version        28          default
1667 pool  bootfs         pool/root   local
1668 pool  delegation     on          default
1669 pool  autoreplace    off         default
1670 pool  cachefile      -           default
1671 pool  failmode       wait        default
1672 pool  listsnapshots  off         default
1673 pool  autoexpand     off         default
1674 pool  dedupditto     0           default
1675 pool  dedupratio     1.00x       -
1676 pool  free           2.24T       -
1677 pool  allocated      473G        -
1678 pool  readonly       off         -
1679 .Ed
1680 .It Sy Example 8 No Destroying a Tn ZFS No Storage Pool
1681 .Pp
1682 The following command destroys the pool
1683 .Qq Em tank
1684 and any datasets contained within.
1685 .Bd -literal -offset 2n
1686 .Li # Ic zpool destroy -f tank
1687 .Ed
1688 .It Sy Example 9 No Exporting a Tn ZFS No Storage Pool
1689 .Pp
1690 The following command exports the devices in pool
1691 .Em tank
1692 so that they can be relocated or later imported.
1693 .Bd -literal -offset 2n
1694 .Li # Ic zpool export tank
1695 .Ed
1696 .It Sy Example 10 No Importing a Tn ZFS No Storage Pool
1697 .Pp
1698 The following command displays available pools, and then imports the pool
1699 .Qq Em tank
1700 for use on the system.
1701 .Pp
1702 The results from this command are similar to the following:
1703 .Bd -literal -offset 2n
1704 .Li # Ic zpool import
1705
1706   pool: tank
1707     id: 15451357997522795478
1708  state: ONLINE
1709 action: The pool can be imported using its name or numeric identifier.
1710 config:
1711
1712         tank        ONLINE
1713           mirror    ONLINE
1714                da0  ONLINE
1715                da1  ONLINE
1716 .Ed
1717 .It Xo
1718 .Sy Example 11
1719 Upgrading All
1720 .Tn ZFS
1721 Storage Pools to the Current Version
1722 .Xc
1723 .Pp
1724 The following command upgrades all
1725 .Tn ZFS
1726 Storage pools to the current version of
1727 the software.
1728 .Bd -literal -offset 2n
1729 .Li # Ic zpool upgrade -a
1730 This system is currently running ZFS pool version 28.
1731 .Ed
1732 .It Sy Example 12 No Managing Hot Spares
1733 .Pp
1734 The following command creates a new pool with an available hot spare:
1735 .Bd -literal -offset 2n
1736 .Li # Ic zpool create tank mirror da0 da1 spare da2
1737 .Ed
1738 .Pp
1739 If one of the disks were to fail, the pool would be reduced to the degraded
1740 state. The failed device can be replaced using the following command:
1741 .Bd -literal -offset 2n
1742 .Li # Ic zpool replace tank da0 da2
1743 .Ed
1744 .Pp
1745 Once the data has been resilvered, the spare is automatically removed and is
1746 made available should another device fails. The hot spare can be permanently
1747 removed from the pool using the following command:
1748 .Bd -literal -offset 2n
1749 .Li # Ic zpool remove tank da2
1750 .Ed
1751 .It Xo
1752 .Sy Example 13
1753 Creating a
1754 .Tn ZFS
1755 Pool with Mirrored Separate Intent Logs
1756 .Xc
1757 .Pp
1758 The following command creates a
1759 .Tn ZFS
1760 storage pool consisting of two, two-way
1761 mirrors and mirrored log devices:
1762 .Bd -literal -offset 2n
1763 .Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log miror da4 da5
1764 .Ed
1765 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
1766 .Pp
1767 The following command adds two disks for use as cache devices to a
1768 .Tn ZFS
1769 storage pool:
1770 .Bd -literal -offset 2n
1771 .Li # Ic zpool add pool cache da2 da3
1772 .Ed
1773 .Pp
1774 Once added, the cache devices gradually fill with content from main memory.
1775 Depending on the size of your cache devices, it could take over an hour for
1776 them to fill. Capacity and reads can be monitored using the
1777 .Cm iostat
1778 subcommand as follows:
1779 .Bd -literal -offset 2n
1780 .Li # Ic zpool iostat -v pool 5
1781 .Ed
1782 .It Sy Example 15 No Removing a Mirrored Log Device
1783 .Pp
1784 The following command removes the mirrored log device
1785 .Em mirror-2 Ns .
1786 .Pp
1787 Given this configuration:
1788 .Bd -literal -offset 2n
1789    pool: tank
1790   state: ONLINE
1791   scrub: none requested
1792  config:
1793
1794          NAME        STATE     READ WRITE CKSUM
1795          tank        ONLINE       0     0     0
1796            mirror-0  ONLINE       0     0     0
1797                 da0  ONLINE       0     0     0
1798                 da1  ONLINE       0     0     0
1799            mirror-1  ONLINE       0     0     0
1800                 da2  ONLINE       0     0     0
1801                 da3  ONLINE       0     0     0
1802          logs
1803            mirror-2  ONLINE       0     0     0
1804                 da4  ONLINE       0     0     0
1805                 da5  ONLINE       0     0     0
1806 .Ed
1807 .Pp
1808 The command to remove the mirrored log
1809 .Em mirror-2
1810 is:
1811 .Bd -literal -offset 2n
1812 .Li # Ic zpool remove tank mirror-2
1813 .Ed
1814 .It Sy Example 16 No Recovering a Faulted Tn ZFS No Pool
1815 .Pp
1816 If a pool is faulted but recoverable, a message indicating this state is
1817 provided by
1818 .Qq Nm Cm status
1819 if the pool was cached (see the
1820 .Fl c Ar cachefile
1821 argument above), or as part of the error output from a failed
1822 .Qq Nm Cm import
1823 of the pool.
1824 .Pp
1825 Recover a cached pool with the
1826 .Qq Nm Cm clear
1827 command:
1828 .Bd -literal -offset 2n
1829 .Li # Ic zpool clear -F data
1830 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
1831 Discarded approximately 29 seconds of transactions.
1832 .Ed
1833 .Pp
1834 If the pool configuration was not cached, use
1835 .Qq Nm Cm import
1836 with the recovery mode flag:
1837 .Bd -literal -offset 2n
1838 .Li # Ic zpool import -F data
1839 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
1840 Discarded approximately 29 seconds of transactions.
1841 .Ed
1842 .El
1843 .Sh EXIT STATUS
1844 The following exit values are returned:
1845 .Bl -tag -offset 2n -width 2n
1846 .It 0
1847 Successful completion.
1848 .It 1
1849 An error occurred.
1850 .It 2
1851 Invalid command line options were specified.
1852 .El
1853 .Sh SEE ALSO
1854 .Xr zfs 8
1855 .Sh AUTHORS
1856 This manual page is a
1857 .Xr mdoc 7
1858 reimplementation of the
1859 .Tn OpenSolaris
1860 manual page
1861 .Em zpool(1M) ,
1862 modified and customized for
1863 .Fx
1864 and licensed under the Common Development and Distribution License
1865 .Pq Tn CDDL .
1866 .Pp
1867 The
1868 .Xr mdoc 7
1869 implementation of this manual page was initially written by
1870 .An Martin Matuska Aq mm@FreeBSD.org .