Software not doing file compression in BTRFS partitions

Hello. Thanks for reading my topic.
Here is Lubuntu 24.04.3 kernel 6.14.
BTRFS partition was mounted enabling compression in fstab ( compress-force=zlib:9 ).
Double Commander doing file operations in that BTRFS partition not does file compression for any file, but if using other file manager for example PCMANFM-QT and others softwares ( text editors ) is done file compression.
Using in terminal compsize show the compression used in directories.

I have done tests using Double commander in paths below, starting in root and apparmor disabled having the same results :

/home/username/doublecmd
/opt/doublecmd
/usr/bin using an symbolic link
/usr/local/bin

Perhaps Double Commander are using an internal own file operation code or for security the OS not are allowing file compression if using it.
Have any way to fix it ? OS have any configuration to allow that software to do any file operation without restrictions ?

Have a nice week.

There is no file compression in BTRFS; it’s transparent block (extent) compression, thus it doesn’t matter which software you use. All you have to do is write data to the filesystem and it will be compressed, if it’s compressible. There is a problem, however, with displaying the file size; since it’s transparent compression, high-level file managers don’t have a way of knowing the compressed size, hence compsize.

You should also probably not be using the 6.14 kernel anymore, it’s EOL. The current HWE kernel is 6.17. But that’s just an aside, unrelated to your issue.

Please, show how you checked that compression was (or was not) used. The full commands and their complete output. And explain where in this output was indicated that compression was not used.

1 Like

Thanks for all replies.

I had noticed that issue when copyng using others softwares.

I want use file compression transparent, but not is done it with Double Commander.

Perhaps the OS are blocking compression for security.

I had used compsize to figure it.

How did you reach that conclusion? You have to stop this style of communicating. This is Support and Help; we can’t help when you don’t provide info.

The way the transparent block compression works has nothing to do with the program you use, otherwise it wouldn’t be transparent. But videos, audio and pictures are mostly incompressible, because they are already compressed.

@peterwhite23

Create a directory a copy file easily compressible for example high number of TXT , PDF and others similar. Not any video or exe.

Use compsize or compsize-gtk and select the directory so is showed not any compression.

Repeat the same action using other file manager ( PCManFM) and will be showed the files are compressed.

Did you actually copy files (by reference) or did you generate/download new ones or copy them from outside of your current btrfs instance?

It matters as your filesystem will copy by reflink and in that case it will not recompress blocks (AFAIK).

In your new directory, what happens if you do this? Show full command and output with compsize, stop letting us guess what you did and what you saw.

cat /some/existing/file.txt > newdir/should_be_compressed.txt