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