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