xref: /src/sys/contrib/openzfs/man/man7/zpoolprops.7 (revision 16cef5f7a65588def71db4fdfa961f959847e3b6)
1.\" SPDX-License-Identifier: CDDL-1.0
2.\"
3.\" CDDL HEADER START
4.\"
5.\" The contents of this file are subject to the terms of the
6.\" Common Development and Distribution License (the "License").
7.\" You may not use this file except in compliance with the License.
8.\"
9.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10.\" or https://opensource.org/licenses/CDDL-1.0.
11.\" See the License for the specific language governing permissions
12.\" and limitations under the License.
13.\"
14.\" When distributing Covered Code, include this CDDL HEADER in each
15.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16.\" If applicable, add the following below this CDDL HEADER, with the
17.\" fields enclosed by brackets "[]" replaced with your own identifying
18.\" information: Portions Copyright [yyyy] [name of copyright owner]
19.\"
20.\" CDDL HEADER END
21.\"
22.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
25.\" Copyright (c) 2017 Datto Inc.
26.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
27.\" Copyright 2017 Nexenta Systems, Inc.
28.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
29.\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
30.\" Copyright (c) 2023, Klara Inc.
31.\"
32.Dd December 4, 2024
33.Dt ZPOOLPROPS 7
34.Os
35.
36.Sh NAME
37.Nm zpoolprops
38.Nd properties of ZFS storage pools
39.
40.Sh DESCRIPTION
41Each pool has several properties associated with it.
42Some properties are read-only statistics while others are configurable and
43change the behavior of the pool.
44.Pp
45User properties have no effect on ZFS behavior.
46Use them to annotate pools in a way that is meaningful in your environment.
47For more information about user properties, see the
48.Sx User Properties
49section.
50.Pp
51The following are read-only properties:
52.Bl -tag -width "unsupported@guid"
53.It Sy allocated
54Amount of storage used within the pool.
55See
56.Sy fragmentation
57and
58.Sy free
59for more information.
60.It Sy bcloneratio
61The ratio of the total amount of storage that would be required to store all
62the cloned blocks without cloning to the actual storage used.
63The
64.Sy bcloneratio
65property is calculated as:
66.Pp
67.Sy ( ( bclonesaved + bcloneused ) * 100 ) / bcloneused
68.It Sy bclonesaved
69The amount of additional storage that would be required if block cloning
70was not used.
71.It Sy bcloneused
72The amount of storage used by cloned blocks.
73.It Sy capacity
74Percentage of pool space used.
75This property can also be referred to by its shortened column name,
76.Sy cap .
77.It Sy dedupcached
78Total size of the deduplication table currently loaded into the ARC.
79See
80.Xr zpool-prefetch 8 .
81.It Sy dedup_table_size
82Total on-disk size of the deduplication table.
83.It Sy dedupratio
84The ratio of the total amount of storage that would be required to store all
85the deduplicated blocks without deduplication to the actual storage used.
86The
87.Sy dedupratio
88property is calculated as:
89.Pp
90.Sy ( ( dedupsaved + dedupused ) * 100 ) / dedupused
91.It Sy dedupsaved
92The amount of additional storage that would be required if deduplication
93was not used.
94This represents the space saved by deduplication.
95.It Sy dedupused
96The amount of storage used by deduplicated blocks.
97This is the actual physical space occupied on disk after deduplication.
98.It Sy expandsize
99Amount of uninitialized space within the pool or device that can be used to
100increase the total capacity of the pool.
101On whole-disk vdevs, this is the space beyond the end of the GPT –
102typically occurring when a LUN is dynamically expanded
103or a disk replaced with a larger one.
104On partition vdevs, this is the space appended to the partition after it was
105added to the pool – most likely by resizing it in-place.
106The space can be claimed for the pool by bringing it online with
107.Sy autoexpand=on
108or using
109.Nm zpool Cm online Fl e .
110.It Sy fragmentation
111The amount of fragmentation in the pool.
112As the amount of space
113.Sy allocated
114increases, it becomes more difficult to locate
115.Sy free
116space.
117This may result in lower write performance compared to pools with more
118unfragmented free space.
119.It Sy free
120The amount of free space available in the pool.
121By contrast, the
122.Xr zfs 8
123.Sy available
124property describes how much new data can be written to ZFS filesystems/volumes.
125The zpool
126.Sy free
127property is not generally useful for this purpose, and can be substantially more
128than the zfs
129.Sy available
130space.
131This discrepancy is due to several factors, including raidz parity;
132zfs reservation, quota, refreservation, and refquota properties; and space set
133aside by
134.Sy spa_slop_shift
135(see
136.Xr zfs 4
137for more information).
138.It Sy freeing
139After a file system or snapshot is destroyed, the space it was using is
140returned to the pool asynchronously.
141.Sy freeing
142is the amount of space remaining to be reclaimed.
143Over time
144.Sy freeing
145will decrease while
146.Sy free
147increases.
148.It Sy guid
149A unique identifier for the pool.
150.It Sy health
151The current health of the pool.
152Health can be one of
153.Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
154.It Sy last_scrubbed_txg
155Indicates the transaction group (TXG) up to which the most recent scrub
156operation has checked and repaired the dataset.
157This provides insight into the data integrity status of their pool at
158a specific point in time.
159.Xr zpool-scrub 8
160can utilize this property to scan only data that has changed since the last
161scrub completed, when given the
162.Fl C
163flag.
164This property is not updated when performing an error scrub with the
165.Fl e
166flag.
167.It Sy leaked
168Space not released while
169.Sy freeing
170due to corruption, now permanently leaked into the pool.
171.It Sy load_guid
172A unique identifier for the pool.
173Unlike the
174.Sy guid
175property, this identifier is generated every time we load the pool (i.e. does
176not persist across imports/exports) and never changes while the pool is loaded
177(even if a
178.Sy reguid
179operation takes place).
180.It Sy size
181Total size of the storage pool.
182.It Sy unsupported@ Ns Em guid
183Information about unsupported features that are enabled on the pool.
184See
185.Xr zpool-features 7
186for details.
187.El
188.Pp
189The space usage properties report actual physical space available to the
190storage pool.
191The physical space can be different from the total amount of space that any
192contained datasets can actually use.
193The amount of space used in a raidz configuration depends on the characteristics
194of the data being written.
195In addition, ZFS reserves some space for internal accounting that the
196.Xr zfs 8
197command takes into account, but the
198.Nm
199command does not.
200For non-full pools of a reasonable size, these effects should be invisible.
201For small pools, or pools that are close to being completely full, these
202discrepancies may become more noticeable.
203.Pp
204The following property can be set at creation time and import time:
205.Bl -tag -width Ds
206.It Sy altroot
207Alternate root directory.
208If set, this directory is prepended to any mount points within the pool.
209This can be used when examining an unknown pool where the mount points cannot be
210trusted, or in an alternate boot environment, where the typical paths are not
211valid.
212.Sy altroot
213is not a persistent property.
214It is valid only while the system is up.
215Setting
216.Sy altroot
217defaults to using
218.Sy cachefile Ns = Ns Sy none ,
219though this may be overridden using an explicit setting.
220.El
221.Pp
222The following property can be set only at import time:
223.Bl -tag -width Ds
224.It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
225If set to
226.Sy on ,
227the pool will be imported in read-only mode.
228This property can also be referred to by its shortened column name,
229.Sy rdonly .
230.El
231.Pp
232The following properties can be set at creation time and import time, and later
233changed with the
234.Nm zpool Cm set
235command:
236.Bl -tag -width Ds
237.It Sy ashift Ns = Ns Ar ashift
238Pool sector size exponent, to the power of
239.Sy 2
240(internally referred to as
241.Sy ashift ) .
242Values from 9 to 16, inclusive, are valid; also, the
243value 0 (the default) means to auto-detect using the kernel's block
244layer and a ZFS internal exception list.
245I/O operations will be aligned to the specified size boundaries.
246Additionally, the minimum (disk)
247write size will be set to the specified size, so this represents a
248space/performance trade-off.
249For optimal performance, the pool sector size should be greater than
250or equal to the sector size of the underlying disks.
251The typical case for setting this property is when
252performance is important and the underlying disks use 4KiB sectors but
253report 512B sectors to the OS (for compatibility reasons); in that
254case, set
255.Sy ashift Ns = Ns Sy 12
256(which is
257.Sy 1<<12 No = Sy 4096 ) .
258When set, this property is
259used as the default hint value in subsequent vdev operations (add,
260attach and replace).
261Changing this value will not modify any existing
262vdev, not even on disk replacement; however it can be used, for
263instance, to replace a dying 512B sectors disk with a newer 4KiB
264sectors device: this will probably result in bad performance but at the
265same time could prevent loss of data.
266.It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
267Controls automatic pool expansion when the underlying LUN is grown.
268If set to
269.Sy on ,
270the pool will be resized according to the size of the expanded device.
271If the device is part of a mirror or raidz then all devices within that
272mirror/raidz group must be expanded before the new space is made available to
273the pool.
274The default behavior is
275.Sy off .
276This property can also be referred to by its shortened column name,
277.Sy expand .
278.It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
279Controls automatic device replacement.
280If set to
281.Sy off ,
282device replacement must be initiated by the administrator by using the
283.Nm zpool Cm replace
284command.
285If set to
286.Sy on ,
287any new device, found in the same physical location as a device that previously
288belonged to the pool, is automatically formatted and replaced.
289The default behavior is
290.Sy off .
291This property can also be referred to by its shortened column name,
292.Sy replace .
293Autoreplace can also be used with virtual disks (like device
294mapper) provided that you use the /dev/disk/by-vdev paths setup by
295vdev_id.conf.
296See the
297.Xr vdev_id 8
298manual page for more details.
299Autoreplace and autoonline require the ZFS Event Daemon be configured and
300running.
301See the
302.Xr zed 8
303manual page for more details.
304.It Sy autotrim Ns = Ns Sy on Ns | Ns Sy off
305When set to
306.Sy on
307space which has been recently freed, and is no longer allocated by the pool,
308will be periodically trimmed.
309This allows block device vdevs which support
310BLKDISCARD, such as SSDs, or file vdevs on which the underlying file system
311supports hole-punching, to reclaim unused blocks.
312The default value for this property is
313.Sy off .
314.Pp
315Automatic TRIM does not immediately reclaim blocks after a free.
316Instead, it will optimistically delay allowing smaller ranges to be aggregated
317into a few larger ones.
318These can then be issued more efficiently to the storage.
319TRIM on L2ARC devices is enabled by setting
320.Sy l2arc_trim_ahead > 0 .
321.Pp
322Be aware that automatic trimming of recently freed data blocks can put
323significant stress on the underlying storage devices.
324This will vary depending of how well the specific device handles these commands.
325For lower-end devices it is often possible to achieve most of the benefits
326of automatic trimming by running an on-demand (manual) TRIM periodically
327using the
328.Nm zpool Cm trim
329command.
330.It Sy bootfs Ns = Ns Sy (unset) Ns | Ns Ar pool Ns Op / Ns Ar dataset
331Identifies the default bootable dataset for the root pool.
332This property is expected to be set mainly by the installation and upgrade
333programs.
334Not all Linux distribution boot processes use the bootfs property.
335.It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
336Controls the location of where the pool configuration is cached.
337Discovering all pools on system startup requires a cached copy of the
338configuration data that is stored on the root file system.
339All pools in this cache are automatically imported when the system boots.
340Some environments, such as install and clustering, need to cache this
341information in a different location so that pools are not automatically
342imported.
343Setting this property caches the pool configuration in a different location that
344can later be imported with
345.Nm zpool Cm import Fl c .
346Setting it to the value
347.Sy none
348creates a temporary pool that is never cached, and the
349.Qq
350.Pq empty string
351uses the default location.
352.Pp
353Multiple pools can share the same cache file.
354Because the kernel destroys and recreates this file when pools are added and
355removed, care should be taken when attempting to access this file.
356When the last pool using a
357.Sy cachefile
358is exported or destroyed, the file will be empty.
359.It Sy comment Ns = Ns Ar text
360A text string consisting of printable ASCII characters that will be stored
361such that it is available even if the pool becomes faulted.
362An administrator can provide additional information about a pool using this
363property.
364.It Sy compatibility Ns = Ns Sy off Ns | Ns Sy legacy Ns | Ns Ar file Ns Oo , Ns Ar file Oc Ns …
365Specifies that the pool maintain compatibility with specific feature sets.
366When set to
367.Sy off
368(or unset) compatibility is disabled (all features may be enabled); when set to
369.Sy legacy
370no features may be enabled.
371When set to a comma-separated list of filenames
372(each filename may either be an absolute path, or relative to
373.Pa /etc/zfs/compatibility.d
374or
375.Pa /usr/share/zfs/compatibility.d )
376the lists of requested features are read from those files, separated by
377whitespace and/or commas.
378Only features present in all files may be enabled.
379.Pp
380See
381.Xr zpool-features 7 ,
382.Xr zpool-create 8
383and
384.Xr zpool-upgrade 8
385for more information on the operation of compatibility feature sets.
386.It Sy dedup_table_quota Ns = Ns Ar number Ns | Ns Sy none Ns | Ns Sy auto
387This property sets a limit on the on-disk size of the pool's dedup table.
388Entries will not be added to the dedup table once this size is reached;
389if a dedup table already exists, and is larger than this size, they
390will not be removed as part of setting this property.
391Existing entries will still have their reference counts updated.
392.Pp
393The actual size limit of the table may be above or below the quota,
394depending on the actual on-disk size of the entries (which may be
395approximated for purposes of calculating the quota).
396That is, setting a quota size of 1M may result in the maximum size being
397slightly below, or slightly above, that value.
398Set to
399.Sy 'none'
400to disable.
401In automatic mode, which is the default, the size of a dedicated dedup vdev
402is used as the quota limit.
403.Pp
404The
405.Sy dedup_table_quota
406property works for both legacy and fast dedup tables.
407.It Sy dedupditto Ns = Ns Ar number
408This property is deprecated and no longer has any effect.
409.It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
410Controls whether a non-privileged user is granted access based on the dataset
411permissions defined on the dataset.
412See
413.Xr zfs 8
414for more information on ZFS delegated administration.
415.It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
416Controls the system behavior in the event of catastrophic pool failure.
417This condition is typically a result of a loss of connectivity to the underlying
418storage device(s) or a failure of all devices within the pool.
419The behavior of such an event is determined as follows:
420.Bl -tag -width "continue"
421.It Sy wait
422Blocks all I/O access until the device connectivity is recovered and the errors
423are cleared with
424.Nm zpool Cm clear .
425This is the default behavior.
426.It Sy continue
427Returns
428.Er EIO
429to any new write I/O requests but allows reads to any of the remaining healthy
430devices.
431Any write requests that have yet to be committed to disk would be blocked.
432.It Sy panic
433Prints out a message to the console and generates a system crash dump.
434.El
435.It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
436The value of this property is the current state of
437.Ar feature_name .
438The only valid value when setting this property is
439.Sy enabled
440which moves
441.Ar feature_name
442to the enabled state.
443See
444.Xr zpool-features 7
445for details on feature states.
446.It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
447Controls whether information about snapshots associated with this pool is
448output when
449.Nm zfs Cm list
450is run without the
451.Fl t
452option.
453The default value is
454.Sy off .
455This property can also be referred to by its shortened name,
456.Sy listsnaps .
457.It Sy multihost Ns = Ns Sy on Ns | Ns Sy off
458Controls whether a pool activity check should be performed during
459.Nm zpool Cm import .
460When a pool is determined to be active it cannot be imported, even with the
461.Fl f
462option.
463This property is intended to be used in failover configurations
464where multiple hosts have access to a pool on shared storage.
465.Pp
466Multihost provides protection on import only.
467It does not protect against an
468individual device being used in multiple pools, regardless of the type of vdev.
469See the discussion under
470.Nm zpool Cm create .
471.Pp
472When this property is on, periodic writes to storage occur to show the pool is
473in use.
474See
475.Sy zfs_multihost_interval
476in the
477.Xr zfs 4
478manual page.
479In order to enable this property each host must set a unique hostid.
480See
481.Xr genhostid 1
482.Xr zgenhostid 8
483.Xr spl 4
484for additional details.
485The default value is
486.Sy off .
487.It Sy version Ns = Ns Ar version
488The current on-disk version of the pool.
489This can be increased, but never decreased.
490The preferred method of updating pools is with the
491.Nm zpool Cm upgrade
492command, though this property can be used when a specific version is needed for
493backwards compatibility.
494Once feature flags are enabled on a pool this property will no longer have a
495value.
496.El
497.
498.Ss User Properties
499In addition to the standard native properties, ZFS supports arbitrary user
500properties.
501User properties have no effect on ZFS behavior, but applications or
502administrators can use them to annotate pools.
503.Pp
504User property names must contain a colon
505.Pq Qq Sy \&:
506character to distinguish them from native properties.
507They may contain lowercase letters, numbers, and the following punctuation
508characters: colon
509.Pq Qq Sy \&: ,
510dash
511.Pq Qq Sy - ,
512period
513.Pq Qq Sy \&. ,
514and underscore
515.Pq Qq Sy _ .
516The expected convention is that the property name is divided into two portions
517such as
518.Ar module : Ns Ar property ,
519but this namespace is not enforced by ZFS.
520User property names can be at most 255 characters, and cannot begin with a dash
521.Pq Qq Sy - .
522.Pp
523When making programmatic use of user properties, it is strongly suggested to use
524a reversed DNS domain name for the
525.Ar module
526component of property names to reduce the chance that two
527independently-developed packages use the same property name for different
528purposes.
529.Pp
530The values of user properties are arbitrary strings and
531are never validated.
532All of the commands that operate on properties
533.Po Nm zpool Cm list ,
534.Nm zpool Cm get ,
535.Nm zpool Cm set ,
536and so forth
537.Pc
538can be used to manipulate both native properties and user properties.
539Use
540.Nm zpool Cm set Ar name Ns =
541to clear a user property.
542Property values are limited to 8192 bytes.
543