When mounting a BTRFS filesystem with the compression option, BTRFS will selectively compress files depending on whether they are deemed compressible or not.

Does this same logic apply when defragmenting? Or does the following force compression?:

btrfs filesystem defragment -r -czstd /data
# btrfs version
btrfs-progs v4.19

1 Answer 1


From the BTRFS Wiki:

How can I recursively compress/uncompress a directory (including guessed/forced-compression)

Uset the btrfs filesystem defrag command, the option -r will process the files recursively in a directory. This is independent of the mount options compress or compress-force, and using the option -c you can set the compression algorithm.

Currently (v4.14), it's not possible to select "no compression", using the defrag command. This may change in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.