Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change default zfs options of a zpool?

How do I change the default options for zfs filesystems on an existing zpool?

The zpool manual tells me how to set such options on creation (note the -O instead of -o to distinguish filesystem options from pool options):

zpool create -O atime=off -O compression=on ...

That way, future 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 pool creation? How can I set or change them for an existing pool?

like image 673
vog Avatar asked Dec 08 '25 10:12

vog


1 Answers

You can set them on the top-level dataset in the pool, like this:

zfs set compression=on <name of pool>

After that, all child datasets you create inside that will inherit those properties.

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. You can use the same command for that, just substitute in the dataset name you need to update the property for.

like image 135
Dan Avatar answered Dec 10 '25 15:12

Dan