kdave / btrfsmaintenance

Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag on selected mountpoints or directories.
GNU General Public License v2.0
869 stars 76 forks source link

Allow configurable compression algorithm for btrfs-defrag #86

Open yitzhaq opened 3 years ago

yitzhaq commented 3 years ago

From the btrfs-filesystem man page, defrag section:

-c[<algo>]
    compress file contents while defragmenting. Optional argument selects the compression algorithm, zlib (default), lzo or zstd. Currently it’s not possible to select no compression. See also section EXAMPLES.

I read this as meaning that, when defragging, compression will always be applied. Since there currently is no way in btrfsmaintenance to specify a value option or a corresponding value, zlib is used, which may not be desirable. It would be great if this was a configurable option in the defaults file, so you could select e.g. zstd.

boniek83 commented 3 years ago

This is surprising. I wouldn't expect that defrag will change my compression settings. Default should be whatever is set in fstab. I was expecting this to be the case.