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