*Edit: I have figured out how to use BTRFS and get it to compress files, and I’m going to use that on most of my old storage devices. The only problem I’m having is that I want to use F2FS on my oldest storage device but I can’t get files to compress and I’m not getting any error messages to try and fix it. Based on what the documentation says, I’m supposed to do something like this:
sudo mkfs.f2fs -f -O extra_attr,inode_checksum,sb_checksum,compression /dev/mmcblk0p1
sudo mount -o compress=zstd,compress_extension=* /dev/mmcblk0p1 '/home/j/mountpoint/128mb'
chattr -R +c '/home/j/mountpoint/128mb'
The device will mount like this but files aren’t compressing when added, nor are they compressed if using the last command after they’ve been moved.*
Old: As I mentioned in the title, I’m not looking to save space, I want to test something. In Windows, you could use this option on a folder and still access the contents and run executables while keeping the folder and it’s contents compressed. The benefit to doing this, outside of saving space, is that files could potentially be accessed faster on slower storage devices.
As I’ve been trying to get the most out of some old storage devices I have, I think that something like this would be a great option for this. The only problem is that I’ve tried looking online for a way to do this but search engines are terrible. So, I’m posting about this here in case someone knows of a way to do this.
I forgot to specify this but I’m trying this for gaming. I know it’s not recommended to this but as a result, I mostly need something that’s not read-only. It might work fine for some games but this obviously wont work for all games.


I read the page you linked to but I have no idea what I’m supposed to do with it. If it’s talking about using the “mount” command, I’ve already used that and even though I specifically enabled zstd as the compression method, files aren’t being compressed. I know this because I’m using a file that’s slightly larger than the free space but it’s still giving errors about not having enough space.
That is not a good method for testing. Maybe the filesystem still requires new files to be smaller than free space. Or maybe the file could be not really compressible, for example, you won’t be able to compress random data. You also won’t compress already compressed data, like videos.
You could write a real text file of some kB and then check the compression ratio with something like “compsize”.
The mount command mounts the disk with the options you give to it but only once. Now, because you don’t want to manually run mount everytime you use your disk, you must set it up so it is always mounted with the options you want. Udisks2 is one of the tools for that.
edit: apparently compsize is btrfs only. You can use “du” with and without --apparent-size and check the differenze
I used a folder full of smaller files and it still isn’t compressing them. I’ve tried everything I can find or was told to do with f2fs but I cannot for the life of me, get files to compress. Btrfs works and files are compressing but it takes up so much space on the sd card.