Is it possible to compress a full file system on Linux?

23,350

Solution 1

There are two filesystems I'm familiar with that will give you compression on Linux: BTRFS and ZFS.

ZFS has a big following in the Sun/Solaris, FreeBSD, and FreeNAS communities. It works well on Linux, based on my experience with it. It doesn't come included in any of the big name distributions, but there are add-on repositories that make it very easy to install. See ZFS on Linux

BTRFS is newer and is Linux-only. I've been running it on Ubuntu 14.04 and found it stable. It supports multiple compression methods. I've found LZO compresses fairly well and is really fast; I don't see any performance slowdown from the compression operation.

Solution 2

Btrfs (B-tree file system) is your answer, it has parallels with Ext4, but offers a bigger change in features and design.

It is still relatively new, and majority of the production Linux installations are quite conservative, so you are probably going to have relatively limited community support.

Share:
23,350

Related videos on Youtube

Andreas Hartmann
Author by

Andreas Hartmann

Updated on September 18, 2022

Comments

  • Andreas Hartmann
    Andreas Hartmann over 1 year

    On Windows I can use NTFS drive compression to save heaps of disk space; usually 30%, often much more. It also improves read and write speeds at the cost of higher CPU usage; which isn’t an argument in my situation with CPU power to spare.

    So on my Windows machines it’s always enabled. Is there a similar function on Ext4, or is there a different file system on (Ubuntu) Linux which supports compression? If so, how can I migrate my Ext4 file systems to that compressed file system?

  • Ján Lalinský
    Ján Lalinský about 4 years
    2020 update: ZFS now comes available with Ubuntu, and it is possible to apt install it on Debian and other systems from community repositories.