zfs-set(8) | set properties on ZFS datasets |
zfs-get, zfs-set(8) | set properties on ZFS datasets |
zfs-inherit, zfs-set(8) | set properties on ZFS datasets |
ZFS-SET(8) | System Manager's Manual | ZFS-SET(8) |
zfs-set
— set
properties on ZFS datasets
zfs |
set [-u ]
property=value
[property=value]…
filesystem|volume|snapshot… |
zfs |
get
[-r |-d
depth] [-Hp ]
[-o
field[,field]…]
[-s
source[,source]…]
[-t
type[,type]…]
all |property[,property]…
[filesystem|volume|snapshot|bookmark]… |
zfs |
inherit [-rS ]
property
filesystem|volume|snapshot… |
zfs
set
[-u
]
property=value
[property=value]…
filesystem|volume|snapshot…-u
zfs
get
[-r
|-d
depth] [-Hp
]
[-o
field[,field]…]
[-s
source[,source]…]
[-t
type[,type]…]
all
|property[,property]…
[filesystem|volume|snapshot|bookmark]…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).
-H
-d
depth-o
field-p
-r
-s
source-t
typezfs
inherit
[-rS
] property
filesystem|volume|snapshot…-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.
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
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
The following command sets a quota of 50 Gbytes for pool/home/bob:
# zfs
set
quota=50G
pool/home/bob
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 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
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
The following example sets the user-defined com.example:department property for a dataset:
# zfs
set
com.example:department=12345
tank/accounting
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.
March 16, 2022 | OpenZFS |