Does Linux have an equivalent to "compress to save space" from Windows? I don't need to save space, I want it for a different purpose.
2026-04-26 19:37 UTC
Replies (18)
-
@Shimitar@downonthestreet.eu 2026-04-26 19:41
This is at file system level… Checkout btrfs and zfs, I am quite positive both can compress like you want. Never used this feature myself, so cannot be more specific. Also, there are some read-only compressed filesystems for Linux that you can also use, they offer best compression but data is read only.
-
@dabu@lemmy.world 2026-04-26 19:45
There’s an interesting project called DwarFS. I have it on my todolist to check it out but as I understand it you basically create a compressed read-only archive that is mountable and readable just like any other disk - github.com/mhx/dwarfs . Maybe this is something for your use case?
-
@tiptoes@sh.itjust.works 2026-04-26 19:54
The equivalent would be either zfs or btrfs compression. Transparent to applications, you don’t have to do anything special other than enable it.
-
@mina86@lemmy.wtf 2026-04-26 20:01
btrfs.readthedocs.io/en/latest/Compression.html You know this takes 5 minutes with web search to find out? Or ask Le Chat.
-
@wltr@discuss.tchncs.de 2026-04-26 20:33
Not sure that’s relevant, but I’m playing around with the obsolete Windows tablets with cheap eMMC disks (one of which is broken, so I replaced it with a no name microSD card, plus USB drive), and I format my disks to f2fs, which theoretically should help with both keeping the disks for longer, and accessing the data faster.
-
@tychosmoose@piefed.social 2026-04-26 20:34
What are you saving on that drive? Many data file formats already have compression of their own and don’t benefit much from file system compression. So if this is for media files, for example, it’s likely to add CPU overhead without a big benefit in transfer speed. ZFS is not installed by default with most Linux distributions due to its license. It’s something you install after the os. Btrfs should work, but I see some discussion online of 128 or 256MB minimum volume size.
-
@corsicanguppy@lemmy.ca 2026-04-26 20:48
The Compress attribute has been in even ext3 since day 1. I’ve never tried it, though.
-
@Ftumch@lemmy.today 2026-04-26 21:49
Sounds like you’re looking for something like # archivemount.
-
@monovergent@lemmy.ml 2026-04-26 21:59
F2FS seems to do what you want, it’ll reserve the original size of your file but compress what’s actually written. Performance numbers might be massively inflated if your writes don’t saturate the cache in RAM. I’ve used BTRFS on SD cards before and it’s mostly fine, but it will struggle massively if over 90% full, or if you have a < 1 GB volume and are, say, frequently updating a handful of files that together take up more than half its capacity. Mostly due to the CoW mechanism, it needs some headroom to make a copy of whatever files are being modified.
-
@daggermoon@piefed.world 2026-04-26 22:47
You could a filesystem that supports compression like ZFS or BTRFS.
-
@HubertManne@piefed.social 2026-04-26 23:39
Never really had the need. My linux install already takes up way less space than my old windows one so I have much more space.
-
@non_burglar@lemmy.world 2026-04-27 01:12
It’s not clear here if you mean block compression, file compression, or stream compression.
-
@doodoo_wizard@lemmy.ml 2026-04-27 04:03
My “I don’t need to save space, I want it for a different purpose” tee shirt is raising a lot of questions answered by my “I don’t need to save space, I want it for a different purpose” tee shirt.
-
@MonkderVierte@lemmy.zip 2026-04-27 10:02
What do you mean, btrfs “takes too much space”? That’s not a sentence that belongs to file system stuff in any way. The disk is the space. You make it usable with a fs, for which you can partition portions of it. And also, i’ve had bad experiences with f2fs long-term stability.
-
@ZkhqrD5o@lemmy.world 2026-04-27 15:50
sudo nano /etc/fstab Then replace “defaults” with “compress=zstd” on your desired partitions. IMO stick with btrfs. Also, the storage space between file systems is exactly the same, given the same hardware.
-
@undrwater@lemmy.world 2026-04-27 23:53
wiki.gentoo.org/wiki/SquashFS This is frequently used for USB drive purposes.
-
@jobbies@lemmy.zip 2026-04-28 06:02
I just want to say that if you are going to either resort to belittling me Having that in the first sentence is like a red rag to a bull you haven’t fully read the post before commenting You could’ve just tldr’d it. Everyone skims nowadays I’m not going to respond to your comment Well that was a big fat lie, wasn’t it.
-
@Diplomjodler3@lemmy.world 2026-04-26 20:21
Just download more RAM.