Merge commit 'bb1f424574ac8e08069d0ba993c2a41ffe796794'
[unleashed.git] / share / man / man8 / zpool.8
blob144fccc7ce4659b86138de763d06faf9490bb2d8
1 .\"
2 .\" CDDL HEADER START
3 .\"
4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
7 .\"
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
12 .\"
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 .\"
19 .\" CDDL HEADER END
20 .\"
21 .\"
22 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23 .\" Copyright (c) 2012, 2017 by Delphix. All rights reserved.
24 .\" Copyright 2017 Nexenta Systems, Inc.
25 .\" Copyright (c) 2017 Datto Inc.
26 .\" Copyright (c) 2017 George Melikov. All Rights Reserved.
27 .\"
28 .Dd December 6, 2017
29 .Dt ZPOOL 8
30 .Os
31 .Sh NAME
32 .Nm zpool
33 .Nd configure ZFS storage pools
34 .Sh SYNOPSIS
35 .Nm
36 .Fl \?
37 .Nm
38 .Cm add
39 .Op Fl fn
40 .Ar pool vdev Ns ...
41 .Nm
42 .Cm attach
43 .Op Fl f
44 .Ar pool device new_device
45 .Nm
46 .Cm checkpoint
47 .Op Fl d, -discard
48 .Ar pool
49 .Nm
50 .Cm clear
51 .Ar pool
52 .Op Ar device
53 .Nm
54 .Cm create
55 .Op Fl dfn
56 .Op Fl B
57 .Op Fl m Ar mountpoint
58 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
59 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
60 .Op Fl R Ar root
61 .Ar pool vdev Ns ...
62 .Nm
63 .Cm destroy
64 .Op Fl f
65 .Ar pool
66 .Nm
67 .Cm detach
68 .Ar pool device
69 .Nm
70 .Cm export
71 .Op Fl f
72 .Ar pool Ns ...
73 .Nm
74 .Cm get
75 .Op Fl Hp
76 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
77 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
78 .Ar pool Ns ...
79 .Nm
80 .Cm history
81 .Op Fl il
82 .Oo Ar pool Oc Ns ...
83 .Nm
84 .Cm import
85 .Op Fl D
86 .Op Fl d Ar dir
87 .Nm
88 .Cm import
89 .Fl a
90 .Op Fl DfmN
91 .Op Fl F Op Fl n
92 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
93 .Op Fl o Ar mntopts
94 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
95 .Op Fl R Ar root
96 .Nm
97 .Cm import
98 .Op Fl Dfm
99 .Op Fl F Op Fl n
100 .Op Fl -rewind-to-checkpoint
101 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
102 .Op Fl o Ar mntopts
103 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
104 .Op Fl R Ar root
105 .Ar pool Ns | Ns Ar id
106 .Op Ar newpool
108 .Cm initialize
109 .Op Fl cs
110 .Ar pool
111 .Op Ar device Ns ...
113 .Cm iostat
114 .Op Fl v
115 .Op Fl T Sy u Ns | Ns Sy d
116 .Oo Ar pool Oc Ns ...
117 .Op Ar interval Op Ar count
119 .Cm labelclear
120 .Op Fl f
121 .Ar device
123 .Cm list
124 .Op Fl Hpv
125 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
126 .Op Fl T Sy u Ns | Ns Sy d
127 .Oo Ar pool Oc Ns ...
128 .Op Ar interval Op Ar count
130 .Cm offline
131 .Op Fl t
132 .Ar pool Ar device Ns ...
134 .Cm online
135 .Op Fl e
136 .Ar pool Ar device Ns ...
138 .Cm reguid
139 .Ar pool
141 .Cm reopen
142 .Ar pool
144 .Cm remove
145 .Op Fl np
146 .Ar pool Ar device Ns ...
148 .Cm remove
149 .Fl s
150 .Ar pool
152 .Cm replace
153 .Op Fl f
154 .Ar pool Ar device Op Ar new_device
156 .Cm scrub
157 .Op Fl s | Fl p
158 .Ar pool Ns ...
160 .Cm set
161 .Ar property Ns = Ns Ar value
162 .Ar pool
164 .Cm split
165 .Op Fl n
166 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
167 .Op Fl R Ar root
168 .Ar pool newpool
170 .Cm status
171 .Op Fl Dvx
172 .Op Fl T Sy u Ns | Ns Sy d
173 .Oo Ar pool Oc Ns ...
174 .Op Ar interval Op Ar count
176 .Cm upgrade
178 .Cm upgrade
179 .Fl v
181 .Cm upgrade
182 .Op Fl V Ar version
183 .Fl a Ns | Ns Ar pool Ns ...
184 .Sh DESCRIPTION
187 command configures ZFS storage pools.
188 A storage pool is a collection of devices that provides physical storage and
189 data replication for ZFS datasets.
190 All datasets within a storage pool share the same space.
192 .Xr zfs 8
193 for information on managing datasets.
194 .Ss Virtual Devices (vdevs)
195 A "virtual device" describes a single device or a collection of devices
196 organized according to certain performance and fault characteristics.
197 The following virtual devices are supported:
198 .Bl -tag -width Ds
199 .It Sy disk
200 A block device, typically located under
201 .Pa /dev/dsk .
202 ZFS can use individual slices or partitions, though the recommended mode of
203 operation is to use whole disks.
204 A disk can be specified by a full path, or it can be a shorthand name
205 .Po the relative portion of the path under
206 .Pa /dev/dsk
207 .Pc .
208 A whole disk can be specified by omitting the slice or partition designation.
209 For example,
210 .Pa c0t0d0
211 is equivalent to
212 .Pa /dev/dsk/c0t0d0s2 .
213 When given a whole disk, ZFS automatically labels the disk, if necessary.
214 .It Sy file
215 A regular file.
216 The use of files as a backing store is strongly discouraged.
217 It is designed primarily for experimental purposes, as the fault tolerance of a
218 file is only as good as the file system of which it is a part.
219 A file must be specified by a full path.
220 .It Sy mirror
221 A mirror of two or more devices.
222 Data is replicated in an identical fashion across all components of a mirror.
223 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
224 failing before data integrity is compromised.
225 .It Sy raidz , raidz1 , raidz2 , raidz3
226 A variation on RAID-5 that allows for better distribution of parity and
227 eliminates the RAID-5
228 .Qq write hole
229 .Pq in which data and parity become inconsistent after a power loss .
230 Data and parity is striped across all disks within a raidz group.
232 A raidz group can have single-, double-, or triple-parity, meaning that the
233 raidz group can sustain one, two, or three failures, respectively, without
234 losing any data.
236 .Sy raidz1
237 vdev type specifies a single-parity raidz group; the
238 .Sy raidz2
239 vdev type specifies a double-parity raidz group; and the
240 .Sy raidz3
241 vdev type specifies a triple-parity raidz group.
243 .Sy raidz
244 vdev type is an alias for
245 .Sy raidz1 .
247 A raidz group with N disks of size X with P parity disks can hold approximately
248 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
249 compromised.
250 The minimum number of devices in a raidz group is one more than the number of
251 parity disks.
252 The recommended number is between 3 and 9 to help increase performance.
253 .It Sy spare
254 A special pseudo-vdev which keeps track of available hot spares for a pool.
255 For more information, see the
256 .Sx Hot Spares
257 section.
258 .It Sy log
259 A separate intent log device.
260 If more than one log device is specified, then writes are load-balanced between
261 devices.
262 Log devices can be mirrored.
263 However, raidz vdev types are not supported for the intent log.
264 For more information, see the
265 .Sx Intent Log
266 section.
267 .It Sy cache
268 A device used to cache storage pool data.
269 A cache device cannot be configured as a mirror or raidz group.
270 For more information, see the
271 .Sx Cache Devices
272 section.
275 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
276 contain files or disks.
277 Mirrors of mirrors
278 .Pq or other combinations
279 are not allowed.
281 A pool can have any number of virtual devices at the top of the configuration
282 .Po known as
283 .Qq root vdevs
284 .Pc .
285 Data is dynamically distributed across all top-level devices to balance data
286 among devices.
287 As new virtual devices are added, ZFS automatically places data on the newly
288 available devices.
290 Virtual devices are specified one at a time on the command line, separated by
291 whitespace.
292 The keywords
293 .Sy mirror
295 .Sy raidz
296 are used to distinguish where a group ends and another begins.
297 For example, the following creates two root vdevs, each a mirror of two disks:
298 .Bd -literal
299 # zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0
301 .Ss Device Failure and Recovery
302 ZFS supports a rich set of mechanisms for handling device failure and data
303 corruption.
304 All metadata and data is checksummed, and ZFS automatically repairs bad data
305 from a good copy when corruption is detected.
307 In order to take advantage of these features, a pool must make use of some form
308 of redundancy, using either mirrored or raidz groups.
309 While ZFS supports running in a non-redundant configuration, where each root
310 vdev is simply a disk or file, this is strongly discouraged.
311 A single case of bit corruption can render some or all of your data unavailable.
313 A pool's health status is described by one of three states: online, degraded,
314 or faulted.
315 An online pool has all devices operating normally.
316 A degraded pool is one in which one or more devices have failed, but the data is
317 still available due to a redundant configuration.
318 A faulted pool has corrupted metadata, or one or more faulted devices, and
319 insufficient replicas to continue functioning.
321 The health of the top-level vdev, such as mirror or raidz device, is
322 potentially impacted by the state of its associated vdevs, or component
323 devices.
324 A top-level vdev or component device is in one of the following states:
325 .Bl -tag -width "DEGRADED"
326 .It Sy DEGRADED
327 One or more top-level vdevs is in the degraded state because one or more
328 component devices are offline.
329 Sufficient replicas exist to continue functioning.
331 One or more component devices is in the degraded or faulted state, but
332 sufficient replicas exist to continue functioning.
333 The underlying conditions are as follows:
334 .Bl -bullet
336 The number of checksum errors exceeds acceptable levels and the device is
337 degraded as an indication that something may be wrong.
338 ZFS continues to use the device as necessary.
340 The number of I/O errors exceeds acceptable levels.
341 The device could not be marked as faulted because there are insufficient
342 replicas to continue functioning.
344 .It Sy FAULTED
345 One or more top-level vdevs is in the faulted state because one or more
346 component devices are offline.
347 Insufficient replicas exist to continue functioning.
349 One or more component devices is in the faulted state, and insufficient
350 replicas exist to continue functioning.
351 The underlying conditions are as follows:
352 .Bl -bullet
354 The device could be opened, but the contents did not match expected values.
356 The number of I/O errors exceeds acceptable levels and the device is faulted to
357 prevent further use of the device.
359 .It Sy OFFLINE
360 The device was explicitly taken offline by the
361 .Nm zpool Cm offline
362 command.
363 .It Sy ONLINE
364 The device is online and functioning.
365 .It Sy REMOVED
366 The device was physically removed while the system was running.
367 Device removal detection is hardware-dependent and may not be supported on all
368 platforms.
369 .It Sy UNAVAIL
370 The device could not be opened.
371 If a pool is imported when a device was unavailable, then the device will be
372 identified by a unique identifier instead of its path since the path was never
373 correct in the first place.
376 If a device is removed and later re-attached to the system, ZFS attempts
377 to put the device online automatically.
378 Device attach detection is hardware-dependent and might not be supported on all
379 platforms.
380 .Ss Hot Spares
381 ZFS allows devices to be associated with pools as
382 .Qq hot spares .
383 These devices are not actively used in the pool, but when an active device
384 fails, it is automatically replaced by a hot spare.
385 To create a pool with hot spares, specify a
386 .Sy spare
387 vdev with any number of devices.
388 For example,
389 .Bd -literal
390 # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
393 Spares can be shared across multiple pools, and can be added with the
394 .Nm zpool Cm add
395 command and removed with the
396 .Nm zpool Cm remove
397 command.
398 Once a spare replacement is initiated, a new
399 .Sy spare
400 vdev is created within the configuration that will remain there until the
401 original device is replaced.
402 At this point, the hot spare becomes available again if another device fails.
404 If a pool has a shared spare that is currently being used, the pool can not be
405 exported since other pools may use this shared spare, which may lead to
406 potential data corruption.
408 An in-progress spare replacement can be cancelled by detaching the hot spare.
409 If the original faulted device is detached, then the hot spare assumes its
410 place in the configuration, and is removed from the spare list of all active
411 pools.
413 Spares cannot replace log devices.
414 .Ss Intent Log
415 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
416 transactions.
417 For instance, databases often require their transactions to be on stable storage
418 devices when returning from a system call.
419 NFS and other applications can also use
420 .Xr fsync 3C
421 to ensure data stability.
422 By default, the intent log is allocated from blocks within the main pool.
423 However, it might be possible to get better performance using separate intent
424 log devices such as NVRAM or a dedicated disk.
425 For example:
426 .Bd -literal
427 # zpool create pool c0d0 c1d0 log c2d0
430 Multiple log devices can also be specified, and they can be mirrored.
431 See the
432 .Sx EXAMPLES
433 section for an example of mirroring multiple log devices.
435 Log devices can be added, replaced, attached, detached, and imported and
436 exported as part of the larger pool.
437 Mirrored devices can be removed by specifying the top-level mirror vdev.
438 .Ss Cache Devices
439 Devices can be added to a storage pool as
440 .Qq cache devices .
441 These devices provide an additional layer of caching between main memory and
442 disk.
443 For read-heavy workloads, where the working set size is much larger than what
444 can be cached in main memory, using cache devices allow much more of this
445 working set to be served from low latency media.
446 Using cache devices provides the greatest performance improvement for random
447 read-workloads of mostly static content.
449 To create a pool with cache devices, specify a
450 .Sy cache
451 vdev with any number of devices.
452 For example:
453 .Bd -literal
454 # zpool create pool c0d0 c1d0 cache c2d0 c3d0
457 Cache devices cannot be mirrored or part of a raidz configuration.
458 If a read error is encountered on a cache device, that read I/O is reissued to
459 the original storage pool device, which might be part of a mirrored or raidz
460 configuration.
462 The content of the cache devices is considered volatile, as is the case with
463 other system caches.
464 .Ss Pool checkpoint
465 Before starting critical procedures that include destructive actions (e.g
466 .Nm zfs Cm destroy
467 ), an administrator can checkpoint the pool's state and in the case of a
468 mistake or failure, rewind the entire pool back to the checkpoint.
469 Otherwise, the checkpoint can be discarded when the procedure has completed
470 successfully.
472 A pool checkpoint can be thought of as a pool-wide snapshot and should be used
473 with care as it contains every part of the pool's state, from properties to vdev
474 configuration.
475 Thus, while a pool has a checkpoint certain operations are not allowed.
476 Specifically, vdev removal/attach/detach, mirror splitting, and
477 changing the pool's guid.
478 Adding a new vdev is supported but in the case of a rewind it will have to be
479 added again.
480 Finally, users of this feature should keep in mind that scrubs in a pool that
481 has a checkpoint do not repair checkpointed data.
483 To create a checkpoint for a pool:
484 .Bd -literal
485 # zpool checkpoint pool
488 To later rewind to its checkpointed state, you need to first export it and
489 then rewind it during import:
490 .Bd -literal
491 # zpool export pool
492 # zpool import --rewind-to-checkpoint pool
495 To discard the checkpoint from a pool:
496 .Bd -literal
497 # zpool checkpoint -d pool
500 Dataset reservations (controlled by the
501 .Nm reservation
503 .Nm refreservation
504 zfs properties) may be unenforceable while a checkpoint exists, because the
505 checkpoint is allowed to consume the dataset's reservation.
506 Finally, data that is part of the checkpoint but has been freed in the
507 current state of the pool won't be scanned during a scrub.
508 .Ss Properties
509 Each pool has several properties associated with it.
510 Some properties are read-only statistics while others are configurable and
511 change the behavior of the pool.
513 The following are read-only properties:
514 .Bl -tag -width Ds
515 .It Cm allocated
516 Amount of storage space used within the pool.
517 .It Sy bootsize
518 The size of the system boot partition.
519 This property can only be set at pool creation time and is read-only once pool
520 is created.
521 Setting this property implies using the
522 .Fl B
523 option.
524 .It Sy capacity
525 Percentage of pool space used.
526 This property can also be referred to by its shortened column name,
527 .Sy cap .
528 .It Sy expandsize
529 Amount of uninitialized space within the pool or device that can be used to
530 increase the total capacity of the pool.
531 Uninitialized space consists of any space on an EFI labeled vdev which has not
532 been brought online
533 .Po e.g, using
534 .Nm zpool Cm online Fl e
535 .Pc .
536 This space occurs when a LUN is dynamically expanded.
537 .It Sy fragmentation
538 The amount of fragmentation in the pool.
539 .It Sy free
540 The amount of free space available in the pool.
541 .It Sy freeing
542 After a file system or snapshot is destroyed, the space it was using is
543 returned to the pool asynchronously.
544 .Sy freeing
545 is the amount of space remaining to be reclaimed.
546 Over time
547 .Sy freeing
548 will decrease while
549 .Sy free
550 increases.
551 .It Sy health
552 The current health of the pool.
553 Health can be one of
554 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
555 .It Sy guid
556 A unique identifier for the pool.
557 .It Sy size
558 Total size of the storage pool.
559 .It Sy unsupported@ Ns Em feature_guid
560 Information about unsupported features that are enabled on the pool.
562 .Xr zpool-features 5
563 for details.
566 The space usage properties report actual physical space available to the
567 storage pool.
568 The physical space can be different from the total amount of space that any
569 contained datasets can actually use.
570 The amount of space used in a raidz configuration depends on the characteristics
571 of the data being written.
572 In addition, ZFS reserves some space for internal accounting that the
573 .Xr zfs 8
574 command takes into account, but the
576 command does not.
577 For non-full pools of a reasonable size, these effects should be invisible.
578 For small pools, or pools that are close to being completely full, these
579 discrepancies may become more noticeable.
581 The following property can be set at creation time and import time:
582 .Bl -tag -width Ds
583 .It Sy altroot
584 Alternate root directory.
585 If set, this directory is prepended to any mount points within the pool.
586 This can be used when examining an unknown pool where the mount points cannot be
587 trusted, or in an alternate boot environment, where the typical paths are not
588 valid.
589 .Sy altroot
590 is not a persistent property.
591 It is valid only while the system is up.
592 Setting
593 .Sy altroot
594 defaults to using
595 .Sy cachefile Ns = Ns Sy none ,
596 though this may be overridden using an explicit setting.
599 The following property can be set only at import time:
600 .Bl -tag -width Ds
601 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
602 If set to
603 .Sy on ,
604 the pool will be imported in read-only mode.
605 This property can also be referred to by its shortened column name,
606 .Sy rdonly .
609 The following properties can be set at creation time and import time, and later
610 changed with the
611 .Nm zpool Cm set
612 command:
613 .Bl -tag -width Ds
614 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
615 Controls automatic pool expansion when the underlying LUN is grown.
616 If set to
617 .Sy on ,
618 the pool will be resized according to the size of the expanded device.
619 If the device is part of a mirror or raidz then all devices within that
620 mirror/raidz group must be expanded before the new space is made available to
621 the pool.
622 The default behavior is
623 .Sy off .
624 This property can also be referred to by its shortened column name,
625 .Sy expand .
626 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
627 Controls automatic device replacement.
628 If set to
629 .Sy off ,
630 device replacement must be initiated by the administrator by using the
631 .Nm zpool Cm replace
632 command.
633 If set to
634 .Sy on ,
635 any new device, found in the same physical location as a device that previously
636 belonged to the pool, is automatically formatted and replaced.
637 The default behavior is
638 .Sy off .
639 This property can also be referred to by its shortened column name,
640 .Sy replace .
641 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
642 Identifies the default bootable dataset for the root pool.
643 This property is expected to be set mainly by the installation and upgrade
644 programs.
645 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
646 Controls the location of where the pool configuration is cached.
647 Discovering all pools on system startup requires a cached copy of the
648 configuration data that is stored on the root file system.
649 All pools in this cache are automatically imported when the system boots.
650 Some environments, such as install and clustering, need to cache this
651 information in a different location so that pools are not automatically
652 imported.
653 Setting this property caches the pool configuration in a different location that
654 can later be imported with
655 .Nm zpool Cm import Fl c .
656 Setting it to the special value
657 .Sy none
658 creates a temporary pool that is never cached, and the special value
660 .Pq empty string
661 uses the default location.
663 Multiple pools can share the same cache file.
664 Because the kernel destroys and recreates this file when pools are added and
665 removed, care should be taken when attempting to access this file.
666 When the last pool using a
667 .Sy cachefile
668 is exported or destroyed, the file is removed.
669 .It Sy comment Ns = Ns Ar text
670 A text string consisting of printable ASCII characters that will be stored
671 such that it is available even if the pool becomes faulted.
672 An administrator can provide additional information about a pool using this
673 property.
674 .It Sy dedupditto Ns = Ns Ar number
675 Threshold for the number of block ditto copies.
676 If the reference count for a deduplicated block increases above this number, a
677 new ditto copy of this block is automatically stored.
678 The default setting is
679 .Sy 0
680 which causes no ditto copies to be created for deduplicated blocks.
681 The minimum legal nonzero setting is
682 .Sy 100 .
683 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
684 Controls whether a non-privileged user is granted access based on the dataset
685 permissions defined on the dataset.
687 .Xr zfs 8
688 for more information on ZFS delegated administration.
689 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
690 Controls the system behavior in the event of catastrophic pool failure.
691 This condition is typically a result of a loss of connectivity to the underlying
692 storage device(s) or a failure of all devices within the pool.
693 The behavior of such an event is determined as follows:
694 .Bl -tag -width "continue"
695 .It Sy wait
696 Blocks all I/O access until the device connectivity is recovered and the errors
697 are cleared.
698 This is the default behavior.
699 .It Sy continue
700 Returns
701 .Er EIO
702 to any new write I/O requests but allows reads to any of the remaining healthy
703 devices.
704 Any write requests that have yet to be committed to disk would be blocked.
705 .It Sy panic
706 Prints out a message to the console and generates a system crash dump.
708 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
709 The value of this property is the current state of
710 .Ar feature_name .
711 The only valid value when setting this property is
712 .Sy enabled
713 which moves
714 .Ar feature_name
715 to the enabled state.
717 .Xr zpool-features 5
718 for details on feature states.
719 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
720 Controls whether information about snapshots associated with this pool is
721 output when
722 .Nm zfs Cm list
723 is run without the
724 .Fl t
725 option.
726 The default value is
727 .Sy off .
728 This property can also be referred to by its shortened name,
729 .Sy listsnaps .
730 .It Sy version Ns = Ns Ar version
731 The current on-disk version of the pool.
732 This can be increased, but never decreased.
733 The preferred method of updating pools is with the
734 .Nm zpool Cm upgrade
735 command, though this property can be used when a specific version is needed for
736 backwards compatibility.
737 Once feature flags are enabled on a pool this property will no longer have a
738 value.
740 .Ss Subcommands
741 All subcommands that modify state are logged persistently to the pool in their
742 original form.
746 command provides subcommands to create and destroy storage pools, add capacity
747 to storage pools, and provide information about the storage pools.
748 The following subcommands are supported:
749 .Bl -tag -width Ds
750 .It Xo
752 .Fl \?
754 Displays a help message.
755 .It Xo
757 .Cm add
758 .Op Fl fn
759 .Ar pool vdev Ns ...
761 Adds the specified virtual devices to the given pool.
763 .Ar vdev
764 specification is described in the
765 .Sx Virtual Devices
766 section.
767 The behavior of the
768 .Fl f
769 option, and the device checks performed are described in the
770 .Nm zpool Cm create
771 subcommand.
772 .Bl -tag -width Ds
773 .It Fl f
774 Forces use of
775 .Ar vdev Ns s ,
776 even if they appear in use or specify a conflicting replication level.
777 Not all devices can be overridden in this manner.
778 .It Fl n
779 Displays the configuration that would be used without actually adding the
780 .Ar vdev Ns s .
781 The actual pool creation can still fail due to insufficient privileges or
782 device sharing.
784 .It Xo
786 .Cm attach
787 .Op Fl f
788 .Ar pool device new_device
790 Attaches
791 .Ar new_device
792 to the existing
793 .Ar device .
794 The existing device cannot be part of a raidz configuration.
796 .Ar device
797 is not currently part of a mirrored configuration,
798 .Ar device
799 automatically transforms into a two-way mirror of
800 .Ar device
802 .Ar new_device .
804 .Ar device
805 is part of a two-way mirror, attaching
806 .Ar new_device
807 creates a three-way mirror, and so on.
808 In either case,
809 .Ar new_device
810 begins to resilver immediately.
811 .Bl -tag -width Ds
812 .It Fl f
813 Forces use of
814 .Ar new_device ,
815 even if its appears to be in use.
816 Not all devices can be overridden in this manner.
818 .It Xo
820 .Cm checkpoint
821 .Op Fl d, -discard
822 .Ar pool
824 Checkpoints the current state of
825 .Ar pool
826 , which can be later restored by
827 .Nm zpool Cm import --rewind-to-checkpoint .
828 The existence of a checkpoint in a pool prohibits the following
829 .Nm zpool
830 commands:
831 .Cm remove ,
832 .Cm attach ,
833 .Cm detach ,
834 .Cm split ,
836 .Cm reguid .
837 In addition, it may break reservation boundaries if the pool lacks free
838 space.
840 .Nm zpool Cm status
841 command indicates the existence of a checkpoint or the progress of discarding a
842 checkpoint from a pool.
844 .Nm zpool Cm list
845 command reports how much space the checkpoint takes from the pool.
846 .Bl -tag -width Ds
847 .It Fl d, -discard
848 Discards an existing checkpoint from
849 .Ar pool .
851 .It Xo
853 .Cm clear
854 .Ar pool
855 .Op Ar device
857 Clears device errors in a pool.
858 If no arguments are specified, all device errors within the pool are cleared.
859 If one or more devices is specified, only those errors associated with the
860 specified device or devices are cleared.
861 .It Xo
863 .Cm create
864 .Op Fl dfn
865 .Op Fl B
866 .Op Fl m Ar mountpoint
867 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
868 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
869 .Op Fl R Ar root
870 .Ar pool vdev Ns ...
872 Creates a new storage pool containing the virtual devices specified on the
873 command line.
874 The pool name must begin with a letter, and can only contain
875 alphanumeric characters as well as underscore
876 .Pq Qq Sy _ ,
877 dash
878 .Pq Qq Sy - ,
879 and period
880 .Pq Qq Sy \&. .
881 The pool names
882 .Sy mirror ,
883 .Sy raidz ,
884 .Sy spare
886 .Sy log
887 are reserved, as are names beginning with the pattern
888 .Sy c[0-9] .
890 .Ar vdev
891 specification is described in the
892 .Sx Virtual Devices
893 section.
895 The command verifies that each device specified is accessible and not currently
896 in use by another subsystem.
897 There are some uses, such as being currently mounted, or specified as the
898 dedicated dump device, that prevents a device from ever being used by ZFS.
899 Other uses, such as having a preexisting UFS file system, can be overridden with
901 .Fl f
902 option.
904 The command also checks that the replication strategy for the pool is
905 consistent.
906 An attempt to combine redundant and non-redundant storage in a single pool, or
907 to mix disks and files, results in an error unless
908 .Fl f
909 is specified.
910 The use of differently sized devices within a single raidz or mirror group is
911 also flagged as an error unless
912 .Fl f
913 is specified.
915 Unless the
916 .Fl R
917 option is specified, the default mount point is
918 .Pa / Ns Ar pool .
919 The mount point must not exist or must be empty, or else the root dataset
920 cannot be mounted.
921 This can be overridden with the
922 .Fl m
923 option.
925 By default all supported features are enabled on the new pool unless the
926 .Fl d
927 option is specified.
928 .Bl -tag -width Ds
929 .It Fl B
930 Create whole disk pool with EFI System partition to support booting system
931 with UEFI firmware.
932 Default size is 256MB.
933 To create boot partition with custom size, set the
934 .Sy bootsize
935 property with the
936 .Fl o
937 option.
938 See the
939 .Sx Properties
940 section for details.
941 .It Fl d
942 Do not enable any features on the new pool.
943 Individual features can be enabled by setting their corresponding properties to
944 .Sy enabled
945 with the
946 .Fl o
947 option.
949 .Xr zpool-features 5
950 for details about feature properties.
951 .It Fl f
952 Forces use of
953 .Ar vdev Ns s ,
954 even if they appear in use or specify a conflicting replication level.
955 Not all devices can be overridden in this manner.
956 .It Fl m Ar mountpoint
957 Sets the mount point for the root dataset.
958 The default mount point is
959 .Pa /pool
961 .Pa altroot/pool
963 .Ar altroot
964 is specified.
965 The mount point must be an absolute path,
966 .Sy legacy ,
968 .Sy none .
969 For more information on dataset mount points, see
970 .Xr zfs 8 .
971 .It Fl n
972 Displays the configuration that would be used without actually creating the
973 pool.
974 The actual pool creation can still fail due to insufficient privileges or
975 device sharing.
976 .It Fl o Ar property Ns = Ns Ar value
977 Sets the given pool properties.
978 See the
979 .Sx Properties
980 section for a list of valid properties that can be set.
981 .It Fl O Ar file-system-property Ns = Ns Ar value
982 Sets the given file system properties in the root file system of the pool.
983 See the
984 .Sx Properties
985 section of
986 .Xr zfs 8
987 for a list of valid properties that can be set.
988 .It Fl R Ar root
989 Equivalent to
990 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
992 .It Xo
994 .Cm destroy
995 .Op Fl f
996 .Ar pool
998 Destroys the given pool, freeing up any devices for other use.
999 This command tries to unmount any active datasets before destroying the pool.
1000 .Bl -tag -width Ds
1001 .It Fl f
1002 Forces any active datasets contained within the pool to be unmounted.
1004 .It Xo
1006 .Cm detach
1007 .Ar pool device
1009 Detaches
1010 .Ar device
1011 from a mirror.
1012 The operation is refused if there are no other valid replicas of the data.
1013 .It Xo
1015 .Cm export
1016 .Op Fl f
1017 .Ar pool Ns ...
1019 Exports the given pools from the system.
1020 All devices are marked as exported, but are still considered in use by other
1021 subsystems.
1022 The devices can be moved between systems
1023 .Pq even those of different endianness
1024 and imported as long as a sufficient number of devices are present.
1026 Before exporting the pool, all datasets within the pool are unmounted.
1027 A pool can not be exported if it has a shared spare that is currently being
1028 used.
1030 For pools to be portable, you must give the
1032 command whole disks, not just slices, so that ZFS can label the disks with
1033 portable EFI labels.
1034 Otherwise, disk drivers on platforms of different endianness will not recognize
1035 the disks.
1036 .Bl -tag -width Ds
1037 .It Fl f
1038 Forcefully unmount all datasets, using the
1039 .Nm unmount Fl f
1040 command.
1042 This command will forcefully export the pool even if it has a shared spare that
1043 is currently being used.
1044 This may lead to potential data corruption.
1046 .It Xo
1048 .Cm get
1049 .Op Fl Hp
1050 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1051 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1052 .Ar pool Ns ...
1054 Retrieves the given list of properties
1056 or all properties if
1057 .Sy all
1058 is used
1060 for the specified storage pool(s).
1061 These properties are displayed with the following fields:
1062 .Bd -literal
1063         name          Name of storage pool
1064         property      Property name
1065         value         Property value
1066         source        Property source, either 'default' or 'local'.
1069 See the
1070 .Sx Properties
1071 section for more information on the available pool properties.
1072 .Bl -tag -width Ds
1073 .It Fl H
1074 Scripted mode.
1075 Do not display headers, and separate fields by a single tab instead of arbitrary
1076 space.
1077 .It Fl o Ar field
1078 A comma-separated list of columns to display.
1079 .Sy name Ns , Ns Sy property Ns , Ns Sy value Ns , Ns Sy source
1080 is the default value.
1081 .It Fl p
1082 Display numbers in parsable (exact) values.
1084 .It Xo
1086 .Cm history
1087 .Op Fl il
1088 .Oo Ar pool Oc Ns ...
1090 Displays the command history of the specified pool(s) or all pools if no pool is
1091 specified.
1092 .Bl -tag -width Ds
1093 .It Fl i
1094 Displays internally logged ZFS events in addition to user initiated events.
1095 .It Fl l
1096 Displays log records in long format, which in addition to standard format
1097 includes, the user name, the hostname, and the zone in which the operation was
1098 performed.
1100 .It Xo
1102 .Cm import
1103 .Op Fl D
1104 .Op Fl d Ar dir
1106 Lists pools available to import.
1107 If the
1108 .Fl d
1109 option is not specified, this command searches for devices in
1110 .Pa /dev/dsk .
1112 .Fl d
1113 option can be specified multiple times, and all directories are searched.
1114 If the device appears to be part of an exported pool, this command displays a
1115 summary of the pool with the name of the pool, a numeric identifier, as well as
1116 the vdev layout and current health of the device for each device or file.
1117 Destroyed pools, pools that were previously destroyed with the
1118 .Nm zpool Cm destroy
1119 command, are not listed unless the
1120 .Fl D
1121 option is specified.
1123 The numeric identifier is unique, and can be used instead of the pool name when
1124 multiple exported pools of the same name are available.
1125 .Bl -tag -width Ds
1126 .It Fl c Ar cachefile
1127 Reads configuration from the given
1128 .Ar cachefile
1129 that was created with the
1130 .Sy cachefile
1131 pool property.
1132 This
1133 .Ar cachefile
1134 is used instead of searching for devices.
1135 .It Fl d Ar dir
1136 Searches for devices or files in
1137 .Ar dir .
1139 .Fl d
1140 option can be specified multiple times.
1141 .It Fl D
1142 Lists destroyed pools only.
1144 .It Xo
1146 .Cm import
1147 .Fl a
1148 .Op Fl DfmN
1149 .Op Fl F Op Fl n
1150 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1151 .Op Fl o Ar mntopts
1152 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1153 .Op Fl R Ar root
1155 Imports all pools found in the search directories.
1156 Identical to the previous command, except that all pools with a sufficient
1157 number of devices available are imported.
1158 Destroyed pools, pools that were previously destroyed with the
1159 .Nm zpool Cm destroy
1160 command, will not be imported unless the
1161 .Fl D
1162 option is specified.
1163 .Bl -tag -width Ds
1164 .It Fl a
1165 Searches for and imports all pools found.
1166 .It Fl c Ar cachefile
1167 Reads configuration from the given
1168 .Ar cachefile
1169 that was created with the
1170 .Sy cachefile
1171 pool property.
1172 This
1173 .Ar cachefile
1174 is used instead of searching for devices.
1175 .It Fl d Ar dir
1176 Searches for devices or files in
1177 .Ar dir .
1179 .Fl d
1180 option can be specified multiple times.
1181 This option is incompatible with the
1182 .Fl c
1183 option.
1184 .It Fl D
1185 Imports destroyed pools only.
1187 .Fl f
1188 option is also required.
1189 .It Fl f
1190 Forces import, even if the pool appears to be potentially active.
1191 .It Fl F
1192 Recovery mode for a non-importable pool.
1193 Attempt to return the pool to an importable state by discarding the last few
1194 transactions.
1195 Not all damaged pools can be recovered by using this option.
1196 If successful, the data from the discarded transactions is irretrievably lost.
1197 This option is ignored if the pool is importable or already imported.
1198 .It Fl m
1199 Allows a pool to import when there is a missing log device.
1200 Recent transactions can be lost because the log device will be discarded.
1201 .It Fl n
1202 Used with the
1203 .Fl F
1204 recovery option.
1205 Determines whether a non-importable pool can be made importable again, but does
1206 not actually perform the pool recovery.
1207 For more details about pool recovery mode, see the
1208 .Fl F
1209 option, above.
1210 .It Fl N
1211 Import the pool without mounting any file systems.
1212 .It Fl o Ar mntopts
1213 Comma-separated list of mount options to use when mounting datasets within the
1214 pool.
1216 .Xr zfs 8
1217 for a description of dataset properties and mount options.
1218 .It Fl o Ar property Ns = Ns Ar value
1219 Sets the specified property on the imported pool.
1220 See the
1221 .Sx Properties
1222 section for more information on the available pool properties.
1223 .It Fl R Ar root
1224 Sets the
1225 .Sy cachefile
1226 property to
1227 .Sy none
1228 and the
1229 .Sy altroot
1230 property to
1231 .Ar root .
1233 .It Xo
1235 .Cm import
1236 .Op Fl Dfm
1237 .Op Fl F Op Fl n
1238 .Op Fl -rewind-to-checkpoint
1239 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1240 .Op Fl o Ar mntopts
1241 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1242 .Op Fl R Ar root
1243 .Ar pool Ns | Ns Ar id
1244 .Op Ar newpool
1246 Imports a specific pool.
1247 A pool can be identified by its name or the numeric identifier.
1249 .Ar newpool
1250 is specified, the pool is imported using the name
1251 .Ar newpool .
1252 Otherwise, it is imported with the same name as its exported name.
1254 If a device is removed from a system without running
1255 .Nm zpool Cm export
1256 first, the device appears as potentially active.
1257 It cannot be determined if this was a failed export, or whether the device is
1258 really in use from another host.
1259 To import a pool in this state, the
1260 .Fl f
1261 option is required.
1262 .Bl -tag -width Ds
1263 .It Fl c Ar cachefile
1264 Reads configuration from the given
1265 .Ar cachefile
1266 that was created with the
1267 .Sy cachefile
1268 pool property.
1269 This
1270 .Ar cachefile
1271 is used instead of searching for devices.
1272 .It Fl d Ar dir
1273 Searches for devices or files in
1274 .Ar dir .
1276 .Fl d
1277 option can be specified multiple times.
1278 This option is incompatible with the
1279 .Fl c
1280 option.
1281 .It Fl D
1282 Imports destroyed pool.
1284 .Fl f
1285 option is also required.
1286 .It Fl f
1287 Forces import, even if the pool appears to be potentially active.
1288 .It Fl F
1289 Recovery mode for a non-importable pool.
1290 Attempt to return the pool to an importable state by discarding the last few
1291 transactions.
1292 Not all damaged pools can be recovered by using this option.
1293 If successful, the data from the discarded transactions is irretrievably lost.
1294 This option is ignored if the pool is importable or already imported.
1295 .It Fl m
1296 Allows a pool to import when there is a missing log device.
1297 Recent transactions can be lost because the log device will be discarded.
1298 .It Fl n
1299 Used with the
1300 .Fl F
1301 recovery option.
1302 Determines whether a non-importable pool can be made importable again, but does
1303 not actually perform the pool recovery.
1304 For more details about pool recovery mode, see the
1305 .Fl F
1306 option, above.
1307 .It Fl o Ar mntopts
1308 Comma-separated list of mount options to use when mounting datasets within the
1309 pool.
1311 .Xr zfs 8
1312 for a description of dataset properties and mount options.
1313 .It Fl o Ar property Ns = Ns Ar value
1314 Sets the specified property on the imported pool.
1315 See the
1316 .Sx Properties
1317 section for more information on the available pool properties.
1318 .It Fl R Ar root
1319 Sets the
1320 .Sy cachefile
1321 property to
1322 .Sy none
1323 and the
1324 .Sy altroot
1325 property to
1326 .Ar root .
1327 .It Fl -rewind-to-checkpoint
1328 Rewinds pool to the checkpointed state.
1329 Once the pool is imported with this flag there is no way to undo the rewind.
1330 All changes and data that were written after the checkpoint are lost!
1331 The only exception is when the
1332 .Sy readonly
1333 mounting option is enabled.
1334 In this case, the checkpointed state of the pool is opened and an
1335 administrator can see how the pool would look like if they were
1336 to fully rewind.
1338 .It Xo
1340 .Cm initialize
1341 .Op Fl cs
1342 .Ar pool
1343 .Op Ar device Ns ...
1345 Begins initializing by writing to all unallocated regions on the specified
1346 devices, or all eligible devices in the pool if no individual devices are
1347 specified.
1348 Only leaf data or log devices may be initialized.
1349 .Bl -tag -width Ds
1350 .It Fl c, -cancel
1351 Cancel initializing on the specified devices, or all eligible devices if none
1352 are specified.
1353 If one or more target devices are invalid or are not currently being
1354 initialized, the command will fail and no cancellation will occur on any device.
1355 .It Fl s -suspend
1356 Suspend initializing on the specified devices, or all eligible devices if none
1357 are specified.
1358 If one or more target devices are invalid or are not currently being
1359 initialized, the command will fail and no suspension will occur on any device.
1360 Initializing can then be resumed by running
1361 .Nm zpool Cm initialize
1362 with no flags on the relevant target devices.
1364 .It Xo
1366 .Cm iostat
1367 .Op Fl v
1368 .Op Fl T Sy u Ns | Ns Sy d
1369 .Oo Ar pool Oc Ns ...
1370 .Op Ar interval Op Ar count
1372 Displays I/O statistics for the given pools.
1373 When given an
1374 .Ar interval ,
1375 the statistics are printed every
1376 .Ar interval
1377 seconds until ^C is pressed.
1378 If no
1379 .Ar pool Ns s
1380 are specified, statistics for every pool in the system is shown.
1382 .Ar count
1383 is specified, the command exits after
1384 .Ar count
1385 reports are printed.
1386 .Bl -tag -width Ds
1387 .It Fl T Sy u Ns | Ns Sy d
1388 Display a time stamp.
1389 Specify
1390 .Sy u
1391 for a printed representation of the internal representation of time.
1393 .Xr time 2 .
1394 Specify
1395 .Sy d
1396 for standard date format.
1398 .Xr date 1 .
1399 .It Fl v
1400 Verbose statistics Reports usage statistics for individual vdevs within the
1401 pool, in addition to the pool-wide statistics.
1403 .It Xo
1405 .Cm labelclear
1406 .Op Fl f
1407 .Ar device
1409 Removes ZFS label information from the specified
1410 .Ar device .
1412 .Ar device
1413 must not be part of an active pool configuration.
1414 .Bl -tag -width Ds
1415 .It Fl f
1416 Treat exported or foreign devices as inactive.
1418 .It Xo
1420 .Cm list
1421 .Op Fl Hpv
1422 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1423 .Op Fl T Sy u Ns | Ns Sy d
1424 .Oo Ar pool Oc Ns ...
1425 .Op Ar interval Op Ar count
1427 Lists the given pools along with a health status and space usage.
1428 If no
1429 .Ar pool Ns s
1430 are specified, all pools in the system are listed.
1431 When given an
1432 .Ar interval ,
1433 the information is printed every
1434 .Ar interval
1435 seconds until ^C is pressed.
1437 .Ar count
1438 is specified, the command exits after
1439 .Ar count
1440 reports are printed.
1441 .Bl -tag -width Ds
1442 .It Fl H
1443 Scripted mode.
1444 Do not display headers, and separate fields by a single tab instead of arbitrary
1445 space.
1446 .It Fl o Ar property
1447 Comma-separated list of properties to display.
1448 See the
1449 .Sx Properties
1450 section for a list of valid properties.
1451 The default list is
1452 .Cm name , size , allocated , free , expandsize , fragmentation , capacity ,
1453 .Cm dedupratio , health , altroot .
1454 .It Fl p
1455 Display numbers in parsable
1456 .Pq exact
1457 values.
1458 .It Fl T Sy u Ns | Ns Sy d
1459 Display a time stamp.
1460 Specify
1461 .Fl u
1462 for a printed representation of the internal representation of time.
1464 .Xr time 2 .
1465 Specify
1466 .Fl d
1467 for standard date format.
1469 .Xr date 1 .
1470 .It Fl v
1471 Verbose statistics.
1472 Reports usage statistics for individual vdevs within the pool, in addition to
1473 the pool-wise statistics.
1475 .It Xo
1477 .Cm offline
1478 .Op Fl t
1479 .Ar pool Ar device Ns ...
1481 Takes the specified physical device offline.
1482 While the
1483 .Ar device
1484 is offline, no attempt is made to read or write to the device.
1485 This command is not applicable to spares.
1486 .Bl -tag -width Ds
1487 .It Fl t
1488 Temporary.
1489 Upon reboot, the specified physical device reverts to its previous state.
1491 .It Xo
1493 .Cm online
1494 .Op Fl e
1495 .Ar pool Ar device Ns ...
1497 Brings the specified physical device online.
1498 This command is not applicable to spares.
1499 .Bl -tag -width Ds
1500 .It Fl e
1501 Expand the device to use all available space.
1502 If the device is part of a mirror or raidz then all devices must be expanded
1503 before the new space will become available to the pool.
1505 .It Xo
1507 .Cm reguid
1508 .Ar pool
1510 Generates a new unique identifier for the pool.
1511 You must ensure that all devices in this pool are online and healthy before
1512 performing this action.
1513 .It Xo
1515 .Cm reopen
1516 .Ar pool
1518 Reopen all the vdevs associated with the pool.
1519 .It Xo
1521 .Cm remove
1522 .Op Fl np
1523 .Ar pool Ar device Ns ...
1525 Removes the specified device from the pool.
1526 This command currently only supports removing hot spares, cache, log
1527 devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
1529 Removing a top-level vdev reduces the total amount of space in the storage pool.
1530 The specified device will be evacuated by copying all allocated space from it to
1531 the other devices in the pool.
1532 In this case, the
1533 .Nm zpool Cm remove
1534 command initiates the removal and returns, while the evacuation continues in
1535 the background.
1536 The removal progress can be monitored with
1537 .Nm zpool Cm status.
1538 This feature must be enabled to be used, see
1539 .Xr zpool-features 5
1541 A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
1542 same.
1543 Non-log devices or data devices that are part of a mirrored configuration can be removed using
1545 .Nm zpool Cm detach
1546 command.
1547 .Bl -tag -width Ds
1548 .It Fl n
1549 Do not actually perform the removal ("no-op").
1550 Instead, print the estimated amount of memory that will be used by the
1551 mapping table after the removal completes.
1552 This is nonzero only for top-level vdevs.
1554 .Bl -tag -width Ds
1555 .It Fl p
1556 Used in conjunction with the
1557 .Fl n
1558 flag, displays numbers as parsable (exact) values.
1560 .It Xo
1562 .Cm remove
1563 .Fl s
1564 .Ar pool
1566 Stops and cancels an in-progress removal of a top-level vdev.
1567 .It Xo
1569 .Cm replace
1570 .Op Fl f
1571 .Ar pool Ar device Op Ar new_device
1573 Replaces
1574 .Ar old_device
1575 with
1576 .Ar new_device .
1577 This is equivalent to attaching
1578 .Ar new_device ,
1579 waiting for it to resilver, and then detaching
1580 .Ar old_device .
1582 The size of
1583 .Ar new_device
1584 must be greater than or equal to the minimum size of all the devices in a mirror
1585 or raidz configuration.
1587 .Ar new_device
1588 is required if the pool is not redundant.
1590 .Ar new_device
1591 is not specified, it defaults to
1592 .Ar old_device .
1593 This form of replacement is useful after an existing disk has failed and has
1594 been physically replaced.
1595 In this case, the new disk may have the same
1596 .Pa /dev/dsk
1597 path as the old device, even though it is actually a different disk.
1598 ZFS recognizes this.
1599 .Bl -tag -width Ds
1600 .It Fl f
1601 Forces use of
1602 .Ar new_device ,
1603 even if its appears to be in use.
1604 Not all devices can be overridden in this manner.
1606 .It Xo
1608 .Cm scrub
1609 .Op Fl s | Fl p
1610 .Ar pool Ns ...
1612 Begins a scrub or resumes a paused scrub.
1613 The scrub examines all data in the specified pools to verify that it checksums
1614 correctly.
1615 For replicated
1616 .Pq mirror or raidz
1617 devices, ZFS automatically repairs any damage discovered during the scrub.
1619 .Nm zpool Cm status
1620 command reports the progress of the scrub and summarizes the results of the
1621 scrub upon completion.
1623 Scrubbing and resilvering are very similar operations.
1624 The difference is that resilvering only examines data that ZFS knows to be out
1625 of date
1627 for example, when attaching a new device to a mirror or replacing an existing
1628 device
1629 .Pc ,
1630 whereas scrubbing examines all data to discover silent errors due to hardware
1631 faults or disk failure.
1633 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1634 one at a time.
1635 If a scrub is paused, the
1636 .Nm zpool Cm scrub
1637 resumes it.
1638 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1639 resilver completes.
1640 .Bl -tag -width Ds
1641 .It Fl s
1642 Stop scrubbing.
1644 .Bl -tag -width Ds
1645 .It Fl p
1646 Pause scrubbing.
1647 Scrub pause state and progress are periodically synced to disk.
1648 If the system is restarted or pool is exported during a paused scrub,
1649 even after import, scrub will remain paused until it is resumed.
1650 Once resumed the scrub will pick up from the place where it was last
1651 checkpointed to disk.
1652 To resume a paused scrub issue
1653 .Nm zpool Cm scrub
1654 again.
1656 .It Xo
1658 .Cm set
1659 .Ar property Ns = Ns Ar value
1660 .Ar pool
1662 Sets the given property on the specified pool.
1663 See the
1664 .Sx Properties
1665 section for more information on what properties can be set and acceptable
1666 values.
1667 .It Xo
1669 .Cm split
1670 .Op Fl n
1671 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1672 .Op Fl R Ar root
1673 .Ar pool newpool
1675 Splits devices off
1676 .Ar pool
1677 creating
1678 .Ar newpool .
1679 All vdevs in
1680 .Ar pool
1681 must be mirrors.
1682 At the time of the split,
1683 .Ar newpool
1684 will be a replica of
1685 .Ar pool .
1686 .Bl -tag -width Ds
1687 .It Fl n
1688 Do dry run, do not actually perform the split.
1689 Print out the expected configuration of
1690 .Ar newpool .
1691 .It Fl o Ar property Ns = Ns Ar value
1692 Sets the specified property for
1693 .Ar newpool .
1694 See the
1695 .Sx Properties
1696 section for more information on the available pool properties.
1697 .It Fl R Ar root
1699 .Sy altroot
1701 .Ar newpool
1703 .Ar root
1704 and automatically import it.
1706 .It Xo
1708 .Cm status
1709 .Op Fl Dvx
1710 .Op Fl T Sy u Ns | Ns Sy d
1711 .Oo Ar pool Oc Ns ...
1712 .Op Ar interval Op Ar count
1714 Displays the detailed health status for the given pools.
1715 If no
1716 .Ar pool
1717 is specified, then the status of each pool in the system is displayed.
1718 For more information on pool and device health, see the
1719 .Sx Device Failure and Recovery
1720 section.
1722 If a scrub or resilver is in progress, this command reports the percentage done
1723 and the estimated time to completion.
1724 Both of these are only approximate, because the amount of data in the pool and
1725 the other workloads on the system can change.
1726 .Bl -tag -width Ds
1727 .It Fl D
1728 Display a histogram of deduplication statistics, showing the allocated
1729 .Pq physically present on disk
1730 and referenced
1731 .Pq logically referenced in the pool
1732 block counts and sizes by reference count.
1733 .It Fl T Sy u Ns | Ns Sy d
1734 Display a time stamp.
1735 Specify
1736 .Fl u
1737 for a printed representation of the internal representation of time.
1739 .Xr time 2 .
1740 Specify
1741 .Fl d
1742 for standard date format.
1744 .Xr date 1 .
1745 .It Fl v
1746 Displays verbose data error information, printing out a complete list of all
1747 data errors since the last complete pool scrub.
1748 .It Fl x
1749 Only display status for pools that are exhibiting errors or are otherwise
1750 unavailable.
1751 Warnings about pools not using the latest on-disk format will not be included.
1753 .It Xo
1755 .Cm upgrade
1757 Displays pools which do not have all supported features enabled and pools
1758 formatted using a legacy ZFS version number.
1759 These pools can continue to be used, but some features may not be available.
1761 .Nm zpool Cm upgrade Fl a
1762 to enable all features on all pools.
1763 .It Xo
1765 .Cm upgrade
1766 .Fl v
1768 Displays legacy ZFS versions supported by the current software.
1770 .Xr zpool-features 5
1771 for a description of feature flags features supported by the current software.
1772 .It Xo
1774 .Cm upgrade
1775 .Op Fl V Ar version
1776 .Fl a Ns | Ns Ar pool Ns ...
1778 Enables all supported features on the given pool.
1779 Once this is done, the pool will no longer be accessible on systems that do not
1780 support feature flags.
1782 .Xr zpool-features 5
1783 for details on compatibility with systems that support feature flags, but do not
1784 support all features enabled on the pool.
1785 .Bl -tag -width Ds
1786 .It Fl a
1787 Enables all supported features on all pools.
1788 .It Fl V Ar version
1789 Upgrade to the specified legacy version.
1790 If the
1791 .Fl V
1792 flag is specified, no features will be enabled on the pool.
1793 This option can only be used to increase the version number up to the last
1794 supported legacy version number.
1797 .Sh EXIT STATUS
1798 The following exit values are returned:
1799 .Bl -tag -width Ds
1800 .It Sy 0
1801 Successful completion.
1802 .It Sy 1
1803 An error occurred.
1804 .It Sy 2
1805 Invalid command line options were specified.
1807 .Sh EXAMPLES
1808 .Bl -tag -width Ds
1809 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1810 The following command creates a pool with a single raidz root vdev that
1811 consists of six disks.
1812 .Bd -literal
1813 # zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0
1815 .It Sy Example 2 No Creating a Mirrored Storage Pool
1816 The following command creates a pool with two mirrors, where each mirror
1817 contains two disks.
1818 .Bd -literal
1819 # zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0
1821 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Slices
1822 The following command creates an unmirrored pool using two disk slices.
1823 .Bd -literal
1824 # zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4
1826 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
1827 The following command creates an unmirrored pool using files.
1828 While not recommended, a pool based on files can be useful for experimental
1829 purposes.
1830 .Bd -literal
1831 # zpool create tank /path/to/file/a /path/to/file/b
1833 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
1834 The following command adds two mirrored disks to the pool
1835 .Em tank ,
1836 assuming the pool is already made up of two-way mirrors.
1837 The additional space is immediately available to any datasets within the pool.
1838 .Bd -literal
1839 # zpool add tank mirror c1t0d0 c1t1d0
1841 .It Sy Example 6 No Listing Available ZFS Storage Pools
1842 The following command lists all available pools on the system.
1843 In this case, the pool
1844 .Em zion
1845 is faulted due to a missing device.
1846 The results from this command are similar to the following:
1847 .Bd -literal
1848 # zpool list
1849 NAME    SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
1850 rpool  19.9G  8.43G  11.4G    33%         -    42%  1.00x  ONLINE  -
1851 tank   61.5G  20.0G  41.5G    48%         -    32%  1.00x  ONLINE  -
1852 zion       -      -      -      -         -      -      -  FAULTED -
1854 .It Sy Example 7 No Destroying a ZFS Storage Pool
1855 The following command destroys the pool
1856 .Em tank
1857 and any datasets contained within.
1858 .Bd -literal
1859 # zpool destroy -f tank
1861 .It Sy Example 8 No Exporting a ZFS Storage Pool
1862 The following command exports the devices in pool
1863 .Em tank
1864 so that they can be relocated or later imported.
1865 .Bd -literal
1866 # zpool export tank
1868 .It Sy Example 9 No Importing a ZFS Storage Pool
1869 The following command displays available pools, and then imports the pool
1870 .Em tank
1871 for use on the system.
1872 The results from this command are similar to the following:
1873 .Bd -literal
1874 # zpool import
1875   pool: tank
1876     id: 15451357997522795478
1877  state: ONLINE
1878 action: The pool can be imported using its name or numeric identifier.
1879 config:
1881         tank        ONLINE
1882           mirror    ONLINE
1883             c1t2d0  ONLINE
1884             c1t3d0  ONLINE
1886 # zpool import tank
1888 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
1889 The following command upgrades all ZFS Storage pools to the current version of
1890 the software.
1891 .Bd -literal
1892 # zpool upgrade -a
1893 This system is currently running ZFS version 2.
1895 .It Sy Example 11 No Managing Hot Spares
1896 The following command creates a new pool with an available hot spare:
1897 .Bd -literal
1898 # zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0
1901 If one of the disks were to fail, the pool would be reduced to the degraded
1902 state.
1903 The failed device can be replaced using the following command:
1904 .Bd -literal
1905 # zpool replace tank c0t0d0 c0t3d0
1908 Once the data has been resilvered, the spare is automatically removed and is
1909 made available for use should another device fail.
1910 The hot spare can be permanently removed from the pool using the following
1911 command:
1912 .Bd -literal
1913 # zpool remove tank c0t2d0
1915 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
1916 The following command creates a ZFS storage pool consisting of two, two-way
1917 mirrors and mirrored log devices:
1918 .Bd -literal
1919 # zpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
1920   c4d0 c5d0
1922 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
1923 The following command adds two disks for use as cache devices to a ZFS storage
1924 pool:
1925 .Bd -literal
1926 # zpool add pool cache c2d0 c3d0
1929 Once added, the cache devices gradually fill with content from main memory.
1930 Depending on the size of your cache devices, it could take over an hour for
1931 them to fill.
1932 Capacity and reads can be monitored using the
1933 .Cm iostat
1934 option as follows:
1935 .Bd -literal
1936 # zpool iostat -v pool 5
1938 .It Sy Example 14 No Removing a Mirrored top-level (Log or Data) Device
1939 The following commands remove the mirrored log device
1940 .Sy mirror-2
1941 and mirrored top-level data device
1942 .Sy mirror-1 .
1944 Given this configuration:
1945 .Bd -literal
1946   pool: tank
1947  state: ONLINE
1948  scrub: none requested
1949 config:
1951          NAME        STATE     READ WRITE CKSUM
1952          tank        ONLINE       0     0     0
1953            mirror-0  ONLINE       0     0     0
1954              c6t0d0  ONLINE       0     0     0
1955              c6t1d0  ONLINE       0     0     0
1956            mirror-1  ONLINE       0     0     0
1957              c6t2d0  ONLINE       0     0     0
1958              c6t3d0  ONLINE       0     0     0
1959          logs
1960            mirror-2  ONLINE       0     0     0
1961              c4t0d0  ONLINE       0     0     0
1962              c4t1d0  ONLINE       0     0     0
1965 The command to remove the mirrored log
1966 .Sy mirror-2
1968 .Bd -literal
1969 # zpool remove tank mirror-2
1972 The command to remove the mirrored data
1973 .Sy mirror-1
1975 .Bd -literal
1976 # zpool remove tank mirror-1
1978 .It Sy Example 15 No Displaying expanded space on a device
1979 The following command displays the detailed information for the pool
1980 .Em data .
1981 This pool is comprised of a single raidz vdev where one of its devices
1982 increased its capacity by 10GB.
1983 In this example, the pool will not be able to utilize this extra capacity until
1984 all the devices under the raidz vdev have been expanded.
1985 .Bd -literal
1986 # zpool list -v data
1987 NAME         SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
1988 data        23.9G  14.6G  9.30G    48%         -    61%  1.00x  ONLINE  -
1989   raidz1    23.9G  14.6G  9.30G    48%         -
1990     c1t1d0      -      -      -      -         -
1991     c1t2d0      -      -      -      -       10G
1992     c1t3d0      -      -      -      -         -
1995 .Sh INTERFACE STABILITY
1996 .Sy Evolving
1997 .Sh SEE ALSO
1998 .Xr zfs 8 ,
1999 .Xr attributes 5 ,
2000 .Xr zpool-features 5