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