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