How do I change the default options for zfs
filesystems on an existing zpool?
That is, ZFS stored for each zpool
pool the default values for new zfs
filesystems. Those are then used by zfs create
as default values if they aren't explicitly overwritten.
I know that zpool
allows to set those default values on creation, by using the capital -O
flag:
zpool create -O atime=off -O compression=on ...
That way, all filesystem creation commands can be shortened from:
zfs create -o atime=off -o compression=on ...
to:
zfs create ...
However, what if I didn't set the -O
on zpool
creation? How can I set or change them for an existing pool?
Update
The following command finally worked for me:
zfs set atime=off compression=on zroot
Thanks to @ewwhite and @shodanshok.
You can just use
zpool get all
to show available pool options andzpool set option=
on the desired option.For filesystem options, you view/set them with
zfs get
andzfs set
on either the top-level filesystem or individually on the sub-filesystems (who otherwise inherit the options from the top level).Adding to the answer of @ewwhite, while most properties are propagated to child datasets on creation, so you may have to run it on each pre-created filesystem / zvol manually to make the whole pool have the same properties.