8899 zpool list property documentation doesn't match actual behaviour
[unleashed.git] / usr / src / man / man1m / zpool.1m
blob510cdd093dcc4b73e3e7a7e96003d63c662222e8
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) 2013 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 1M
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 clear
47 .Ar pool
48 .Op Ar device
49 .Nm
50 .Cm create
51 .Op Fl dfn
52 .Op Fl B
53 .Op Fl m Ar mountpoint
54 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
55 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
56 .Op Fl R Ar root
57 .Ar pool vdev Ns ...
58 .Nm
59 .Cm destroy
60 .Op Fl f
61 .Ar pool
62 .Nm
63 .Cm detach
64 .Ar pool device
65 .Nm
66 .Cm export
67 .Op Fl f
68 .Ar pool Ns ...
69 .Nm
70 .Cm get
71 .Op Fl Hp
72 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
73 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
74 .Ar pool Ns ...
75 .Nm
76 .Cm history
77 .Op Fl il
78 .Oo Ar pool Oc Ns ...
79 .Nm
80 .Cm import
81 .Op Fl D
82 .Op Fl d Ar dir
83 .Nm
84 .Cm import
85 .Fl a
86 .Op Fl DfmN
87 .Op Fl F Op Fl n
88 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
89 .Op Fl o Ar mntopts
90 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
91 .Op Fl R Ar root
92 .Nm
93 .Cm import
94 .Op Fl Dfm
95 .Op Fl F Op Fl n
96 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
97 .Op Fl o Ar mntopts
98 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
99 .Op Fl R Ar root
100 .Ar pool Ns | Ns Ar id
101 .Op Ar newpool
103 .Cm iostat
104 .Op Fl v
105 .Op Fl T Sy u Ns | Ns Sy d
106 .Oo Ar pool Oc Ns ...
107 .Op Ar interval Op Ar count
109 .Cm labelclear
110 .Op Fl f
111 .Ar device
113 .Cm list
114 .Op Fl Hpv
115 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
116 .Op Fl T Sy u Ns | Ns Sy d
117 .Oo Ar pool Oc Ns ...
118 .Op Ar interval Op Ar count
120 .Cm offline
121 .Op Fl t
122 .Ar pool Ar device Ns ...
124 .Cm online
125 .Op Fl e
126 .Ar pool Ar device Ns ...
128 .Cm reguid
129 .Ar pool
131 .Cm reopen
132 .Ar pool
134 .Cm remove
135 .Ar pool Ar device Ns ...
137 .Cm replace
138 .Op Fl f
139 .Ar pool Ar device Op Ar new_device
141 .Cm scrub
142 .Op Fl s | Fl p
143 .Ar pool Ns ...
145 .Cm set
146 .Ar property Ns = Ns Ar value
147 .Ar pool
149 .Cm split
150 .Op Fl n
151 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
152 .Op Fl R Ar root
153 .Ar pool newpool
155 .Cm status
156 .Op Fl Dvx
157 .Op Fl T Sy u Ns | Ns Sy d
158 .Oo Ar pool Oc Ns ...
159 .Op Ar interval Op Ar count
161 .Cm upgrade
163 .Cm upgrade
164 .Fl v
166 .Cm upgrade
167 .Op Fl V Ar version
168 .Fl a Ns | Ns Ar pool Ns ...
169 .Sh DESCRIPTION
172 command configures ZFS storage pools.
173 A storage pool is a collection of devices that provides physical storage and
174 data replication for ZFS datasets.
175 All datasets within a storage pool share the same space.
177 .Xr zfs 1M
178 for information on managing datasets.
179 .Ss Virtual Devices (vdevs)
180 A "virtual device" describes a single device or a collection of devices
181 organized according to certain performance and fault characteristics.
182 The following virtual devices are supported:
183 .Bl -tag -width Ds
184 .It Sy disk
185 A block device, typically located under
186 .Pa /dev/dsk .
187 ZFS can use individual slices or partitions, though the recommended mode of
188 operation is to use whole disks.
189 A disk can be specified by a full path, or it can be a shorthand name
190 .Po the relative portion of the path under
191 .Pa /dev/dsk
192 .Pc .
193 A whole disk can be specified by omitting the slice or partition designation.
194 For example,
195 .Pa c0t0d0
196 is equivalent to
197 .Pa /dev/dsk/c0t0d0s2 .
198 When given a whole disk, ZFS automatically labels the disk, if necessary.
199 .It Sy file
200 A regular file.
201 The use of files as a backing store is strongly discouraged.
202 It is designed primarily for experimental purposes, as the fault tolerance of a
203 file is only as good as the file system of which it is a part.
204 A file must be specified by a full path.
205 .It Sy mirror
206 A mirror of two or more devices.
207 Data is replicated in an identical fashion across all components of a mirror.
208 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
209 failing before data integrity is compromised.
210 .It Sy raidz , raidz1 , raidz2 , raidz3
211 A variation on RAID-5 that allows for better distribution of parity and
212 eliminates the RAID-5
213 .Qq write hole
214 .Pq in which data and parity become inconsistent after a power loss .
215 Data and parity is striped across all disks within a raidz group.
217 A raidz group can have single-, double-, or triple-parity, meaning that the
218 raidz group can sustain one, two, or three failures, respectively, without
219 losing any data.
221 .Sy raidz1
222 vdev type specifies a single-parity raidz group; the
223 .Sy raidz2
224 vdev type specifies a double-parity raidz group; and the
225 .Sy raidz3
226 vdev type specifies a triple-parity raidz group.
228 .Sy raidz
229 vdev type is an alias for
230 .Sy raidz1 .
232 A raidz group with N disks of size X with P parity disks can hold approximately
233 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
234 compromised.
235 The minimum number of devices in a raidz group is one more than the number of
236 parity disks.
237 The recommended number is between 3 and 9 to help increase performance.
238 .It Sy spare
239 A special pseudo-vdev which keeps track of available hot spares for a pool.
240 For more information, see the
241 .Sx Hot Spares
242 section.
243 .It Sy log
244 A separate intent log device.
245 If more than one log device is specified, then writes are load-balanced between
246 devices.
247 Log devices can be mirrored.
248 However, raidz vdev types are not supported for the intent log.
249 For more information, see the
250 .Sx Intent Log
251 section.
252 .It Sy cache
253 A device used to cache storage pool data.
254 A cache device cannot be configured as a mirror or raidz group.
255 For more information, see the
256 .Sx Cache Devices
257 section.
260 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
261 contain files or disks.
262 Mirrors of mirrors
263 .Pq or other combinations
264 are not allowed.
266 A pool can have any number of virtual devices at the top of the configuration
267 .Po known as
268 .Qq root vdevs
269 .Pc .
270 Data is dynamically distributed across all top-level devices to balance data
271 among devices.
272 As new virtual devices are added, ZFS automatically places data on the newly
273 available devices.
275 Virtual devices are specified one at a time on the command line, separated by
276 whitespace.
277 The keywords
278 .Sy mirror
280 .Sy raidz
281 are used to distinguish where a group ends and another begins.
282 For example, the following creates two root vdevs, each a mirror of two disks:
283 .Bd -literal
284 # zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0
286 .Ss Device Failure and Recovery
287 ZFS supports a rich set of mechanisms for handling device failure and data
288 corruption.
289 All metadata and data is checksummed, and ZFS automatically repairs bad data
290 from a good copy when corruption is detected.
292 In order to take advantage of these features, a pool must make use of some form
293 of redundancy, using either mirrored or raidz groups.
294 While ZFS supports running in a non-redundant configuration, where each root
295 vdev is simply a disk or file, this is strongly discouraged.
296 A single case of bit corruption can render some or all of your data unavailable.
298 A pool's health status is described by one of three states: online, degraded,
299 or faulted.
300 An online pool has all devices operating normally.
301 A degraded pool is one in which one or more devices have failed, but the data is
302 still available due to a redundant configuration.
303 A faulted pool has corrupted metadata, or one or more faulted devices, and
304 insufficient replicas to continue functioning.
306 The health of the top-level vdev, such as mirror or raidz device, is
307 potentially impacted by the state of its associated vdevs, or component
308 devices.
309 A top-level vdev or component device is in one of the following states:
310 .Bl -tag -width "DEGRADED"
311 .It Sy DEGRADED
312 One or more top-level vdevs is in the degraded state because one or more
313 component devices are offline.
314 Sufficient replicas exist to continue functioning.
316 One or more component devices is in the degraded or faulted state, but
317 sufficient replicas exist to continue functioning.
318 The underlying conditions are as follows:
319 .Bl -bullet
321 The number of checksum errors exceeds acceptable levels and the device is
322 degraded as an indication that something may be wrong.
323 ZFS continues to use the device as necessary.
325 The number of I/O errors exceeds acceptable levels.
326 The device could not be marked as faulted because there are insufficient
327 replicas to continue functioning.
329 .It Sy FAULTED
330 One or more top-level vdevs is in the faulted state because one or more
331 component devices are offline.
332 Insufficient replicas exist to continue functioning.
334 One or more component devices is in the faulted state, and insufficient
335 replicas exist to continue functioning.
336 The underlying conditions are as follows:
337 .Bl -bullet
339 The device could be opened, but the contents did not match expected values.
341 The number of I/O errors exceeds acceptable levels and the device is faulted to
342 prevent further use of the device.
344 .It Sy OFFLINE
345 The device was explicitly taken offline by the
346 .Nm zpool Cm offline
347 command.
348 .It Sy ONLINE
349 The device is online and functioning.
350 .It Sy REMOVED
351 The device was physically removed while the system was running.
352 Device removal detection is hardware-dependent and may not be supported on all
353 platforms.
354 .It Sy UNAVAIL
355 The device could not be opened.
356 If a pool is imported when a device was unavailable, then the device will be
357 identified by a unique identifier instead of its path since the path was never
358 correct in the first place.
361 If a device is removed and later re-attached to the system, ZFS attempts
362 to put the device online automatically.
363 Device attach detection is hardware-dependent and might not be supported on all
364 platforms.
365 .Ss Hot Spares
366 ZFS allows devices to be associated with pools as
367 .Qq hot spares .
368 These devices are not actively used in the pool, but when an active device
369 fails, it is automatically replaced by a hot spare.
370 To create a pool with hot spares, specify a
371 .Sy spare
372 vdev with any number of devices.
373 For example,
374 .Bd -literal
375 # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
378 Spares can be shared across multiple pools, and can be added with the
379 .Nm zpool Cm add
380 command and removed with the
381 .Nm zpool Cm remove
382 command.
383 Once a spare replacement is initiated, a new
384 .Sy spare
385 vdev is created within the configuration that will remain there until the
386 original device is replaced.
387 At this point, the hot spare becomes available again if another device fails.
389 If a pool has a shared spare that is currently being used, the pool can not be
390 exported since other pools may use this shared spare, which may lead to
391 potential data corruption.
393 An in-progress spare replacement can be cancelled by detaching the hot spare.
394 If the original faulted device is detached, then the hot spare assumes its
395 place in the configuration, and is removed from the spare list of all active
396 pools.
398 Spares cannot replace log devices.
399 .Ss Intent Log
400 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
401 transactions.
402 For instance, databases often require their transactions to be on stable storage
403 devices when returning from a system call.
404 NFS and other applications can also use
405 .Xr fsync 3C
406 to ensure data stability.
407 By default, the intent log is allocated from blocks within the main pool.
408 However, it might be possible to get better performance using separate intent
409 log devices such as NVRAM or a dedicated disk.
410 For example:
411 .Bd -literal
412 # zpool create pool c0d0 c1d0 log c2d0
415 Multiple log devices can also be specified, and they can be mirrored.
416 See the
417 .Sx EXAMPLES
418 section for an example of mirroring multiple log devices.
420 Log devices can be added, replaced, attached, detached, and imported and
421 exported as part of the larger pool.
422 Mirrored log devices can be removed by specifying the top-level mirror for the
423 log.
424 .Ss Cache Devices
425 Devices can be added to a storage pool as
426 .Qq cache devices .
427 These devices provide an additional layer of caching between main memory and
428 disk.
429 For read-heavy workloads, where the working set size is much larger than what
430 can be cached in main memory, using cache devices allow much more of this
431 working set to be served from low latency media.
432 Using cache devices provides the greatest performance improvement for random
433 read-workloads of mostly static content.
435 To create a pool with cache devices, specify a
436 .Sy cache
437 vdev with any number of devices.
438 For example:
439 .Bd -literal
440 # zpool create pool c0d0 c1d0 cache c2d0 c3d0
443 Cache devices cannot be mirrored or part of a raidz configuration.
444 If a read error is encountered on a cache device, that read I/O is reissued to
445 the original storage pool device, which might be part of a mirrored or raidz
446 configuration.
448 The content of the cache devices is considered volatile, as is the case with
449 other system caches.
450 .Ss Properties
451 Each pool has several properties associated with it.
452 Some properties are read-only statistics while others are configurable and
453 change the behavior of the pool.
455 The following are read-only properties:
456 .Bl -tag -width Ds
457 .It Cm allocated
458 Amount of storage space used within the pool.
459 .It Sy bootsize
460 The size of the system boot partition.
461 This property can only be set at pool creation time and is read-only once pool
462 is created.
463 Setting this property implies using the
464 .Fl B
465 option.
466 .It Sy capacity
467 Percentage of pool space used.
468 This property can also be referred to by its shortened column name,
469 .Sy cap .
470 .It Sy expandsize
471 Amount of uninitialized space within the pool or device that can be used to
472 increase the total capacity of the pool.
473 Uninitialized space consists of any space on an EFI labeled vdev which has not
474 been brought online
475 .Po e.g, using
476 .Nm zpool Cm online Fl e
477 .Pc .
478 This space occurs when a LUN is dynamically expanded.
479 .It Sy fragmentation
480 The amount of fragmentation in the pool.
481 .It Sy free
482 The amount of free space available in the pool.
483 .It Sy freeing
484 After a file system or snapshot is destroyed, the space it was using is
485 returned to the pool asynchronously.
486 .Sy freeing
487 is the amount of space remaining to be reclaimed.
488 Over time
489 .Sy freeing
490 will decrease while
491 .Sy free
492 increases.
493 .It Sy health
494 The current health of the pool.
495 Health can be one of
496 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
497 .It Sy guid
498 A unique identifier for the pool.
499 .It Sy size
500 Total size of the storage pool.
501 .It Sy unsupported@ Ns Em feature_guid
502 Information about unsupported features that are enabled on the pool.
504 .Xr zpool-features 5
505 for details.
508 The space usage properties report actual physical space available to the
509 storage pool.
510 The physical space can be different from the total amount of space that any
511 contained datasets can actually use.
512 The amount of space used in a raidz configuration depends on the characteristics
513 of the data being written.
514 In addition, ZFS reserves some space for internal accounting that the
515 .Xr zfs 1M
516 command takes into account, but the
518 command does not.
519 For non-full pools of a reasonable size, these effects should be invisible.
520 For small pools, or pools that are close to being completely full, these
521 discrepancies may become more noticeable.
523 The following property can be set at creation time and import time:
524 .Bl -tag -width Ds
525 .It Sy altroot
526 Alternate root directory.
527 If set, this directory is prepended to any mount points within the pool.
528 This can be used when examining an unknown pool where the mount points cannot be
529 trusted, or in an alternate boot environment, where the typical paths are not
530 valid.
531 .Sy altroot
532 is not a persistent property.
533 It is valid only while the system is up.
534 Setting
535 .Sy altroot
536 defaults to using
537 .Sy cachefile Ns = Ns Sy none ,
538 though this may be overridden using an explicit setting.
541 The following property can be set only at import time:
542 .Bl -tag -width Ds
543 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
544 If set to
545 .Sy on ,
546 the pool will be imported in read-only mode.
547 This property can also be referred to by its shortened column name,
548 .Sy rdonly .
551 The following properties can be set at creation time and import time, and later
552 changed with the
553 .Nm zpool Cm set
554 command:
555 .Bl -tag -width Ds
556 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
557 Controls automatic pool expansion when the underlying LUN is grown.
558 If set to
559 .Sy on ,
560 the pool will be resized according to the size of the expanded device.
561 If the device is part of a mirror or raidz then all devices within that
562 mirror/raidz group must be expanded before the new space is made available to
563 the pool.
564 The default behavior is
565 .Sy off .
566 This property can also be referred to by its shortened column name,
567 .Sy expand .
568 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
569 Controls automatic device replacement.
570 If set to
571 .Sy off ,
572 device replacement must be initiated by the administrator by using the
573 .Nm zpool Cm replace
574 command.
575 If set to
576 .Sy on ,
577 any new device, found in the same physical location as a device that previously
578 belonged to the pool, is automatically formatted and replaced.
579 The default behavior is
580 .Sy off .
581 This property can also be referred to by its shortened column name,
582 .Sy replace .
583 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
584 Identifies the default bootable dataset for the root pool.
585 This property is expected to be set mainly by the installation and upgrade
586 programs.
587 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
588 Controls the location of where the pool configuration is cached.
589 Discovering all pools on system startup requires a cached copy of the
590 configuration data that is stored on the root file system.
591 All pools in this cache are automatically imported when the system boots.
592 Some environments, such as install and clustering, need to cache this
593 information in a different location so that pools are not automatically
594 imported.
595 Setting this property caches the pool configuration in a different location that
596 can later be imported with
597 .Nm zpool Cm import Fl c .
598 Setting it to the special value
599 .Sy none
600 creates a temporary pool that is never cached, and the special value
602 .Pq empty string
603 uses the default location.
605 Multiple pools can share the same cache file.
606 Because the kernel destroys and recreates this file when pools are added and
607 removed, care should be taken when attempting to access this file.
608 When the last pool using a
609 .Sy cachefile
610 is exported or destroyed, the file is removed.
611 .It Sy comment Ns = Ns Ar text
612 A text string consisting of printable ASCII characters that will be stored
613 such that it is available even if the pool becomes faulted.
614 An administrator can provide additional information about a pool using this
615 property.
616 .It Sy dedupditto Ns = Ns Ar number
617 Threshold for the number of block ditto copies.
618 If the reference count for a deduplicated block increases above this number, a
619 new ditto copy of this block is automatically stored.
620 The default setting is
621 .Sy 0
622 which causes no ditto copies to be created for deduplicated blocks.
623 The minimum legal nonzero setting is
624 .Sy 100 .
625 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
626 Controls whether a non-privileged user is granted access based on the dataset
627 permissions defined on the dataset.
629 .Xr zfs 1M
630 for more information on ZFS delegated administration.
631 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
632 Controls the system behavior in the event of catastrophic pool failure.
633 This condition is typically a result of a loss of connectivity to the underlying
634 storage device(s) or a failure of all devices within the pool.
635 The behavior of such an event is determined as follows:
636 .Bl -tag -width "continue"
637 .It Sy wait
638 Blocks all I/O access until the device connectivity is recovered and the errors
639 are cleared.
640 This is the default behavior.
641 .It Sy continue
642 Returns
643 .Er EIO
644 to any new write I/O requests but allows reads to any of the remaining healthy
645 devices.
646 Any write requests that have yet to be committed to disk would be blocked.
647 .It Sy panic
648 Prints out a message to the console and generates a system crash dump.
650 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
651 The value of this property is the current state of
652 .Ar feature_name .
653 The only valid value when setting this property is
654 .Sy enabled
655 which moves
656 .Ar feature_name
657 to the enabled state.
659 .Xr zpool-features 5
660 for details on feature states.
661 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
662 Controls whether information about snapshots associated with this pool is
663 output when
664 .Nm zfs Cm list
665 is run without the
666 .Fl t
667 option.
668 The default value is
669 .Sy off .
670 This property can also be referred to by its shortened name,
671 .Sy listsnaps .
672 .It Sy version Ns = Ns Ar version
673 The current on-disk version of the pool.
674 This can be increased, but never decreased.
675 The preferred method of updating pools is with the
676 .Nm zpool Cm upgrade
677 command, though this property can be used when a specific version is needed for
678 backwards compatibility.
679 Once feature flags are enabled on a pool this property will no longer have a
680 value.
682 .Ss Subcommands
683 All subcommands that modify state are logged persistently to the pool in their
684 original form.
688 command provides subcommands to create and destroy storage pools, add capacity
689 to storage pools, and provide information about the storage pools.
690 The following subcommands are supported:
691 .Bl -tag -width Ds
692 .It Xo
694 .Fl \?
696 Displays a help message.
697 .It Xo
699 .Cm add
700 .Op Fl fn
701 .Ar pool vdev Ns ...
703 Adds the specified virtual devices to the given pool.
705 .Ar vdev
706 specification is described in the
707 .Sx Virtual Devices
708 section.
709 The behavior of the
710 .Fl f
711 option, and the device checks performed are described in the
712 .Nm zpool Cm create
713 subcommand.
714 .Bl -tag -width Ds
715 .It Fl f
716 Forces use of
717 .Ar vdev Ns s ,
718 even if they appear in use or specify a conflicting replication level.
719 Not all devices can be overridden in this manner.
720 .It Fl n
721 Displays the configuration that would be used without actually adding the
722 .Ar vdev Ns s .
723 The actual pool creation can still fail due to insufficient privileges or
724 device sharing.
726 .It Xo
728 .Cm attach
729 .Op Fl f
730 .Ar pool device new_device
732 Attaches
733 .Ar new_device
734 to the existing
735 .Ar device .
736 The existing device cannot be part of a raidz configuration.
738 .Ar device
739 is not currently part of a mirrored configuration,
740 .Ar device
741 automatically transforms into a two-way mirror of
742 .Ar device
744 .Ar new_device .
746 .Ar device
747 is part of a two-way mirror, attaching
748 .Ar new_device
749 creates a three-way mirror, and so on.
750 In either case,
751 .Ar new_device
752 begins to resilver immediately.
753 .Bl -tag -width Ds
754 .It Fl f
755 Forces use of
756 .Ar new_device ,
757 even if its appears to be in use.
758 Not all devices can be overridden in this manner.
760 .It Xo
762 .Cm clear
763 .Ar pool
764 .Op Ar device
766 Clears device errors in a pool.
767 If no arguments are specified, all device errors within the pool are cleared.
768 If one or more devices is specified, only those errors associated with the
769 specified device or devices are cleared.
770 .It Xo
772 .Cm create
773 .Op Fl dfn
774 .Op Fl B
775 .Op Fl m Ar mountpoint
776 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
777 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
778 .Op Fl R Ar root
779 .Ar pool vdev Ns ...
781 Creates a new storage pool containing the virtual devices specified on the
782 command line.
783 The pool name must begin with a letter, and can only contain
784 alphanumeric characters as well as underscore
785 .Pq Qq Sy _ ,
786 dash
787 .Pq Qq Sy - ,
788 and period
789 .Pq Qq Sy \&. .
790 The pool names
791 .Sy mirror ,
792 .Sy raidz ,
793 .Sy spare
795 .Sy log
796 are reserved, as are names beginning with the pattern
797 .Sy c[0-9] .
799 .Ar vdev
800 specification is described in the
801 .Sx Virtual Devices
802 section.
804 The command verifies that each device specified is accessible and not currently
805 in use by another subsystem.
806 There are some uses, such as being currently mounted, or specified as the
807 dedicated dump device, that prevents a device from ever being used by ZFS.
808 Other uses, such as having a preexisting UFS file system, can be overridden with
810 .Fl f
811 option.
813 The command also checks that the replication strategy for the pool is
814 consistent.
815 An attempt to combine redundant and non-redundant storage in a single pool, or
816 to mix disks and files, results in an error unless
817 .Fl f
818 is specified.
819 The use of differently sized devices within a single raidz or mirror group is
820 also flagged as an error unless
821 .Fl f
822 is specified.
824 Unless the
825 .Fl R
826 option is specified, the default mount point is
827 .Pa / Ns Ar pool .
828 The mount point must not exist or must be empty, or else the root dataset
829 cannot be mounted.
830 This can be overridden with the
831 .Fl m
832 option.
834 By default all supported features are enabled on the new pool unless the
835 .Fl d
836 option is specified.
837 .Bl -tag -width Ds
838 .It Fl B
839 Create whole disk pool with EFI System partition to support booting system
840 with UEFI firmware.
841 Default size is 256MB.
842 To create boot partition with custom size, set the
843 .Sy bootsize
844 property with the
845 .Fl o
846 option.
847 See the
848 .Sx Properties
849 section for details.
850 .It Fl d
851 Do not enable any features on the new pool.
852 Individual features can be enabled by setting their corresponding properties to
853 .Sy enabled
854 with the
855 .Fl o
856 option.
858 .Xr zpool-features 5
859 for details about feature properties.
860 .It Fl f
861 Forces use of
862 .Ar vdev Ns s ,
863 even if they appear in use or specify a conflicting replication level.
864 Not all devices can be overridden in this manner.
865 .It Fl m Ar mountpoint
866 Sets the mount point for the root dataset.
867 The default mount point is
868 .Pa /pool
870 .Pa altroot/pool
872 .Ar altroot
873 is specified.
874 The mount point must be an absolute path,
875 .Sy legacy ,
877 .Sy none .
878 For more information on dataset mount points, see
879 .Xr zfs 1M .
880 .It Fl n
881 Displays the configuration that would be used without actually creating the
882 pool.
883 The actual pool creation can still fail due to insufficient privileges or
884 device sharing.
885 .It Fl o Ar property Ns = Ns Ar value
886 Sets the given pool properties.
887 See the
888 .Sx Properties
889 section for a list of valid properties that can be set.
890 .It Fl O Ar file-system-property Ns = Ns Ar value
891 Sets the given file system properties in the root file system of the pool.
892 See the
893 .Sx Properties
894 section of
895 .Xr zfs 1M
896 for a list of valid properties that can be set.
897 .It Fl R Ar root
898 Equivalent to
899 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
901 .It Xo
903 .Cm destroy
904 .Op Fl f
905 .Ar pool
907 Destroys the given pool, freeing up any devices for other use.
908 This command tries to unmount any active datasets before destroying the pool.
909 .Bl -tag -width Ds
910 .It Fl f
911 Forces any active datasets contained within the pool to be unmounted.
913 .It Xo
915 .Cm detach
916 .Ar pool device
918 Detaches
919 .Ar device
920 from a mirror.
921 The operation is refused if there are no other valid replicas of the data.
922 .It Xo
924 .Cm export
925 .Op Fl f
926 .Ar pool Ns ...
928 Exports the given pools from the system.
929 All devices are marked as exported, but are still considered in use by other
930 subsystems.
931 The devices can be moved between systems
932 .Pq even those of different endianness
933 and imported as long as a sufficient number of devices are present.
935 Before exporting the pool, all datasets within the pool are unmounted.
936 A pool can not be exported if it has a shared spare that is currently being
937 used.
939 For pools to be portable, you must give the
941 command whole disks, not just slices, so that ZFS can label the disks with
942 portable EFI labels.
943 Otherwise, disk drivers on platforms of different endianness will not recognize
944 the disks.
945 .Bl -tag -width Ds
946 .It Fl f
947 Forcefully unmount all datasets, using the
948 .Nm unmount Fl f
949 command.
951 This command will forcefully export the pool even if it has a shared spare that
952 is currently being used.
953 This may lead to potential data corruption.
955 .It Xo
957 .Cm get
958 .Op Fl Hp
959 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
960 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
961 .Ar pool Ns ...
963 Retrieves the given list of properties
965 or all properties if
966 .Sy all
967 is used
969 for the specified storage pool(s).
970 These properties are displayed with the following fields:
971 .Bd -literal
972         name          Name of storage pool
973         property      Property name
974         value         Property value
975         source        Property source, either 'default' or 'local'.
978 See the
979 .Sx Properties
980 section for more information on the available pool properties.
981 .Bl -tag -width Ds
982 .It Fl H
983 Scripted mode.
984 Do not display headers, and separate fields by a single tab instead of arbitrary
985 space.
986 .It Fl o Ar field
987 A comma-separated list of columns to display.
988 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
989 is the default value.
990 .It Fl p
991 Display numbers in parsable (exact) values.
993 .It Xo
995 .Cm history
996 .Op Fl il
997 .Oo Ar pool Oc Ns ...
999 Displays the command history of the specified pool(s) or all pools if no pool is
1000 specified.
1001 .Bl -tag -width Ds
1002 .It Fl i
1003 Displays internally logged ZFS events in addition to user initiated events.
1004 .It Fl l
1005 Displays log records in long format, which in addition to standard format
1006 includes, the user name, the hostname, and the zone in which the operation was
1007 performed.
1009 .It Xo
1011 .Cm import
1012 .Op Fl D
1013 .Op Fl d Ar dir
1015 Lists pools available to import.
1016 If the
1017 .Fl d
1018 option is not specified, this command searches for devices in
1019 .Pa /dev/dsk .
1021 .Fl d
1022 option can be specified multiple times, and all directories are searched.
1023 If the device appears to be part of an exported pool, this command displays a
1024 summary of the pool with the name of the pool, a numeric identifier, as well as
1025 the vdev layout and current health of the device for each device or file.
1026 Destroyed pools, pools that were previously destroyed with the
1027 .Nm zpool Cm destroy
1028 command, are not listed unless the
1029 .Fl D
1030 option is specified.
1032 The numeric identifier is unique, and can be used instead of the pool name when
1033 multiple exported pools of the same name are available.
1034 .Bl -tag -width Ds
1035 .It Fl c Ar cachefile
1036 Reads configuration from the given
1037 .Ar cachefile
1038 that was created with the
1039 .Sy cachefile
1040 pool property.
1041 This
1042 .Ar cachefile
1043 is used instead of searching for devices.
1044 .It Fl d Ar dir
1045 Searches for devices or files in
1046 .Ar dir .
1048 .Fl d
1049 option can be specified multiple times.
1050 .It Fl D
1051 Lists destroyed pools only.
1053 .It Xo
1055 .Cm import
1056 .Fl a
1057 .Op Fl DfmN
1058 .Op Fl F Op Fl n
1059 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1060 .Op Fl o Ar mntopts
1061 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1062 .Op Fl R Ar root
1064 Imports all pools found in the search directories.
1065 Identical to the previous command, except that all pools with a sufficient
1066 number of devices available are imported.
1067 Destroyed pools, pools that were previously destroyed with the
1068 .Nm zpool Cm destroy
1069 command, will not be imported unless the
1070 .Fl D
1071 option is specified.
1072 .Bl -tag -width Ds
1073 .It Fl a
1074 Searches for and imports all pools found.
1075 .It Fl c Ar cachefile
1076 Reads configuration from the given
1077 .Ar cachefile
1078 that was created with the
1079 .Sy cachefile
1080 pool property.
1081 This
1082 .Ar cachefile
1083 is used instead of searching for devices.
1084 .It Fl d Ar dir
1085 Searches for devices or files in
1086 .Ar dir .
1088 .Fl d
1089 option can be specified multiple times.
1090 This option is incompatible with the
1091 .Fl c
1092 option.
1093 .It Fl D
1094 Imports destroyed pools only.
1096 .Fl f
1097 option is also required.
1098 .It Fl f
1099 Forces import, even if the pool appears to be potentially active.
1100 .It Fl F
1101 Recovery mode for a non-importable pool.
1102 Attempt to return the pool to an importable state by discarding the last few
1103 transactions.
1104 Not all damaged pools can be recovered by using this option.
1105 If successful, the data from the discarded transactions is irretrievably lost.
1106 This option is ignored if the pool is importable or already imported.
1107 .It Fl m
1108 Allows a pool to import when there is a missing log device.
1109 Recent transactions can be lost because the log device will be discarded.
1110 .It Fl n
1111 Used with the
1112 .Fl F
1113 recovery option.
1114 Determines whether a non-importable pool can be made importable again, but does
1115 not actually perform the pool recovery.
1116 For more details about pool recovery mode, see the
1117 .Fl F
1118 option, above.
1119 .It Fl N
1120 Import the pool without mounting any file systems.
1121 .It Fl o Ar mntopts
1122 Comma-separated list of mount options to use when mounting datasets within the
1123 pool.
1125 .Xr zfs 1M
1126 for a description of dataset properties and mount options.
1127 .It Fl o Ar property Ns = Ns Ar value
1128 Sets the specified property on the imported pool.
1129 See the
1130 .Sx Properties
1131 section for more information on the available pool properties.
1132 .It Fl R Ar root
1133 Sets the
1134 .Sy cachefile
1135 property to
1136 .Sy none
1137 and the
1138 .Sy altroot
1139 property to
1140 .Ar root .
1142 .It Xo
1144 .Cm import
1145 .Op Fl Dfm
1146 .Op Fl F Op Fl n
1147 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1148 .Op Fl o Ar mntopts
1149 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1150 .Op Fl R Ar root
1151 .Ar pool Ns | Ns Ar id
1152 .Op Ar newpool
1154 Imports a specific pool.
1155 A pool can be identified by its name or the numeric identifier.
1157 .Ar newpool
1158 is specified, the pool is imported using the name
1159 .Ar newpool .
1160 Otherwise, it is imported with the same name as its exported name.
1162 If a device is removed from a system without running
1163 .Nm zpool Cm export
1164 first, the device appears as potentially active.
1165 It cannot be determined if this was a failed export, or whether the device is
1166 really in use from another host.
1167 To import a pool in this state, the
1168 .Fl f
1169 option is required.
1170 .Bl -tag -width Ds
1171 .It Fl c Ar cachefile
1172 Reads configuration from the given
1173 .Ar cachefile
1174 that was created with the
1175 .Sy cachefile
1176 pool property.
1177 This
1178 .Ar cachefile
1179 is used instead of searching for devices.
1180 .It Fl d Ar dir
1181 Searches for devices or files in
1182 .Ar dir .
1184 .Fl d
1185 option can be specified multiple times.
1186 This option is incompatible with the
1187 .Fl c
1188 option.
1189 .It Fl D
1190 Imports destroyed pool.
1192 .Fl f
1193 option is also required.
1194 .It Fl f
1195 Forces import, even if the pool appears to be potentially active.
1196 .It Fl F
1197 Recovery mode for a non-importable pool.
1198 Attempt to return the pool to an importable state by discarding the last few
1199 transactions.
1200 Not all damaged pools can be recovered by using this option.
1201 If successful, the data from the discarded transactions is irretrievably lost.
1202 This option is ignored if the pool is importable or already imported.
1203 .It Fl m
1204 Allows a pool to import when there is a missing log device.
1205 Recent transactions can be lost because the log device will be discarded.
1206 .It Fl n
1207 Used with the
1208 .Fl F
1209 recovery option.
1210 Determines whether a non-importable pool can be made importable again, but does
1211 not actually perform the pool recovery.
1212 For more details about pool recovery mode, see the
1213 .Fl F
1214 option, above.
1215 .It Fl o Ar mntopts
1216 Comma-separated list of mount options to use when mounting datasets within the
1217 pool.
1219 .Xr zfs 1M
1220 for a description of dataset properties and mount options.
1221 .It Fl o Ar property Ns = Ns Ar value
1222 Sets the specified property on the imported pool.
1223 See the
1224 .Sx Properties
1225 section for more information on the available pool properties.
1226 .It Fl R Ar root
1227 Sets the
1228 .Sy cachefile
1229 property to
1230 .Sy none
1231 and the
1232 .Sy altroot
1233 property to
1234 .Ar root .
1236 .It Xo
1238 .Cm iostat
1239 .Op Fl v
1240 .Op Fl T Sy u Ns | Ns Sy d
1241 .Oo Ar pool Oc Ns ...
1242 .Op Ar interval Op Ar count
1244 Displays I/O statistics for the given pools.
1245 When given an
1246 .Ar interval ,
1247 the statistics are printed every
1248 .Ar interval
1249 seconds until ^C is pressed.
1250 If no
1251 .Ar pool Ns s
1252 are specified, statistics for every pool in the system is shown.
1254 .Ar count
1255 is specified, the command exits after
1256 .Ar count
1257 reports are printed.
1258 .Bl -tag -width Ds
1259 .It Fl T Sy u Ns | Ns Sy d
1260 Display a time stamp.
1261 Specify
1262 .Sy u
1263 for a printed representation of the internal representation of time.
1265 .Xr time 2 .
1266 Specify
1267 .Sy d
1268 for standard date format.
1270 .Xr date 1 .
1271 .It Fl v
1272 Verbose statistics Reports usage statistics for individual vdevs within the
1273 pool, in addition to the pool-wide statistics.
1275 .It Xo
1277 .Cm labelclear
1278 .Op Fl f
1279 .Ar device
1281 Removes ZFS label information from the specified
1282 .Ar device .
1284 .Ar device
1285 must not be part of an active pool configuration.
1286 .Bl -tag -width Ds
1287 .It Fl f
1288 Treat exported or foreign devices as inactive.
1290 .It Xo
1292 .Cm list
1293 .Op Fl Hpv
1294 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1295 .Op Fl T Sy u Ns | Ns Sy d
1296 .Oo Ar pool Oc Ns ...
1297 .Op Ar interval Op Ar count
1299 Lists the given pools along with a health status and space usage.
1300 If no
1301 .Ar pool Ns s
1302 are specified, all pools in the system are listed.
1303 When given an
1304 .Ar interval ,
1305 the information is printed every
1306 .Ar interval
1307 seconds until ^C is pressed.
1309 .Ar count
1310 is specified, the command exits after
1311 .Ar count
1312 reports are printed.
1313 .Bl -tag -width Ds
1314 .It Fl H
1315 Scripted mode.
1316 Do not display headers, and separate fields by a single tab instead of arbitrary
1317 space.
1318 .It Fl o Ar property
1319 Comma-separated list of properties to display.
1320 See the
1321 .Sx Properties
1322 section for a list of valid properties.
1323 The default list is
1324 .Cm name , size , allocated , free , expandsize , fragmentation , capacity ,
1325 .Cm dedupratio , health , altroot .
1326 .It Fl p
1327 Display numbers in parsable
1328 .Pq exact
1329 values.
1330 .It Fl T Sy u Ns | Ns Sy d
1331 Display a time stamp.
1332 Specify
1333 .Fl u
1334 for a printed representation of the internal representation of time.
1336 .Xr time 2 .
1337 Specify
1338 .Fl d
1339 for standard date format.
1341 .Xr date 1 .
1342 .It Fl v
1343 Verbose statistics.
1344 Reports usage statistics for individual vdevs within the pool, in addition to
1345 the pool-wise statistics.
1347 .It Xo
1349 .Cm offline
1350 .Op Fl t
1351 .Ar pool Ar device Ns ...
1353 Takes the specified physical device offline.
1354 While the
1355 .Ar device
1356 is offline, no attempt is made to read or write to the device.
1357 This command is not applicable to spares.
1358 .Bl -tag -width Ds
1359 .It Fl t
1360 Temporary.
1361 Upon reboot, the specified physical device reverts to its previous state.
1363 .It Xo
1365 .Cm online
1366 .Op Fl e
1367 .Ar pool Ar device Ns ...
1369 Brings the specified physical device online.
1370 This command is not applicable to spares.
1371 .Bl -tag -width Ds
1372 .It Fl e
1373 Expand the device to use all available space.
1374 If the device is part of a mirror or raidz then all devices must be expanded
1375 before the new space will become available to the pool.
1377 .It Xo
1379 .Cm reguid
1380 .Ar pool
1382 Generates a new unique identifier for the pool.
1383 You must ensure that all devices in this pool are online and healthy before
1384 performing this action.
1385 .It Xo
1387 .Cm reopen
1388 .Ar pool
1390 Reopen all the vdevs associated with the pool.
1391 .It Xo
1393 .Cm remove
1394 .Ar pool Ar device Ns ...
1396 Removes the specified device from the pool.
1397 This command currently only supports removing hot spares, cache, and log
1398 devices.
1399 A mirrored log device can be removed by specifying the top-level mirror for the
1400 log.
1401 Non-log devices that are part of a mirrored configuration can be removed using
1403 .Nm zpool Cm detach
1404 command.
1405 Non-redundant and raidz devices cannot be removed from a pool.
1406 .It Xo
1408 .Cm replace
1409 .Op Fl f
1410 .Ar pool Ar device Op Ar new_device
1412 Replaces
1413 .Ar old_device
1414 with
1415 .Ar new_device .
1416 This is equivalent to attaching
1417 .Ar new_device ,
1418 waiting for it to resilver, and then detaching
1419 .Ar old_device .
1421 The size of
1422 .Ar new_device
1423 must be greater than or equal to the minimum size of all the devices in a mirror
1424 or raidz configuration.
1426 .Ar new_device
1427 is required if the pool is not redundant.
1429 .Ar new_device
1430 is not specified, it defaults to
1431 .Ar old_device .
1432 This form of replacement is useful after an existing disk has failed and has
1433 been physically replaced.
1434 In this case, the new disk may have the same
1435 .Pa /dev/dsk
1436 path as the old device, even though it is actually a different disk.
1437 ZFS recognizes this.
1438 .Bl -tag -width Ds
1439 .It Fl f
1440 Forces use of
1441 .Ar new_device ,
1442 even if its appears to be in use.
1443 Not all devices can be overridden in this manner.
1445 .It Xo
1447 .Cm scrub
1448 .Op Fl s | Fl p
1449 .Ar pool Ns ...
1451 Begins a scrub or resumes a paused scrub.
1452 The scrub examines all data in the specified pools to verify that it checksums
1453 correctly.
1454 For replicated
1455 .Pq mirror or raidz
1456 devices, ZFS automatically repairs any damage discovered during the scrub.
1458 .Nm zpool Cm status
1459 command reports the progress of the scrub and summarizes the results of the
1460 scrub upon completion.
1462 Scrubbing and resilvering are very similar operations.
1463 The difference is that resilvering only examines data that ZFS knows to be out
1464 of date
1466 for example, when attaching a new device to a mirror or replacing an existing
1467 device
1468 .Pc ,
1469 whereas scrubbing examines all data to discover silent errors due to hardware
1470 faults or disk failure.
1472 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1473 one at a time.
1474 If a scrub is paused, the
1475 .Nm zpool Cm scrub
1476 resumes it.
1477 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1478 resilver completes.
1479 .Bl -tag -width Ds
1480 .It Fl s
1481 Stop scrubbing.
1483 .Bl -tag -width Ds
1484 .It Fl p
1485 Pause scrubbing.
1486 Scrub pause state and progress are periodically synced to disk.
1487 If the system is restarted or pool is exported during a paused scrub,
1488 even after import, scrub will remain paused until it is resumed.
1489 Once resumed the scrub will pick up from the place where it was last
1490 checkpointed to disk.
1491 To resume a paused scrub issue
1492 .Nm zpool Cm scrub
1493 again.
1495 .It Xo
1497 .Cm set
1498 .Ar property Ns = Ns Ar value
1499 .Ar pool
1501 Sets the given property on the specified pool.
1502 See the
1503 .Sx Properties
1504 section for more information on what properties can be set and acceptable
1505 values.
1506 .It Xo
1508 .Cm split
1509 .Op Fl n
1510 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1511 .Op Fl R Ar root
1512 .Ar pool newpool
1514 Splits devices off
1515 .Ar pool
1516 creating
1517 .Ar newpool .
1518 All vdevs in
1519 .Ar pool
1520 must be mirrors.
1521 At the time of the split,
1522 .Ar newpool
1523 will be a replica of
1524 .Ar pool .
1525 .Bl -tag -width Ds
1526 .It Fl n
1527 Do dry run, do not actually perform the split.
1528 Print out the expected configuration of
1529 .Ar newpool .
1530 .It Fl o Ar property Ns = Ns Ar value
1531 Sets the specified property for
1532 .Ar newpool .
1533 See the
1534 .Sx Properties
1535 section for more information on the available pool properties.
1536 .It Fl R Ar root
1538 .Sy altroot
1540 .Ar newpool
1542 .Ar root
1543 and automatically import it.
1545 .It Xo
1547 .Cm status
1548 .Op Fl Dvx
1549 .Op Fl T Sy u Ns | Ns Sy d
1550 .Oo Ar pool Oc Ns ...
1551 .Op Ar interval Op Ar count
1553 Displays the detailed health status for the given pools.
1554 If no
1555 .Ar pool
1556 is specified, then the status of each pool in the system is displayed.
1557 For more information on pool and device health, see the
1558 .Sx Device Failure and Recovery
1559 section.
1561 If a scrub or resilver is in progress, this command reports the percentage done
1562 and the estimated time to completion.
1563 Both of these are only approximate, because the amount of data in the pool and
1564 the other workloads on the system can change.
1565 .Bl -tag -width Ds
1566 .It Fl D
1567 Display a histogram of deduplication statistics, showing the allocated
1568 .Pq physically present on disk
1569 and referenced
1570 .Pq logically referenced in the pool
1571 block counts and sizes by reference count.
1572 .It Fl T Sy u Ns | Ns Sy d
1573 Display a time stamp.
1574 Specify
1575 .Fl u
1576 for a printed representation of the internal representation of time.
1578 .Xr time 2 .
1579 Specify
1580 .Fl d
1581 for standard date format.
1583 .Xr date 1 .
1584 .It Fl v
1585 Displays verbose data error information, printing out a complete list of all
1586 data errors since the last complete pool scrub.
1587 .It Fl x
1588 Only display status for pools that are exhibiting errors or are otherwise
1589 unavailable.
1590 Warnings about pools not using the latest on-disk format will not be included.
1592 .It Xo
1594 .Cm upgrade
1596 Displays pools which do not have all supported features enabled and pools
1597 formatted using a legacy ZFS version number.
1598 These pools can continue to be used, but some features may not be available.
1600 .Nm zpool Cm upgrade Fl a
1601 to enable all features on all pools.
1602 .It Xo
1604 .Cm upgrade
1605 .Fl v
1607 Displays legacy ZFS versions supported by the current software.
1609 .Xr zpool-features 5
1610 for a description of feature flags features supported by the current software.
1611 .It Xo
1613 .Cm upgrade
1614 .Op Fl V Ar version
1615 .Fl a Ns | Ns Ar pool Ns ...
1617 Enables all supported features on the given pool.
1618 Once this is done, the pool will no longer be accessible on systems that do not
1619 support feature flags.
1621 .Xr zpool-features 5
1622 for details on compatibility with systems that support feature flags, but do not
1623 support all features enabled on the pool.
1624 .Bl -tag -width Ds
1625 .It Fl a
1626 Enables all supported features on all pools.
1627 .It Fl V Ar version
1628 Upgrade to the specified legacy version.
1629 If the
1630 .Fl V
1631 flag is specified, no features will be enabled on the pool.
1632 This option can only be used to increase the version number up to the last
1633 supported legacy version number.
1636 .Sh EXIT STATUS
1637 The following exit values are returned:
1638 .Bl -tag -width Ds
1639 .It Sy 0
1640 Successful completion.
1641 .It Sy 1
1642 An error occurred.
1643 .It Sy 2
1644 Invalid command line options were specified.
1646 .Sh EXAMPLES
1647 .Bl -tag -width Ds
1648 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1649 The following command creates a pool with a single raidz root vdev that
1650 consists of six disks.
1651 .Bd -literal
1652 # zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0
1654 .It Sy Example 2 No Creating a Mirrored Storage Pool
1655 The following command creates a pool with two mirrors, where each mirror
1656 contains two disks.
1657 .Bd -literal
1658 # zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0
1660 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Slices
1661 The following command creates an unmirrored pool using two disk slices.
1662 .Bd -literal
1663 # zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4
1665 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
1666 The following command creates an unmirrored pool using files.
1667 While not recommended, a pool based on files can be useful for experimental
1668 purposes.
1669 .Bd -literal
1670 # zpool create tank /path/to/file/a /path/to/file/b
1672 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
1673 The following command adds two mirrored disks to the pool
1674 .Em tank ,
1675 assuming the pool is already made up of two-way mirrors.
1676 The additional space is immediately available to any datasets within the pool.
1677 .Bd -literal
1678 # zpool add tank mirror c1t0d0 c1t1d0
1680 .It Sy Example 6 No Listing Available ZFS Storage Pools
1681 The following command lists all available pools on the system.
1682 In this case, the pool
1683 .Em zion
1684 is faulted due to a missing device.
1685 The results from this command are similar to the following:
1686 .Bd -literal
1687 # zpool list
1688 NAME    SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
1689 rpool  19.9G  8.43G  11.4G    33%         -    42%  1.00x  ONLINE  -
1690 tank   61.5G  20.0G  41.5G    48%         -    32%  1.00x  ONLINE  -
1691 zion       -      -      -      -         -      -      -  FAULTED -
1693 .It Sy Example 7 No Destroying a ZFS Storage Pool
1694 The following command destroys the pool
1695 .Em tank
1696 and any datasets contained within.
1697 .Bd -literal
1698 # zpool destroy -f tank
1700 .It Sy Example 8 No Exporting a ZFS Storage Pool
1701 The following command exports the devices in pool
1702 .Em tank
1703 so that they can be relocated or later imported.
1704 .Bd -literal
1705 # zpool export tank
1707 .It Sy Example 9 No Importing a ZFS Storage Pool
1708 The following command displays available pools, and then imports the pool
1709 .Em tank
1710 for use on the system.
1711 The results from this command are similar to the following:
1712 .Bd -literal
1713 # zpool import
1714   pool: tank
1715     id: 15451357997522795478
1716  state: ONLINE
1717 action: The pool can be imported using its name or numeric identifier.
1718 config:
1720         tank        ONLINE
1721           mirror    ONLINE
1722             c1t2d0  ONLINE
1723             c1t3d0  ONLINE
1725 # zpool import tank
1727 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
1728 The following command upgrades all ZFS Storage pools to the current version of
1729 the software.
1730 .Bd -literal
1731 # zpool upgrade -a
1732 This system is currently running ZFS version 2.
1734 .It Sy Example 11 No Managing Hot Spares
1735 The following command creates a new pool with an available hot spare:
1736 .Bd -literal
1737 # zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0
1740 If one of the disks were to fail, the pool would be reduced to the degraded
1741 state.
1742 The failed device can be replaced using the following command:
1743 .Bd -literal
1744 # zpool replace tank c0t0d0 c0t3d0
1747 Once the data has been resilvered, the spare is automatically removed and is
1748 made available for use should another device fail.
1749 The hot spare can be permanently removed from the pool using the following
1750 command:
1751 .Bd -literal
1752 # zpool remove tank c0t2d0
1754 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
1755 The following command creates a ZFS storage pool consisting of two, two-way
1756 mirrors and mirrored log devices:
1757 .Bd -literal
1758 # zpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
1759   c4d0 c5d0
1761 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
1762 The following command adds two disks for use as cache devices to a ZFS storage
1763 pool:
1764 .Bd -literal
1765 # zpool add pool cache c2d0 c3d0
1768 Once added, the cache devices gradually fill with content from main memory.
1769 Depending on the size of your cache devices, it could take over an hour for
1770 them to fill.
1771 Capacity and reads can be monitored using the
1772 .Cm iostat
1773 option as follows:
1774 .Bd -literal
1775 # zpool iostat -v pool 5
1777 .It Sy Example 14 No Removing a Mirrored Log Device
1778 The following command removes the mirrored log device
1779 .Sy mirror-2 .
1780 Given this configuration:
1781 .Bd -literal
1782   pool: tank
1783  state: ONLINE
1784  scrub: none requested
1785 config:
1787          NAME        STATE     READ WRITE CKSUM
1788          tank        ONLINE       0     0     0
1789            mirror-0  ONLINE       0     0     0
1790              c6t0d0  ONLINE       0     0     0
1791              c6t1d0  ONLINE       0     0     0
1792            mirror-1  ONLINE       0     0     0
1793              c6t2d0  ONLINE       0     0     0
1794              c6t3d0  ONLINE       0     0     0
1795          logs
1796            mirror-2  ONLINE       0     0     0
1797              c4t0d0  ONLINE       0     0     0
1798              c4t1d0  ONLINE       0     0     0
1801 The command to remove the mirrored log
1802 .Sy mirror-2
1804 .Bd -literal
1805 # zpool remove tank mirror-2
1807 .It Sy Example 15 No Displaying expanded space on a device
1808 The following command displays the detailed information for the pool
1809 .Em data .
1810 This pool is comprised of a single raidz vdev where one of its devices
1811 increased its capacity by 10GB.
1812 In this example, the pool will not be able to utilize this extra capacity until
1813 all the devices under the raidz vdev have been expanded.
1814 .Bd -literal
1815 # zpool list -v data
1816 NAME         SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
1817 data        23.9G  14.6G  9.30G    48%         -    61%  1.00x  ONLINE  -
1818   raidz1    23.9G  14.6G  9.30G    48%         -
1819     c1t1d0      -      -      -      -         -
1820     c1t2d0      -      -      -      -       10G
1821     c1t3d0      -      -      -      -         -
1824 .Sh INTERFACE STABILITY
1825 .Sy Evolving
1826 .Sh SEE ALSO
1827 .Xr zfs 1M ,
1828 .Xr attributes 5 ,
1829 .Xr zpool-features 5