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