ZFS-SET(8)
π ZFS-SET(8) π
okay bestie, welcome to zfs-set from the System Manager's Manual β this is the page that teaches you how to set, get and inherit properties on your ZFS datasets. it's giving main character energy for your whole pool. let's go π¦
β¨ NAME β¨
zfs-set β set properties on ZFS datasets
π SYNOPSIS π
zfs set [-u] property=value [property=value]β¦
filesystem|volume|snapshotβ¦
zfs get [-r|-d depth] [-Hp] [-j [--json-int]] [-o field[,field]β¦] [-s
source[,source]β¦] [-t type[,type]β¦] all|property[,property]β¦
[filesystem|volume|snapshot|bookmark]β¦
zfs inherit [-rS] property filesystem|volume|snapshotβ¦
π DESCRIPTION π
π«Ά zfs set [-u] property=value [property=value]β¦ filesystem|volume|snapshotβ¦
so this is the setter. it puts a property onto a dataset, simple as that.
lowkey important: only some properties can be edited. go read zfsprops(7) for the full rundown of which properties you can set and what values they'll actually accept, no cap.
Numeric values can be given as exact values, or in a human-readable form with a suffix β and the suffixes are B, K, M, G, T, P, E, Z, which stand for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively. pick your fighter π«
User properties can be set on snapshots too. for more on that, see the User Properties section of zfsprops(7).
-uβ updates themountpoint,sharenfs,sharesmbproperty but does not mount or share the dataset. like, the property changes, the actual mounting/sharing vibes do not. π
π¦ zfs get [-r|-d depth] [-Hp] [-j [--json-int]] [-o field[,field]β¦] [-s source[,source]β¦] [-t type[,type]β¦] all|property[,property]β¦ [filesystem|volume|snapshot|bookmark]β¦
the getter. it displays properties for the datasets you point at. if you specify no datasets, then the command displays properties for all datasets on the system β yes, all of them, drink some water first.
For each property, these columns get shown:
nameβ dataset namepropertyβ property namevalueβ property valuesourceβ property source:local,default,inherited,temporary,received, or-(none).
All columns are displayed by default, though this can be controlled by using the -o option. This command takes a comma-separated list of properties as described in the βNative Propertiesβ and βUser Propertiesβ sections of zfsprops(7).
The value all can be used to display all properties that apply to the given dataset's type (filesystem, volume, snapshot, or bookmark).
-j,--json[--json-int]β Display the output in JSON format. Specify--json-intto display numbers in integer format instead of strings for JSON output. it's giving machine-readable β¨-Hβ Display output in a form more easily parsed by scripts. Any headers are omitted, and fields are explicitly separated by a single tab instead of an arbitrary amount of space. script girlies, this one's for you.-ddepth β Recursively display any children of the dataset, limiting the recursion to depth. A depth of1will display only the dataset and its direct children.-ofield β A comma-separated list of columns to display, defaults toname,property,value,source.-pβ Display numbers in parsable (exact) values.-rβ Recursively display properties for any children.-ssource β A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of the following:local,default,inherited,temporary,received, ornone. The default value is all sources.-ttype β A comma-separated list of types to display, where type is one offilesystem,snapshot,volume,bookmark, orall.fs,snap, orvolcan be used as aliases forfilesystem,snapshot, orvolume.
π zfs inherit [-rS] property filesystem|volume|snapshotβ¦
the un-setter. it clears the specified property, causing it to be inherited from an ancestor, restored to default if no ancestor has the property set, or β with the -S option β reverted to the received value if one exists. See zfsprops(7) for a listing of default values, and details on which properties can be inherited.
-rβ Recursively inherit the given property for all children. the whole family tree gets it π§-Sβ Revert the property to the received value, if one exists; otherwise, for non-inheritable properties, to the default; otherwise, operate as if the-Soption was not specified.
β EXAMPLES β
πΈ Example 1: Creating a ZFS File System Hierarchy
The following commands create a file system named pool/home and a file system named pool/home/bob. The mount point /export/home is set for the parent file system, and is automatically inherited by the child file system.
# zfs create pool/home
# zfs set mountpoint=/export/home pool/home
# zfs create pool/home/bob
πΈ Example 2: Disabling and Enabling File System Compression
The following command disables the compression property for all file systems under pool/home. The next command explicitly enables compression for pool/home/anne.
# zfs set compression=off pool/home
# zfs set compression=on pool/home/anne
πΈ Example 3: Setting a Quota on a ZFS File System
The following command sets a quota of 50 Gbytes for pool/home/bob:
# zfs set quota=50G pool/home/bob
πΈ Example 4: Listing ZFS Properties
The following command lists all properties for pool/home/bob:
# zfs get all pool/home/bob
NAME PROPERTY VALUE SOURCE
pool/home/bob type filesystem -
pool/home/bob creation Tue Jul 21 15:53 2009 -
pool/home/bob used 21K -
pool/home/bob available 20.0G -
pool/home/bob referenced 21K -
pool/home/bob compressratio 1.00x -
pool/home/bob mounted yes -
pool/home/bob quota 20G local
pool/home/bob reservation none default
pool/home/bob recordsize 128K default
pool/home/bob mountpoint /pool/home/bob default
pool/home/bob sharenfs off default
pool/home/bob checksum on default
pool/home/bob compression on local
pool/home/bob atime on default
pool/home/bob devices on default
pool/home/bob exec on default
pool/home/bob setuid on default
pool/home/bob readonly off default
pool/home/bob zoned off default
pool/home/bob snapdir hidden default
pool/home/bob acltype off default
pool/home/bob aclmode discard default
pool/home/bob aclinherit restricted default
pool/home/bob canmount on default
pool/home/bob xattr on default
pool/home/bob copies 1 default
pool/home/bob version 4 -
pool/home/bob utf8only off -
pool/home/bob normalization none -
pool/home/bob casesensitivity sensitive -
pool/home/bob vscan off default
pool/home/bob nbmand off default
pool/home/bob sharesmb off default
pool/home/bob refquota none default
pool/home/bob refreservation none default
pool/home/bob primarycache all default
pool/home/bob secondarycache all default
pool/home/bob usedbysnapshots 0 -
pool/home/bob usedbydataset 21K -
pool/home/bob usedbychildren 0 -
pool/home/bob usedbyrefreservation 0 -
The following command gets a single property value:
# zfs get -H -o value compression pool/home/bob
on
The following command gets a single property value recursively in JSON format:
# zfs get -j -r mountpoint pool/home | jq
{
"output_version": {
"command": "zfs get",
"vers_major": 0,
"vers_minor": 1
},
"datasets": {
"pool/home": {
"name": "pool/home",
"type": "FILESYSTEM",
"pool": "pool",
"createtxg": "10",
"properties": {
"mountpoint": {
"value": "/pool/home",
"source": {
"type": "DEFAULT",
"data": "-"
}
}
}
},
"pool/home/bob": {
"name": "pool/home/bob",
"type": "FILESYSTEM",
"pool": "pool",
"createtxg": "1176",
"properties": {
"mountpoint": {
"value": "/pool/home/bob",
"source": {
"type": "DEFAULT",
"data": "-"
}
}
}
}
}
}
The following command lists all properties with local settings for pool/home/bob:
# zfs get -r -s local -o name,property,value all pool/home/bob
NAME PROPERTY VALUE
pool/home/bob quota 20G
pool/home/bob compression on
πΈ Example 5: Inheriting ZFS Properties
The following command causes pool/home/bob and pool/home/anne to inherit the checksum property from their parent.
# zfs inherit checksum pool/home/bob pool/home/anne
πΈ Example 6: Setting User Properties
The following example sets the user-defined com.example:department property for a dataset:
# zfs set com.example:department=12345 tank/accounting
πΈ Example 7: Setting sharenfs Property Options on a ZFS File System
The following commands show how to set sharenfs property options to enable read-write access for a set of IP addresses and to enable root access for system "neo" on the tank/home file system:
# zfs set sharenfs='rw=@123.123.0.0/16:[::1],root=neo' tank/home
If you are using DNS for host name resolution, specify the fully-qualified hostname.
π«Ά and that's part 1, bestie. there's more where this came from β stay tuned π
π SEE ALSO π
okay bestie, you already got the whole zfs set tea, but if you wanna go deeper (and you should, it's giving scholar energy π
), go read these:
zfsprops(7) β the full rundown of literally every property you can set, iykyk πzfs-list(8) β for when you need to actually see what you just set, iconic behaviour fr fr π
and that's a wrap on the whole page, bestie!! π this lil masterpiece comes to you from OpenZFS, dated October 12, 2024 β yes she's stamped and everything, main character documentation energy πβ¨
now go forth and set those properties responsibly, mwah ππ¦
π¦ where this page comes from
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5 Β· CDDL-1.0
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5.1 Β· CDDL-1.0
- ubuntu stonking: zfsutils-linux 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved
- Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
- Copyright (c) 2011, 2019 by Delphix. All rights reserved
- Copyright (c) 2013 by Saso Kiselkov. All rights reserved
- Copyright (c) 2014, Joyent, Inc. All rights reserved
- Copyright (c) 2014 by Adam Stevko. All rights reserved
- Copyright (c) 2014 Integros [integros.com]
- Copyright 2019 Richard Laager. All rights reserved
- Copyright 2018 Nexenta Systems, Inc
- Copyright 2019 Joyent, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms