Ext2 compression extension 0.4.56

Ext2 compression extension is transparent file/directory compression for ext2 via extended attributes.

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!

What's new in Ext2 compression extension 0.4.56:

  • first SMP version. SMP support for at least GZIP algorithm, all other algorithms remain untested! Two workareas, one for compression and one for decompression, defined per CPU.
  • workarea code completly rewritten and moved to fs/ext2/workarea.c
Read full changelog
send us
an update
GPL (GNU General Public License) 
2.6/5 20
Paul Whittaker
ROOT \ System \ Filesystems
Ext2 compression extension (E2compr) is a small patch against the ext2 filesystem that allows on-the-fly compression and decompression. It compresses only regular files; the administrative data (superblock, inodes, directory files etc.) are not compressed (mainly for safety reasons).

Access to compressed blocks is provided for read and write operations. The compression algorithm and cluster size (see section Clusters) is specified on a per-file basis. Directories can also be marked for compression, in which case every newly created file in the directory will be automatically compressed with the same cluster size and the same algorithm that was specified for the directory.

E2compr is not a new filesystem. It is only a patch to the ext2 filesystem made to support the EXT2_COMPR_FL flag. It does not require you to make a new partition, and will continue to read or write existing ext2 filesystems. You should consider it is only a way for the read and write routines to access files that could have been created by a simple utility similar to gzip or compress. Compressed and uncompressed files will coexist nicely on your ext2 partitions.


Basically, a file is compressed with the command `chattr c filename', and decompressed with the command `chattr -c filename'. You can also do `chattr c' (etc.) on a directory. The directory itself won't be compressed, but any new files created in that directory inherit that directory's compress flag and compression algorithm and cluster size.(1)

Use lsattr to see if a file should be compressed or not, and to see what compression algorithm and cluster size will be used.

Use e2ratio to see how much disk space is used by the compressed form compared to the uncompressed form.

You can also try the `-u' or `-r' options to lsattr. (The difference is that, for directories, e2ratio finds the disk usage of the whole directory tree, like du, whereas `lsattr -u' only shows the space taken by the directory file, like `ls -s'.)

Last updated on September 3rd, 2008

#directory compression #ext2 filesystem #directory #compression #ext2

Add your review!