]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - cddl/contrib/opensolaris/cmd/zpool/zpool.8
zpool.8: the comment property is not read-only
[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 February 20, 2019
31 .Dt ZPOOL 8
32 .Os
33 .Sh NAME
34 .Nm zpool
35 .Nd configures ZFS storage pools
36 .Sh SYNOPSIS
37 .Nm
38 .Op Fl \&?
39 .Nm
40 .Cm add
41 .Op Fl fn
42 .Ar pool vdev ...
43 .Nm
44 .Cm attach
45 .Op Fl f
46 .Ar pool device new_device
47 .Nm
48 .Cm checkpoint
49 .Op Fl d, -discard
50 .Ar pool
51 .Nm
52 .Cm clear
53 .Op Fl F Op Fl n
54 .Ar pool
55 .Op Ar device
56 .Nm
57 .Cm create
58 .Op Fl fnd
59 .Op Fl o Ar property Ns = Ns Ar value
60 .Ar ...
61 .Op Fl O Ar file-system-property Ns = Ns Ar value
62 .Ar ...
63 .Op Fl m Ar mountpoint
64 .Op Fl R Ar root
65 .Op Fl t Ar tempname
66 .Ar pool vdev ...
67 .Nm
68 .Cm destroy
69 .Op Fl f
70 .Ar pool
71 .Nm
72 .Cm detach
73 .Ar pool device
74 .Nm
75 .Cm export
76 .Op Fl f
77 .Ar pool ...
78 .Nm
79 .Cm get
80 .Op Fl Hp
81 .Op Fl o Ar field Ns Op , Ns Ar ...
82 .Ar all | property Ns Op , Ns Ar ...
83 .Ar pool ...
84 .Nm
85 .Cm history
86 .Op Fl il
87 .Op Ar pool
88 .Ar ...
89 .Nm
90 .Cm import
91 .Op Fl d Ar dir | Fl c Ar cachefile
92 .Op Fl D
93 .Nm
94 .Cm import
95 .Op Fl o Ar mntopts
96 .Op Fl o Ar property Ns = Ns Ar value
97 .Ar ...
98 .Op Fl -rewind-to-checkpoint
99 .Op Fl d Ar dir | Fl c Ar cachefile
100 .Op Fl D
101 .Op Fl f
102 .Op Fl m
103 .Op Fl N
104 .Op Fl R Ar root
105 .Op Fl F Op Fl n
106 .Fl a
107 .Nm
108 .Cm import
109 .Op Fl o Ar mntopts
110 .Op Fl o Ar property Ns = Ns Ar value
111 .Ar ...
112 .Op Fl -rewind-to-checkpoint
113 .Op Fl d Ar dir | Fl c Ar cachefile
114 .Op Fl D
115 .Op Fl f
116 .Op Fl m
117 .Op Fl N
118 .Op Fl R Ar root
119 .Op Fl t
120 .Op Fl F Op Fl n
121 .Ar pool | id
122 .Op Ar newpool
123 .Nm
124 .Cm initialize
125 .Op Fl cs
126 .Ar pool
127 .Op Ar device Ns ...
128 .Nm
129 .Cm iostat
130 .Op Fl T Cm d Ns | Ns Cm u
131 .Op Fl v
132 .Op Ar pool
133 .Ar ...
134 .Nm
135 .Cm labelclear
136 .Op Fl f
137 .Ar device
138 .Nm
139 .Cm list
140 .Op Fl Hpv
141 .Op Fl o Ar property Ns Op , Ns Ar ...
142 .Op Fl T Cm d Ns | Ns Cm u
143 .Op Ar pool
144 .Ar ...
145 .Op Ar inverval Op Ar count
146 .Nm
147 .Cm offline
148 .Op Fl t
149 .Ar pool device ...
150 .Nm
151 .Cm online
152 .Op Fl e
153 .Ar pool device ...
154 .Nm
155 .Cm reguid
156 .Ar pool
157 .Nm
158 .Cm remove
159 .Op Fl np
160 .Ar pool device ...
161 .Nm
162 .Cm remove
163 .Fl s
164 .Ar pool
165 .Nm
166 .Cm reopen
167 .Ar pool
168 .Nm
169 .Cm replace
170 .Op Fl f
171 .Ar pool device
172 .Op Ar new_device
173 .Nm
174 .Cm scrub
175 .Op Fl s | Fl p
176 .Ar pool ...
177 .Nm
178 .Cm set
179 .Ar property Ns = Ns Ar value pool
180 .Nm
181 .Cm split
182 .Op Fl n
183 .Op Fl R Ar altroot
184 .Op Fl o Ar mntopts
185 .Op Fl o Ar property Ns = Ns Ar value
186 .Ar pool newpool
187 .Op Ar device ...
188 .Nm
189 .Cm status
190 .Op Fl Dvx
191 .Op Fl T Cm d Ns | Ns Cm u
192 .Op Ar pool
193 .Ar ...
194 .Op Ar interval Op Ar count
195 .Nm
196 .Cm 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 dedupratio
608 The deduplication ratio specified for a pool, expressed as a multiplier.
609 For example, a
610 .Sy dedupratio
611 value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See
612 .Xr zfs 8
613 for a description of the deduplication feature.
614 .It Sy expandsize
615 Amount of uninitialized space within the pool or device that can be used to
616 increase the total capacity of the pool.
617 Uninitialized space consists of
618 any space on an EFI labeled vdev which has not been brought online
619 .Pq i.e. zpool online -e .
620 This space occurs when a LUN is dynamically expanded.
621 .It Sy fragmentation
622 The amount of fragmentation in the pool.
623 .It Sy free
624 Number of blocks within the pool that are not allocated.
625 .It Sy freeing
626 After a file system or snapshot is destroyed, the space it was using is
627 returned to the pool asynchronously.
628 .Sy freeing
629 is the amount of space remaining to be reclaimed.
630 Over time
631 .Sy freeing
632 will decrease while
633 .Sy free
634 increases.
635 .It Sy guid
636 A unique identifier for the pool.
637 .It Sy health
638 The current health of the pool. Health can be
639 .Qq Sy ONLINE ,
640 .Qq Sy DEGRADED ,
641 .Qq Sy FAULTED ,
642 .Qq Sy OFFLINE ,
643 .Qq Sy REMOVED ,
644 or
645 .Qq Sy UNAVAIL .
646 .It Sy size
647 Total size of the storage pool.
648 .It Sy unsupported@ Ns Ar feature_guid
649 Information about unsupported features that are enabled on the pool.
650 See
651 .Xr zpool-features 7
652 for details.
653 .It Sy used
654 Amount of storage space used within the pool.
655 .El
656 .Pp
657 The space usage properties report actual physical space available to the
658 storage pool. The physical space can be different from the total amount of
659 space that any contained datasets can actually use. The amount of space used in
660 a
661 .No raidz
662 configuration depends on the characteristics of the data being written.
663 In addition,
664 .Tn ZFS
665 reserves some space for internal accounting that the
666 .Xr zfs 8
667 command takes into account, but the
668 .Xr zpool 8
669 command does not. For non-full pools of a reasonable size, these effects should
670 be invisible. For small pools, or pools that are close to being completely
671 full, these discrepancies may become more noticeable.
672 .Pp
673 The following property can be set at creation time and import time:
674 .Bl -tag -width 2n
675 .It Sy altroot
676 Alternate root directory. If set, this directory is prepended to any mount
677 points within the pool. This can be used when examining an unknown pool where
678 the mount points cannot be trusted, or in an alternate boot environment, where
679 the typical paths are not valid.
680 .Sy altroot
681 is not a persistent property. It is valid only while the system is up.
682 Setting
683 .Sy altroot
684 defaults to using
685 .Cm cachefile=none ,
686 though this may be overridden using an explicit setting.
687 .El
688 .Pp
689 The following property can only be set at import time:
690 .Bl -tag -width 2n
691 .It Sy readonly Ns = Ns Cm on No | Cm off
692 If set to
693 .Cm on ,
694 pool will be imported in read-only mode with the following restrictions:
695 .Bl -bullet -offset 2n
696 .It
697 Synchronous data in the intent log will not be accessible
698 .It
699 Properties of the pool can not be changed
700 .It
701 Datasets of this pool can only be mounted read-only
702 .It
703 To write to a read-only pool, a export and import of the pool is required.
704 .El
705 .Pp
706 This property can also be referred to by its shortened column name,
707 .Sy rdonly .
708 .El
709 .Pp
710 The following properties can be set at creation time and import time, and later
711 changed with the
712 .Ic zpool set
713 command:
714 .Bl -tag -width 2n
715 .It Sy autoexpand Ns = Ns Cm on No | Cm off
716 Controls automatic pool expansion when the underlying LUN is grown. If set to
717 .Qq Cm on ,
718 the pool will be resized according to the size of the expanded
719 device. If the device is part of a mirror or
720 .No raidz
721 then all devices within that
722 .No mirror/ Ns No raidz
723 group must be expanded before the new space is made available to
724 the pool. The default behavior is
725 .Qq off .
726 This property can also be referred to by its shortened column name,
727 .Sy expand .
728 .It Sy autoreplace Ns = Ns Cm on No | Cm off
729 Controls automatic device replacement. If set to
730 .Qq Cm off ,
731 device replacement must be initiated by the administrator by using the
732 .Qq Nm Cm replace
733 command. If set to
734 .Qq Cm on ,
735 any new device, found in the same
736 physical location as a device that previously belonged to the pool, is
737 automatically formatted and replaced. The default behavior is
738 .Qq Cm off .
739 This property can also be referred to by its shortened column name, "replace".
740 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
741 Identifies the default bootable dataset for the root pool. This property is
742 expected to be set mainly by the installation and upgrade programs.
743 .It Sy cachefile Ns = Ns Ar path No | Cm none
744 Controls the location of where the pool configuration is cached. Discovering
745 all pools on system startup requires a cached copy of the configuration data
746 that is stored on the root file system. All pools in this cache are
747 automatically imported when the system boots. Some environments, such as
748 install and clustering, need to cache this information in a different location
749 so that pools are not automatically imported. Setting this property caches the
750 pool configuration in a different location that can later be imported with
751 .Qq Nm Cm import Fl c .
752 Setting it to the special value
753 .Qq Cm none
754 creates a temporary pool that is never cached, and the special value
755 .Cm ''
756 (empty string) uses the default location.
757 .It Sy comment Ns = Ns Ar text
758 A text string consisting of printable ASCII characters that will be stored
759 such that it is available even if the pool becomes faulted.
760 An administrator can provide additional information about a pool using this
761 property.
762 .It Sy dedupditto Ns = Ns Ar number
763 Threshold for the number of block ditto copies. If the reference count for a
764 deduplicated block increases above this number, a new ditto copy of this block
765 is automatically stored. Default setting is
766 .Cm 0
767 which causes no ditto copies to be created for deduplicated blocks.
768 The miniumum legal nonzero setting is 100.
769 .It Sy delegation Ns = Ns Cm on No | Cm off
770 Controls whether a non-privileged user is granted access based on the dataset
771 permissions defined on the dataset. See
772 .Xr zfs 8
773 for more information on
774 .Tn ZFS
775 delegated administration.
776 .It Sy failmode Ns = Ns Cm wait No | Cm continue No | Cm panic
777 Controls the system behavior in the event of catastrophic pool failure. This
778 condition is typically a result of a loss of connectivity to the underlying
779 storage device(s) or a failure of all devices within the pool. The behavior of
780 such an event is determined as follows:
781 .Bl -tag -width indent
782 .It Sy wait
783 Blocks all
784 .Tn I/O
785 access until the device connectivity is recovered and the errors are cleared.
786 This is the default behavior.
787 .It Sy continue
788 Returns
789 .Em EIO
790 to any new write
791 .Tn I/O
792 requests but allows reads to any of the remaining healthy devices. Any write
793 requests that have yet to be committed to disk would be blocked.
794 .It Sy panic
795 Prints out a message to the console and generates a system crash dump.
796 .El
797 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
798 The value of this property is the current state of
799 .Ar feature_name .
800 The only valid value when setting this property is
801 .Sy enabled
802 which moves
803 .Ar feature_name
804 to the enabled state.
805 See
806 .Xr zpool-features 7
807 for details on feature states.
808 .It Sy listsnaps Ns = Ns Cm on No | Cm off
809 Controls whether information about snapshots associated with this pool is
810 output when
811 .Qq Nm zfs Cm list
812 is run without the
813 .Fl t
814 option. The default value is
815 .Cm off .
816 .It Sy version Ns = Ns Ar version
817 The current on-disk version of the pool. This can be increased, but never
818 decreased. The preferred method of updating pools is with the
819 .Qq Nm Cm upgrade
820 command, though this property can be used when a specific version is needed
821 for backwards compatibility.
822 Once feature flags is enabled on a pool this property will no longer have a
823 value.
824 .El
825 .Sh SUBCOMMANDS
826 All subcommands that modify state are logged persistently to the pool in their
827 original form.
828 .Pp
829 The
830 .Nm
831 command provides subcommands to create and destroy storage pools, add capacity
832 to storage pools, and provide information about the storage pools. The following
833 subcommands are supported:
834 .Bl -tag -width 2n
835 .It Xo
836 .Nm
837 .Op Fl \&?
838 .Xc
839 .Pp
840 Displays a help message.
841 .It Xo
842 .Nm
843 .Cm add
844 .Op Fl fn
845 .Ar pool vdev ...
846 .Xc
847 .Pp
848 Adds the specified virtual devices to the given pool. The
849 .No vdev
850 specification is described in the
851 .Qq Sx Virtual Devices
852 section. The behavior of the
853 .Fl f
854 option, and the device checks performed are described in the
855 .Qq Nm Cm create
856 subcommand.
857 .Bl -tag -width indent
858 .It Fl f
859 Forces use of
860 .Ar vdev ,
861 even if they appear in use or specify a conflicting replication level.
862 Not all devices can be overridden in this manner.
863 .It Fl n
864 Displays the configuration that would be used without actually adding the
865 .Ar vdev Ns s.
866 The actual pool creation can still fail due to insufficient privileges or device
867 sharing.
868 .Pp
869 Do not add a disk that is currently configured as a quorum device to a zpool.
870 After a disk is in the pool, that disk can then be configured as a quorum
871 device.
872 .El
873 .It Xo
874 .Nm
875 .Cm attach
876 .Op Fl f
877 .Ar pool device new_device
878 .Xc
879 .Pp
880 Attaches
881 .Ar new_device
882 to an existing
883 .Sy zpool
884 device. The existing device cannot be part of a
885 .No raidz
886 configuration. If
887 .Ar device
888 is not currently part of a mirrored configuration,
889 .Ar device
890 automatically transforms into a two-way mirror of
891 .Ar device No and Ar new_device .
892 If
893 .Ar device
894 is part of a two-way mirror, attaching
895 .Ar new_device
896 creates a three-way mirror, and so on. In either case,
897 .Ar new_device
898 begins to resilver immediately.
899 .Bl -tag -width indent
900 .It Fl f
901 Forces use of
902 .Ar new_device ,
903 even if its appears to be in use. Not all devices can be overridden in this
904 manner.
905 .El
906 .It Xo
907 .Nm
908 .Cm checkpoint
909 .Op Fl d, -discard
910 .Ar pool
911 .Xc
912 Checkpoints the current state of
913 .Ar pool
914 , which can be later restored by
915 .Nm zpool Cm import --rewind-to-checkpoint .
916 The existence of a checkpoint in a pool prohibits the following
917 .Nm zpool
918 commands:
919 .Cm remove ,
920 .Cm attach ,
921 .Cm detach ,
922 .Cm split ,
923 and
924 .Cm reguid .
925 In addition, it may break reservation boundaries if the pool lacks free
926 space.
927 The
928 .Nm zpool Cm status
929 command indicates the existence of a checkpoint or the progress of discarding a
930 checkpoint from a pool.
931 The
932 .Nm zpool Cm list
933 command reports how much space the checkpoint takes from the pool.
934 .Bl -tag -width Ds
935 .It Fl d, -discard
936 Discards an existing checkpoint from
937 .Ar pool .
938 .El
939 .It Xo
940 .Nm
941 .Cm clear
942 .Op Fl F Op Fl n
943 .Ar pool
944 .Op Ar device
945 .Xc
946 .Pp
947 Clears device errors in a pool. If no arguments are specified, all device
948 errors within the pool are cleared. If one or more devices is specified, only
949 those errors associated with the specified device or devices are cleared.
950 .Bl -tag -width indent
951 .It Fl F
952 Initiates recovery mode for an unopenable pool. Attempts to discard the last
953 few transactions in the pool to return it to an openable state. Not all damaged
954 pools can be recovered by using this option. If successful, the data from the
955 discarded transactions is irretrievably lost.
956 .It Fl n
957 Used in combination with the
958 .Fl F
959 flag. Check whether discarding transactions would make the pool openable, but
960 do not actually discard any transactions.
961 .El
962 .It Xo
963 .Nm
964 .Cm create
965 .Op Fl fnd
966 .Op Fl o Ar property Ns = Ns Ar value
967 .Ar ...
968 .Op Fl O Ar file-system-property Ns = Ns Ar value
969 .Ar ...
970 .Op Fl m Ar mountpoint
971 .Op Fl R Ar root
972 .Op Fl t Ar tempname
973 .Ar pool vdev ...
974 .Xc
975 .Pp
976 Creates a new storage pool containing the virtual devices specified on the
977 command line. The pool name must begin with a letter, and can only contain
978 alphanumeric characters as well as underscore ("_"), dash ("-"), and period
979 ("."). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are
980 names beginning with the pattern "c[0-9]". The
981 .No vdev
982 specification is described in the
983 .Qq Sx Virtual Devices
984 section.
985 .Pp
986 The command verifies that each device specified is accessible and not currently
987 in use by another subsystem. There are some uses, such as being currently
988 mounted, or specified as the dedicated dump device, that prevents a device from
989 ever being used by
990 .Tn ZFS
991 Other uses, such as having a preexisting
992 .Sy UFS
993 file system, can be overridden with the
994 .Fl f
995 option.
996 .Pp
997 The command also checks that the replication strategy for the pool is
998 consistent. An attempt to combine redundant and non-redundant storage in a
999 single pool, or to mix disks and files, results in an error unless
1000 .Fl f
1001 is specified. The use of differently sized devices within a single
1002 .No raidz
1003 or mirror group is also flagged as an error unless
1004 .Fl f
1005 is specified.
1006 .Pp
1007 Unless the
1008 .Fl R
1009 option is specified, the default mount point is
1010 .Qq Pa /pool .
1011 The mount point must not exist or must be empty, or else the
1012 root dataset cannot be mounted. This can be overridden with the
1013 .Fl m
1014 option.
1015 .Pp
1016 By default all supported features are enabled on the new pool unless the
1017 .Fl d
1018 option is specified.
1019 .Bl -tag -width indent
1020 .It Fl f
1021 Forces use of
1022 .Ar vdev Ns s,
1023 even if they appear in use or specify a conflicting replication level.
1024 Not all devices can be overridden in this manner.
1025 .It Fl n
1026 Displays the configuration that would be used without actually creating the
1027 pool. The actual pool creation can still fail due to insufficient privileges or
1028 device sharing.
1029 .It Fl d
1030 Do not enable any features on the new pool.
1031 Individual features can be enabled by setting their corresponding properties
1032 to
1033 .Sy enabled
1034 with the
1035 .Fl o
1036 option.
1037 See
1038 .Xr zpool-features 7
1039 for details about feature properties.
1040 .It Xo
1041 .Fl o Ar property Ns = Ns Ar value
1042 .Op Fl o Ar property Ns = Ns Ar value
1043 .Ar ...
1044 .Xc
1045 Sets the given pool properties. See the
1046 .Qq Sx Properties
1047 section for a list of valid properties that can be set.
1048 .It Xo
1049 .Fl O
1050 .Ar file-system-property Ns = Ns Ar value
1051 .Op Fl O Ar file-system-property Ns = Ns Ar value
1052 .Ar ...
1053 .Xc
1054 Sets the given file system properties in the root file system of the pool. See
1055 .Xr zfs 8 Properties
1056 for a list of valid properties that
1057 can be set.
1058 .It Fl R Ar root
1059 Equivalent to
1060 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1061 .It Fl m Ar mountpoint
1062 Sets the mount point for the root dataset. The default mount point is
1063 .Qq Pa /pool
1064 or
1065 .Qq Cm altroot Ns Pa /pool
1066 if
1067 .Sy altroot
1068 is specified. The mount point must be an absolute path,
1069 .Qq Cm legacy ,
1070 or
1071 .Qq Cm none .
1072 For more information on dataset mount points, see
1073 .Xr zfs 8 .
1074 .It Fl t Ar tempname
1075 Sets the in-core pool name to
1076 .Pa tempname
1077 while the on-disk name will be the name specified as the pool name
1078 .Pa pool .
1079 This will set the default
1080 .Sy cachefile
1081 property to
1082 .Sy none .
1083 This is intended to handle name space collisions when creating pools
1084 for other systems, such as virtual machines or physical machines
1085 whose pools live on network block devices.
1086 .El
1087 .It Xo
1088 .Nm
1089 .Cm destroy
1090 .Op Fl f
1091 .Ar pool
1092 .Xc
1093 .Pp
1094 Destroys the given pool, freeing up any devices for other use. This command
1095 tries to unmount any active datasets before destroying the pool.
1096 .Bl -tag -width indent
1097 .It Fl f
1098 Forces any active datasets contained within the pool to be unmounted.
1099 .El
1100 .It Xo
1101 .Nm
1102 .Cm detach
1103 .Ar pool device
1104 .Xc
1105 .Pp
1106 Detaches
1107 .Ar device
1108 from a mirror. The operation is refused if there are no other valid replicas
1109 of the data.
1110 .It Xo
1111 .Nm
1112 .Cm export
1113 .Op Fl f
1114 .Ar pool ...
1115 .Xc
1116 .Pp
1117 Exports the given pools from the system. All devices are marked as exported,
1118 but are still considered in use by other subsystems. The devices can be moved
1119 between systems (even those of different endianness) and imported as long as a
1120 sufficient number of devices are present.
1121 .Pp
1122 Before exporting the pool, all datasets within the pool are unmounted. A pool
1123 can not be exported if it has a shared spare that is currently being used.
1124 .Pp
1125 For pools to be portable, you must give the
1126 .Nm
1127 command whole disks, not just slices, so that
1128 .Tn ZFS
1129 can label the disks with portable
1130 .Sy EFI
1131 labels. Otherwise, disk drivers on platforms of different endianness will not
1132 recognize the disks.
1133 .Bl -tag -width indent
1134 .It Fl f
1135 Forcefully unmount all datasets, using the
1136 .Qq Nm unmount Fl f
1137 command.
1138 .Pp
1139 This command will forcefully export the pool even if it has a shared spare that
1140 is currently being used. This may lead to potential data corruption.
1141 .El
1142 .It Xo
1143 .Nm
1144 .Cm get
1145 .Op Fl Hp
1146 .Op Fl o Ar field Ns Op , Ns Ar ...
1147 .Ar all | property Ns Op , Ns Ar ...
1148 .Ar pool ...
1149 .Xc
1150 .Pp
1151 Retrieves the given list of properties (or all properties if
1152 .Qq Cm all
1153 is used) for the specified storage pool(s). These properties are displayed with
1154 the following fields:
1155 .Bl -column -offset indent "property"
1156 .It name Ta Name of storage pool
1157 .It property Ta Property name
1158 .It value Ta Property value
1159 .It source Ta Property source, either 'default' or 'local'.
1160 .El
1161 .Pp
1162 See the
1163 .Qq Sx Properties
1164 section for more information on the available pool properties.
1165 .It Fl H
1166 Scripted mode. Do not display headers, and separate fields by a single tab
1167 instead of arbitrary space.
1168 .It Fl p
1169 Display numbers in parsable (exact) values.
1170 .It Fl o Ar field
1171 A comma-separated list of columns to display.
1172 .Sy name Ns , Ns
1173 .Sy property Ns , Ns
1174 .Sy value Ns , Ns
1175 .Sy source
1176 is the default value.
1177 .It Xo
1178 .Nm
1179 .Cm history
1180 .Op Fl il
1181 .Op Ar pool
1182 .Ar ...
1183 .Xc
1184 .Pp
1185 Displays the command history of the specified pools or all pools if no pool is
1186 specified.
1187 .Bl -tag -width indent
1188 .It Fl i
1189 Displays internally logged
1190 .Tn ZFS
1191 events in addition to user initiated events.
1192 .It Fl l
1193 Displays log records in long format, which in addition to standard format
1194 includes, the user name, the hostname, and the zone in which the operation was
1195 performed.
1196 .El
1197 .It Xo
1198 .Nm
1199 .Cm import
1200 .Op Fl d Ar dir | Fl c Ar cachefile
1201 .Op Fl D
1202 .Xc
1203 .Pp
1204 Lists pools available to import. If the
1205 .Fl d
1206 option is not specified, this command searches for devices in
1207 .Qq Pa /dev .
1208 The
1209 .Fl d
1210 option can be specified multiple times, and all directories are searched. If
1211 the device appears to be part of an exported pool, this command displays a
1212 summary of the pool with the name of the pool, a numeric identifier, as well as
1213 the
1214 .No vdev
1215 layout and current health of the device for each device or file.
1216 Destroyed pools, pools that were previously destroyed with the
1217 .Qq Nm Cm destroy
1218 command, are not listed unless the
1219 .Fl D
1220 option is specified.
1221 .Pp
1222 The numeric identifier is unique, and can be used instead of the pool name when
1223 multiple exported pools of the same name are available.
1224 .Bl -tag -width indent
1225 .It Fl c Ar cachefile
1226 Reads configuration from the given
1227 .Ar cachefile
1228 that was created with the
1229 .Qq Sy cachefile
1230 pool property. This
1231 .Ar cachefile
1232 is used instead of searching for devices.
1233 .It Fl d Ar dir
1234 Searches for devices or files in
1235 .Ar dir .
1236 The
1237 .Fl d
1238 option can be specified multiple times.
1239 .It Fl D
1240 Lists destroyed pools only.
1241 .El
1242 .It Xo
1243 .Nm
1244 .Cm import
1245 .Op Fl o Ar mntopts
1246 .Op Fl o Ar property Ns = Ns Ar value
1247 .Ar ...
1248 .Op Fl d Ar dir | Fl c Ar cachefile
1249 .Op Fl D
1250 .Op Fl f
1251 .Op Fl m
1252 .Op Fl N
1253 .Op Fl R Ar root
1254 .Op Fl F Op Fl n
1255 .Fl a
1256 .Xc
1257 .Pp
1258 Imports all pools found in the search directories. Identical to the previous
1259 command, except that all pools with a sufficient number of devices available
1260 are imported. Destroyed pools, pools that were previously destroyed with the
1261 .Qq Nm Cm destroy
1262 command, will not be imported unless the
1263 .Fl D
1264 option is specified.
1265 .Bl -tag -width indent
1266 .It Fl o Ar mntopts
1267 Comma-separated list of mount options to use when mounting datasets within the
1268 pool. See
1269 .Xr zfs 8
1270 for a description of dataset properties and mount options.
1271 .It Fl o Ar property Ns = Ns Ar value
1272 Sets the specified property on the imported pool. See the
1273 .Qq Sx Properties
1274 section for more information on the available pool properties.
1275 .It Fl c Ar cachefile
1276 Reads configuration from the given
1277 .Ar cachefile
1278 that was created with the
1279 .Qq Sy cachefile
1280 pool property. This
1281 .Ar cachefile
1282 is used instead of searching for devices.
1283 .It Fl d Ar dir
1284 Searches for devices or files in
1285 .Ar dir .
1286 The
1287 .Fl d
1288 option can be specified multiple times. This option is incompatible with the
1289 .Fl c
1290 option.
1291 .It Fl D
1292 Imports destroyed pools only. The
1293 .Fl f
1294 option is also required.
1295 .It Fl f
1296 Forces import, even if the pool appears to be potentially active.
1297 .It Fl m
1298 Allows a pool to import when there is a missing log device. Recent transactions
1299 can be lost because the log device will be discarded.
1300 .It Fl N
1301 Import the pool without mounting any file systems.
1302 .It Fl R Ar root
1303 Sets the
1304 .Qq Sy cachefile
1305 property to
1306 .Qq Cm none
1307 and the
1308 .Qq Sy altroot
1309 property to
1310 .Qq Ar root
1311 .It Fl F
1312 Recovery mode for a non-importable pool. Attempt to return the pool to an
1313 importable state by discarding the last few transactions. Not all damaged pools
1314 can be recovered by using this option. If successful, the data from the
1315 discarded transactions is irretrievably lost. This option is ignored if the
1316 pool is importable or already imported.
1317 .It Fl n
1318 Used with the
1319 .Fl F
1320 recovery option. Determines whether a non-importable pool can be made
1321 importable again, but does not actually perform the pool recovery. For more
1322 details about pool recovery mode, see the
1323 .Fl F
1324 option, above.
1325 .It Fl a
1326 Searches for and imports all pools found.
1327 .El
1328 .It Xo
1329 .Nm
1330 .Cm import
1331 .Op Fl o Ar mntopts
1332 .Op Fl o Ar property Ns = Ns Ar value
1333 .Ar ...
1334 .Op Fl d Ar dir | Fl c Ar cachefile
1335 .Op Fl D
1336 .Op Fl f
1337 .Op Fl m
1338 .Op Fl N
1339 .Op Fl R Ar root
1340 .Op Fl t
1341 .Op Fl F Op Fl n
1342 .Ar pool | id
1343 .Op Ar newpool
1344 .Xc
1345 .Pp
1346 Imports a specific pool. A pool can be identified by its name or the numeric
1347 identifier. If
1348 .Ar newpool
1349 is specified, the pool is imported using the name
1350 .Ar newpool .
1351 Otherwise, it is imported with the same name as its exported name.
1352 .Pp
1353 If a device is removed from a system without running
1354 .Qq Nm Cm export
1355 first, the device appears as potentially active. It cannot be determined if
1356 this was a failed export, or whether the device is really in use from another
1357 host. To import a pool in this state, the
1358 .Fl f
1359 option is required.
1360 .Bl -tag -width indent
1361 .It Fl o Ar mntopts
1362 Comma-separated list of mount options to use when mounting datasets within the
1363 pool. See
1364 .Xr zfs 8
1365 for a description of dataset properties and mount options.
1366 .It Fl o Ar property Ns = Ns Ar value
1367 Sets the specified property on the imported pool. See the
1368 .Qq Sx Properties
1369 section for more information on the available pool properties.
1370 .It Fl c Ar cachefile
1371 Reads configuration from the given
1372 .Ar cachefile
1373 that was created with the
1374 .Qq Sy cachefile
1375 pool property. This
1376 .Ar cachefile
1377 is used instead of searching for devices.
1378 .It Fl d Ar dir
1379 Searches for devices or files in
1380 .Ar dir .
1381 The
1382 .Fl d
1383 option can be specified multiple times. This option is incompatible with the
1384 .Fl c
1385 option.
1386 .It Fl D
1387 Imports destroyed pools only. The
1388 .Fl f
1389 option is also required.
1390 .It Fl f
1391 Forces import, even if the pool appears to be potentially active.
1392 .It Fl m
1393 Allows a pool to import when there is a missing log device. Recent transactions
1394 can be lost because the log device will be discarded.
1395 .It Fl N
1396 Import the pool without mounting any file systems.
1397 .It Fl R Ar root
1398 Equivalent to
1399 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
1400 .It Fl t
1401 Used with
1402 .Ar newpool .
1403 Specifies that
1404 .Ar newpool
1405 is temporary.
1406 Temporary pool names last until export.
1407 Ensures that the original pool name will be used in all label updates and
1408 therefore is retained upon export.
1409 Will also set
1410 .Sy cachefile
1411 property to
1412 .Sy none
1413 when not explicitly specified.
1414 .It Fl F
1415 Recovery mode for a non-importable pool. Attempt to return the pool to an
1416 importable state by discarding the last few transactions. Not all damaged pools
1417 can be recovered by using this option. If successful, the data from the
1418 discarded transactions is irretrievably lost. This option is ignored if the
1419 pool is importable or already imported.
1420 .It Fl n
1421 Used with the
1422 .Fl F
1423 recovery option. Determines whether a non-importable pool can be made
1424 importable again, but does not actually perform the pool recovery. For more
1425 details about pool recovery mode, see the
1426 .Fl F
1427 option, above.
1428 .It Fl -rewind-to-checkpoint
1429 Rewinds pool to the checkpointed state.
1430 Once the pool is imported with this flag there is no way to undo the rewind.
1431 All changes and data that were written after the checkpoint are lost!
1432 The only exception is when the
1433 .Sy readonly
1434 mounting option is enabled.
1435 In this case, the checkpointed state of the pool is opened and an
1436 administrator can see how the pool would look like if they were
1437 to fully rewind.
1438 .El
1439 .It Xo
1440 .Nm
1441 .Cm initialize
1442 .Op Fl cs
1443 .Ar pool
1444 .Op Ar device Ns ...
1445 .Xc
1446 Begins initializing by writing to all unallocated regions on the specified
1447 devices, or all eligible devices in the pool if no individual devices are
1448 specified.
1449 Only leaf data or log devices may be initialized.
1450 .Bl -tag -width Ds
1451 .It Fl c, -cancel
1452 Cancel initializing on the specified devices, or all eligible devices if none
1453 are specified.
1454 If one or more target devices are invalid or are not currently being
1455 initialized, the command will fail and no cancellation will occur on any device.
1456 .It Fl s -suspend
1457 Suspend initializing on the specified devices, or all eligible devices if none
1458 are specified.
1459 If one or more target devices are invalid or are not currently being
1460 initialized, the command will fail and no suspension will occur on any device.
1461 Initializing can then be resumed by running
1462 .Nm zpool Cm initialize
1463 with no flags on the relevant target devices.
1464 .El
1465 .It Xo
1466 .Nm
1467 .Cm iostat
1468 .Op Fl T Cm d Ns | Ns Cm u
1469 .Op Fl v
1470 .Op Ar pool
1471 .Ar ...
1472 .Op Ar interval Op Ar count
1473 .Xc
1474 .Pp
1475 Displays
1476 .Tn I/O
1477 statistics for the given pools. When given an interval, the statistics are
1478 printed every
1479 .Ar interval
1480 seconds until
1481 .Sy Ctrl-C
1482 is pressed. If no
1483 .Ar pools
1484 are specified, statistics for every pool in the system is shown. If
1485 .Ar count
1486 is specified, the command exits after
1487 .Ar count
1488 reports are printed.
1489 .Bl -tag -width indent
1490 .It Fl T Cm d Ns | Ns Cm u
1491 Print a timestamp.
1492 .Pp
1493 Use modifier
1494 .Cm d
1495 for standard date format. See
1496 .Xr date 1 .
1497 Use modifier
1498 .Cm u
1499 for unixtime
1500 .Pq equals Qq Ic date +%s .
1501 .It Fl v
1502 Verbose statistics. Reports usage statistics for individual
1503 .No vdev Ns s
1504 within the pool, in addition to the pool-wide statistics.
1505 .El
1506 .It Xo
1507 .Nm
1508 .Cm labelclear
1509 .Op Fl f
1510 .Ar device
1511 .Xc
1512 .Pp
1513 Removes
1514 .Tn ZFS
1515 label information from the specified
1516 .Ar device .
1517 The
1518 .Ar device
1519 must not be part of an active pool configuration.
1520 .Bl -tag -width indent
1521 .It Fl f
1522 Treat exported or foreign devices as inactive.
1523 .El
1524 .It Xo
1525 .Nm
1526 .Cm list
1527 .Op Fl Hpv
1528 .Op Fl o Ar property Ns Op , Ns Ar ...
1529 .Op Fl T Cm d Ns | Ns Cm u
1530 .Op Ar pool
1531 .Ar ...
1532 .Op Ar inverval Op Ar count
1533 .Xc
1534 .Pp
1535 Lists the given pools along with a health status and space usage. If no
1536 .Ar pools
1537 are specified, all pools in the system are listed.
1538 .Pp
1539 When given an interval, the output is printed every
1540 .Ar interval
1541 seconds until
1542 .Sy Ctrl-C
1543 is pressed. If
1544 .Ar count
1545 is specified, the command exits after
1546 .Ar count
1547 reports are printed.
1548 .Bl -tag -width indent
1549 .It Fl T Cm d Ns | Ns Cm u
1550 Print a timestamp.
1551 .Pp
1552 Use modifier
1553 .Cm d
1554 for standard date format. See
1555 .Xr date 1 .
1556 Use modifier
1557 .Cm u
1558 for unixtime
1559 .Pq equals Qq Ic date +%s .
1560 .It Fl H
1561 Scripted mode. Do not display headers, and separate fields by a single tab
1562 instead of arbitrary space.
1563 .It Fl p
1564 Display numbers in parsable (exact) values.
1565 .It Fl v
1566 Verbose statistics. Reports usage statistics for individual
1567 .Em vdevs
1568 within
1569 the pool, in addition to the pool-wide statistics.
1570 .It Fl o Ar property Ns Op , Ns Ar ...
1571 Comma-separated list of properties to display. See the
1572 .Qq Sx Properties
1573 section for a list of valid properties. The default list is
1574 .Sy name ,
1575 .Sy size ,
1576 .Sy used ,
1577 .Sy available ,
1578 .Sy checkpoint ,
1579 .Sy expandsize ,
1580 .Sy fragmentation ,
1581 .Sy capacity  ,
1582 .Sy dedupratio ,
1583 .Sy health ,
1584 .Sy altroot .
1585 .It Fl T Cm d Ns | Ns Cm u
1586 Print a timestamp.
1587 .Pp
1588 Use modifier
1589 .Cm d
1590 for standard date format. See
1591 .Xr date 1 .
1592 Use modifier
1593 .Cm u
1594 for unixtime
1595 .Pq equals Qq Ic date +%s .
1596 .El
1597 .It Xo
1598 .Nm
1599 .Cm offline
1600 .Op Fl t
1601 .Ar pool device ...
1602 .Xc
1603 .Pp
1604 Takes the specified physical device offline. While the
1605 .Ar device
1606 is offline, no attempt is made to read or write to the device.
1607 .Bl -tag -width indent
1608 .It Fl t
1609 Temporary. Upon reboot, the specified physical device reverts to its previous
1610 state.
1611 .El
1612 .It Xo
1613 .Nm
1614 .Cm online
1615 .Op Fl e
1616 .Ar pool device ...
1617 .Xc
1618 .Pp
1619 Brings the specified physical device online.
1620 .Pp
1621 This command is not applicable to spares or cache devices.
1622 .Bl -tag -width indent
1623 .It Fl e
1624 Expand the device to use all available space. If the device is part of a mirror
1625 or
1626 .No raidz
1627 then all devices must be expanded before the new space will become
1628 available to the pool.
1629 .El
1630 .It Xo
1631 .Nm
1632 .Cm reguid
1633 .Ar pool
1634 .Xc
1635 .Pp
1636 Generates a new unique identifier for the pool.  You must ensure that all
1637 devices in this pool are online and healthy before performing this action.
1638 .It Xo
1639 .Nm
1640 .Cm remove
1641 .Op Fl np
1642 .Ar pool device ...
1643 .Xc
1644 .Pp
1645 Removes the specified device from the pool.
1646 This command currently only supports removing hot spares, cache, log
1647 devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
1648 .sp
1649 Removing a top-level vdev reduces the total amount of space in the storage pool.
1650 The specified device will be evacuated by copying all allocated space from it to
1651 the other devices in the pool.
1652 In this case, the
1653 .Nm zpool Cm remove
1654 command initiates the removal and returns, while the evacuation continues in
1655 the background.
1656 The removal progress can be monitored with
1657 .Nm zpool Cm status.
1658 This feature must be enabled to be used, see
1659 .Xr zpool-features 5
1660 .Pp
1661 A mirrored top-level device (log or data) can be removed by specifying the
1662 top-level mirror for the same.
1663 Non-log devices or data devices that are part of a mirrored configuration can
1664 be removed using the
1665 .Qq Nm Cm detach
1666 command.
1667 .Bl -tag -width Ds
1668 .It Fl n
1669 Do not actually perform the removal ("no-op").
1670 Instead, print the estimated amount of memory that will be used by the
1671 mapping table after the removal completes.
1672 This is nonzero only for top-level vdevs.
1673 .El
1674 .Bl -tag -width Ds
1675 .It Fl p
1676 Used in conjunction with the
1677 .Fl n
1678 flag, displays numbers as parsable (exact) values.
1679 .El
1680 .It Xo
1681 .Nm
1682 .Cm remove
1683 .Fl s
1684 .Ar pool
1685 .Xc
1686 .Pp
1687 Stops and cancels an in-progress removal of a top-level vdev.
1688 .It Xo
1689 .Nm
1690 .Cm reopen
1691 .Ar pool
1692 .Xc
1693 .Pp
1694 Reopen all the vdevs associated with the pool.
1695 .It Xo
1696 .Nm
1697 .Cm replace
1698 .Op Fl f
1699 .Ar pool device
1700 .Op Ar new_device
1701 .Xc
1702 .Pp
1703 Replaces
1704 .Ar old_device
1705 with
1706 .Ar new_device .
1707 This is equivalent to attaching
1708 .Ar new_device ,
1709 waiting for it to resilver, and then detaching
1710 .Ar old_device .
1711 .Pp
1712 The size of
1713 .Ar new_device
1714 must be greater than or equal to the minimum size
1715 of all the devices in a mirror or
1716 .No raidz
1717 configuration.
1718 .Pp
1719 .Ar new_device
1720 is required if the pool is not redundant. If
1721 .Ar new_device
1722 is not specified, it defaults to
1723 .Ar old_device .
1724 This form of replacement is useful after an existing disk has failed and has
1725 been physically replaced. In this case, the new disk may have the same
1726 .Pa /dev
1727 path as the old device, even though it is actually a different disk.
1728 .Tn ZFS
1729 recognizes this.
1730 .Bl -tag -width indent
1731 .It Fl f
1732 Forces use of
1733 .Ar new_device ,
1734 even if its appears to be in use. Not all devices can be overridden in this
1735 manner.
1736 .El
1737 .It Xo
1738 .Nm
1739 .Cm scrub
1740 .Op Fl s | Fl p
1741 .Ar pool ...
1742 .Xc
1743 .Pp
1744 Begins a scrub or resumes a paused scrub.
1745 The scrub examines all data in the specified pools to verify that it checksums
1746 correctly.
1747 For replicated
1748 .Pq mirror or raidz
1749 devices, ZFS automatically repairs any damage discovered during the scrub.
1750 The
1751 .Nm zpool Cm status
1752 command reports the progress of the scrub and summarizes the results of the
1753 scrub upon completion.
1754 .Pp
1755 Scrubbing and resilvering are very similar operations.
1756 The difference is that resilvering only examines data that ZFS knows to be out
1757 of date
1758 .Po
1759 for example, when attaching a new device to a mirror or replacing an existing
1760 device
1761 .Pc ,
1762 whereas scrubbing examines all data to discover silent errors due to hardware
1763 faults or disk failure.
1764 .Pp
1765 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1766 one at a time.
1767 If a scrub is paused, the
1768 .Nm zpool Cm scrub
1769 resumes it.
1770 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1771 resilver completes.
1772 .Bl -tag -width Ds
1773 .It Fl s
1774 Stop scrubbing.
1775 .El
1776 .Bl -tag -width Ds
1777 .It Fl p
1778 Pause scrubbing.
1779 Scrub pause state and progress are periodically synced to disk.
1780 If the system is restarted or pool is exported during a paused scrub,
1781 even after import, scrub will remain paused until it is resumed.
1782 Once resumed the scrub will pick up from the place where it was last
1783 checkpointed to disk.
1784 To resume a paused scrub issue
1785 .Nm zpool Cm scrub
1786 again.
1787 .El
1788 .It Xo
1789 .Nm
1790 .Cm set
1791 .Ar property Ns = Ns Ar value pool
1792 .Xc
1793 .Pp
1794 Sets the given property on the specified pool. See the
1795 .Qq Sx Properties
1796 section for more information on what properties can be set and acceptable
1797 values.
1798 .It Xo
1799 .Nm
1800 .Cm split
1801 .Op Fl n
1802 .Op Fl R Ar altroot
1803 .Op Fl o Ar mntopts
1804 .Op Fl o Ar property Ns = Ns Ar value
1805 .Ar pool newpool
1806 .Op Ar device ...
1807 .Xc
1808 .Pp
1809 Splits off one disk from each mirrored top-level
1810 .No vdev
1811 in a pool and creates a new pool from the split-off disks. The original pool
1812 must be made up of one or more mirrors and must not be in the process of
1813 resilvering. The
1814 .Cm split
1815 subcommand chooses the last device in each mirror
1816 .No vdev
1817 unless overridden by a device specification on the command line.
1818 .Pp
1819 When using a
1820 .Ar device
1821 argument,
1822 .Cm split
1823 includes the specified device(s) in a new pool and, should any devices remain
1824 unspecified, assigns the last device in each mirror
1825 .No vdev
1826 to that pool, as it does normally. If you are uncertain about the outcome of a
1827 .Cm split
1828 command, use the
1829 .Fl n
1830 ("dry-run") option to ensure your command will have the effect you intend.
1831 .Bl -tag -width indent
1832 .It Fl R Ar altroot
1833 Automatically import the newly created pool after splitting, using the
1834 specified
1835 .Ar altroot
1836 parameter for the new pool's alternate root. See the
1837 .Sy altroot
1838 description in the
1839 .Qq Sx Properties
1840 section, above.
1841 .It Fl n
1842 Displays the configuration that would be created without actually splitting the
1843 pool. The actual pool split could still fail due to insufficient privileges or
1844 device status.
1845 .It Fl o Ar mntopts
1846 Comma-separated list of mount options to use when mounting datasets within the
1847 pool. See
1848 .Xr zfs 8
1849 for a description of dataset properties and mount options. Valid only in
1850 conjunction with the
1851 .Fl R
1852 option.
1853 .It Fl o Ar property Ns = Ns Ar value
1854 Sets the specified property on the new pool. See the
1855 .Qq Sx Properties
1856 section, above, for more information on the available pool properties.
1857 .El
1858 .It Xo
1859 .Nm
1860 .Cm status
1861 .Op Fl Dvx
1862 .Op Fl T Cm d Ns | Ns Cm u
1863 .Op Ar pool
1864 .Ar ...
1865 .Op Ar interval Op Ar count
1866 .Xc
1867 .Pp
1868 Displays the detailed health status for the given pools. If no
1869 .Ar pool
1870 is specified, then the status of each pool in the system is displayed. For more
1871 information on pool and device health, see the
1872 .Qq Sx Device Failure and Recovery
1873 section.
1874 .Pp
1875 When given an interval, the output is printed every
1876 .Ar interval
1877 seconds until
1878 .Sy Ctrl-C
1879 is pressed. If
1880 .Ar count
1881 is specified, the command exits after
1882 .Ar count
1883 reports are printed.
1884 .Pp
1885 If a scrub or resilver is in progress, this command reports the percentage
1886 done and the estimated time to completion. Both of these are only approximate,
1887 because the amount of data in the pool and the other workloads on the system
1888 can change.
1889 .Bl -tag -width indent
1890 .It Fl D
1891 Display a histogram of deduplication statistics, showing the allocated
1892 .Pq physically present on disk
1893 and referenced
1894 .Pq logically referenced in the pool
1895 block counts and sizes by reference count.
1896 .It Fl T Cm d Ns | Ns Cm u
1897 Print a timestamp.
1898 .Pp
1899 Use modifier
1900 .Cm d
1901 for standard date format. See
1902 .Xr date 1 .
1903 Use modifier
1904 .Cm u
1905 for unixtime
1906 .Pq equals Qq Ic date +%s .
1907 .It Fl v
1908 Displays verbose data error information, printing out a complete list of all
1909 data errors since the last complete pool scrub.
1910 .It Fl x
1911 Only display status for pools that are exhibiting errors or are otherwise
1912 unavailable.
1913 Warnings about pools not using the latest on-disk format, having non-native
1914 block size or disabled features will not be included.
1915 .El
1916 .It Xo
1917 .Nm
1918 .Cm upgrade
1919 .Op Fl v
1920 .Xc
1921 .Pp
1922 Displays pools which do not have all supported features enabled and pools
1923 formatted using a legacy
1924 .Tn ZFS
1925 version number.
1926 These pools can continue to be used, but some features may not be available.
1927 Use
1928 .Nm Cm upgrade Fl a
1929 to enable all features on all pools.
1930 .Bl -tag -width indent
1931 .It Fl v
1932 Displays legacy
1933 .Tn ZFS
1934 versions supported by the current software.
1935 See
1936 .Xr zpool-features 7
1937 for a description of feature flags features supported by the current software.
1938 .El
1939 .It Xo
1940 .Nm
1941 .Cm upgrade
1942 .Op Fl V Ar version
1943 .Fl a | Ar pool ...
1944 .Xc
1945 .Pp
1946 Enables all supported features on the given pool.
1947 Once this is done, the pool will no longer be accessible on systems that do
1948 not support feature flags.
1949 See
1950 .Xr zpool-features 7
1951 for details on compatibility with systems that support feature flags, but do
1952 not support all features enabled on the pool.
1953 .Bl -tag -width indent
1954 .It Fl a
1955 Enables all supported features on all pools.
1956 .It Fl V Ar version
1957 Upgrade to the specified legacy version. If the
1958 .Fl V
1959 flag is specified, no features will be enabled on the pool.
1960 This option can only be used to increase version number up to the last
1961 supported legacy version number.
1962 .El
1963 .El
1964 .Sh EXIT STATUS
1965 The following exit values are returned:
1966 .Bl -tag -offset 2n -width 2n
1967 .It 0
1968 Successful completion.
1969 .It 1
1970 An error occurred.
1971 .It 2
1972 Invalid command line options were specified.
1973 .El
1974 .Sh EXAMPLES
1975 .Bl -tag -width 0n
1976 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1977 .Pp
1978 The following command creates a pool with a single
1979 .No raidz
1980 root
1981 .No vdev
1982 that consists of six disks.
1983 .Bd -literal -offset 2n
1984 .Li # Ic zpool create tank raidz da0 da1 da2 da3 da4 da5
1985 .Ed
1986 .It Sy Example 2 No Creating a Mirrored Storage Pool
1987 .Pp
1988 The following command creates a pool with two mirrors, where each mirror
1989 contains two disks.
1990 .Bd -literal -offset 2n
1991 .Li # Ic zpool create tank mirror da0 da1 mirror da2 da3
1992 .Ed
1993 .It Sy Example 3 No Creating a Tn ZFS No Storage Pool by Using Partitions
1994 .Pp
1995 The following command creates an unmirrored pool using two GPT partitions.
1996 .Bd -literal -offset 2n
1997 .Li # Ic zpool create tank da0p3 da1p3
1998 .Ed
1999 .It Sy Example 4 No Creating a Tn ZFS No Storage Pool by Using Files
2000 .Pp
2001 The following command creates an unmirrored pool using files. While not
2002 recommended, a pool based on files can be useful for experimental purposes.
2003 .Bd -literal -offset 2n
2004 .Li # Ic zpool create tank /path/to/file/a /path/to/file/b
2005 .Ed
2006 .It Sy Example 5 No Adding a Mirror to a Tn ZFS No Storage Pool
2007 .Pp
2008 The following command adds two mirrored disks to the pool
2009 .Em tank ,
2010 assuming the pool is already made up of two-way mirrors. The additional space
2011 is immediately available to any datasets within the pool.
2012 .Bd -literal -offset 2n
2013 .Li # Ic zpool add tank mirror da2 da3
2014 .Ed
2015 .It Sy Example 6 No Listing Available Tn ZFS No Storage Pools
2016 .Pp
2017 The following command lists all available pools on the system.
2018 .Bd -literal -offset 2n
2019 .Li # Ic zpool list
2020 NAME   SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
2021 pool  2.70T   473G  2.24T    33%         -    17%  1.00x  ONLINE  -
2022 test  1.98G  89.5K  1.98G    48%         -     0%  1.00x  ONLINE  -
2023 .Ed
2024 .It Sy Example 7 No Listing All Properties for a Pool
2025 .Pp
2026 The following command lists all the properties for a pool.
2027 .Bd -literal -offset 2n
2028 .Li # Ic zpool get all pool
2029 pool  size           2.70T       -
2030 pool  capacity       17%         -
2031 pool  altroot        -           default
2032 pool  health         ONLINE      -
2033 pool  guid           2501120270416322443  default
2034 pool  version        28          default
2035 pool  bootfs         pool/root   local
2036 pool  delegation     on          default
2037 pool  autoreplace    off         default
2038 pool  cachefile      -           default
2039 pool  failmode       wait        default
2040 pool  listsnapshots  off         default
2041 pool  autoexpand     off         default
2042 pool  dedupditto     0           default
2043 pool  dedupratio     1.00x       -
2044 pool  free           2.24T       -
2045 pool  allocated      473G        -
2046 pool  readonly       off         -
2047 .Ed
2048 .It Sy Example 8 No Destroying a Tn ZFS No Storage Pool
2049 .Pp
2050 The following command destroys the pool
2051 .Qq Em tank
2052 and any datasets contained within.
2053 .Bd -literal -offset 2n
2054 .Li # Ic zpool destroy -f tank
2055 .Ed
2056 .It Sy Example 9 No Exporting a Tn ZFS No Storage Pool
2057 .Pp
2058 The following command exports the devices in pool
2059 .Em tank
2060 so that they can be relocated or later imported.
2061 .Bd -literal -offset 2n
2062 .Li # Ic zpool export tank
2063 .Ed
2064 .It Sy Example 10 No Importing a Tn ZFS No Storage Pool
2065 .Pp
2066 The following command displays available pools, and then imports the pool
2067 .Qq Em tank
2068 for use on the system.
2069 .Pp
2070 The results from this command are similar to the following:
2071 .Bd -literal -offset 2n
2072 .Li # Ic zpool import
2073
2074   pool: tank
2075     id: 15451357997522795478
2076  state: ONLINE
2077 action: The pool can be imported using its name or numeric identifier.
2078 config:
2079
2080         tank        ONLINE
2081           mirror    ONLINE
2082                da0  ONLINE
2083                da1  ONLINE
2084 .Ed
2085 .It Xo
2086 .Sy Example 11
2087 Upgrading All
2088 .Tn ZFS
2089 Storage Pools to the Current Version
2090 .Xc
2091 .Pp
2092 The following command upgrades all
2093 .Tn ZFS
2094 Storage pools to the current version of
2095 the software.
2096 .Bd -literal -offset 2n
2097 .Li # Ic zpool upgrade -a
2098 This system is currently running ZFS pool version 28.
2099 .Ed
2100 .It Sy Example 12 No Managing Hot Spares
2101 .Pp
2102 The following command creates a new pool with an available hot spare:
2103 .Bd -literal -offset 2n
2104 .Li # Ic zpool create tank mirror da0 da1 spare da2
2105 .Ed
2106 .Pp
2107 If one of the disks were to fail, the pool would be reduced to the degraded
2108 state. The failed device can be replaced using the following command:
2109 .Bd -literal -offset 2n
2110 .Li # Ic zpool replace tank da0 da2
2111 .Ed
2112 .Pp
2113 Once the data has been resilvered, the spare is automatically removed and is
2114 made available should another device fails. The hot spare can be permanently
2115 removed from the pool using the following command:
2116 .Bd -literal -offset 2n
2117 .Li # Ic zpool remove tank da2
2118 .Ed
2119 .It Xo
2120 .Sy Example 13
2121 Creating a
2122 .Tn ZFS
2123 Pool with Mirrored Separate Intent Logs
2124 .Xc
2125 .Pp
2126 The following command creates a
2127 .Tn ZFS
2128 storage pool consisting of two, two-way
2129 mirrors and mirrored log devices:
2130 .Bd -literal -offset 2n
2131 .Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5
2132 .Ed
2133 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
2134 .Pp
2135 The following command adds two disks for use as cache devices to a
2136 .Tn ZFS
2137 storage pool:
2138 .Bd -literal -offset 2n
2139 .Li # Ic zpool add pool cache da2 da3
2140 .Ed
2141 .Pp
2142 Once added, the cache devices gradually fill with content from main memory.
2143 Depending on the size of your cache devices, it could take over an hour for
2144 them to fill. Capacity and reads can be monitored using the
2145 .Cm iostat
2146 subcommand as follows:
2147 .Bd -literal -offset 2n
2148 .Li # Ic zpool iostat -v pool 5
2149 .Ed
2150 .It Xo
2151 .Sy Example 15
2152 Displaying expanded space on a device
2153 .Xc
2154 .Pp
2155 The following command dipslays the detailed information for the
2156 .Em data
2157 pool.
2158 This pool is comprised of a single
2159 .Em raidz
2160 vdev where one of its
2161 devices increased its capacity by 10GB.
2162 In this example, the pool will not
2163 be able to utilized this extra capacity until all the devices under the
2164 .Em raidz
2165 vdev have been expanded.
2166 .Bd -literal -offset 2n
2167 .Li # Ic zpool list -v data
2168 NAME       SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
2169 data      23.9G  14.6G  9.30G    48%         -    61%  1.00x  ONLINE  -
2170   raidz1  23.9G  14.6G  9.30G    48%         -
2171     ada0      -      -      -      -         -
2172     ada1      -      -      -      -       10G
2173     ada2      -      -      -      -         -
2174 .Ed
2175 .It Xo
2176 .Sy Example 16
2177 Removing a Mirrored top-level (Log or Data) Device
2178 .Xc
2179 .Pp
2180 The following commands remove the mirrored log device
2181 .Sy mirror-2
2182 and mirrored top-level data device
2183 .Sy mirror-1 .
2184 .Pp
2185 Given this configuration:
2186 .Bd -literal -offset 2n
2187    pool: tank
2188   state: ONLINE
2189   scrub: none requested
2190  config:
2191
2192          NAME        STATE     READ WRITE CKSUM
2193          tank        ONLINE       0     0     0
2194            mirror-0  ONLINE       0     0     0
2195                 da0  ONLINE       0     0     0
2196                 da1  ONLINE       0     0     0
2197            mirror-1  ONLINE       0     0     0
2198                 da2  ONLINE       0     0     0
2199                 da3  ONLINE       0     0     0
2200          logs
2201            mirror-2  ONLINE       0     0     0
2202                 da4  ONLINE       0     0     0
2203                 da5  ONLINE       0     0     0
2204 .Ed
2205 .Pp
2206 The command to remove the mirrored log
2207 .Em mirror-2
2208 is:
2209 .Bd -literal -offset 2n
2210 .Li # Ic zpool remove tank mirror-2
2211 .Ed
2212 .Pp
2213 The command to remove the mirrored data
2214 .Em mirror-1
2215 is:
2216 .Bd -literal -offset 2n
2217 .Li # Ic zpool remove tank mirror-1
2218 .Ed
2219 .It Xo
2220 .Sy Example 17
2221 Recovering a Faulted
2222 .Tn ZFS
2223 Pool
2224 .Xc
2225 .Pp
2226 If a pool is faulted but recoverable, a message indicating this state is
2227 provided by
2228 .Qq Nm Cm status
2229 if the pool was cached (see the
2230 .Fl c Ar cachefile
2231 argument above), or as part of the error output from a failed
2232 .Qq Nm Cm import
2233 of the pool.
2234 .Pp
2235 Recover a cached pool with the
2236 .Qq Nm Cm clear
2237 command:
2238 .Bd -literal -offset 2n
2239 .Li # Ic zpool clear -F data
2240 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
2241 Discarded approximately 29 seconds of transactions.
2242 .Ed
2243 .Pp
2244 If the pool configuration was not cached, use
2245 .Qq Nm Cm import
2246 with the recovery mode flag:
2247 .Bd -literal -offset 2n
2248 .Li # Ic zpool import -F data
2249 Pool data returned to its state as of Tue Sep 08 13:23:35 2009.
2250 Discarded approximately 29 seconds of transactions.
2251 .Ed
2252 .El
2253 .Sh SEE ALSO
2254 .Xr zpool-features 7 ,
2255 .Xr zfs 8 ,
2256 .Xr zfsd 8
2257 .Sh AUTHORS
2258 This manual page is a
2259 .Xr mdoc 7
2260 reimplementation of the
2261 .Tn OpenSolaris
2262 manual page
2263 .Em zpool(1M) ,
2264 modified and customized for
2265 .Fx
2266 and licensed under the Common Development and Distribution License
2267 .Pq Tn CDDL .
2268 .Pp
2269 The
2270 .Xr mdoc 7
2271 implementation of this manual page was initially written by
2272 .An Martin Matuska Aq mm@FreeBSD.org .