e2compr: 0.3.x Software

Wayback MachineAbout this captureCOLLECTED BY Organization: Alexa Crawls Starting in 1996, Alexa Internet has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to the Wayback Machine after an embargo period. Collection: Alexa Crawls DE Crawl data donated by Alexa Internet. This data is currently not publicly accessible TIMESTAMPSloadingThere is an Australian partial mirror of these pages at http://cvs.bofh.asn.au/e2compr/.

You may like to see the announcement ofpre0.3.5.

Kernel patches


e2compr patch forkernel 2.1.93 and above. Yes, this really is the most recent kernel I’ve released a 0.3 patch against. So far no-one’s complained; I think most/all people who use 2.1 (or 2.2) kernels have switched to e2compr-0.4. If do want to use e2compr-0.3.x with Linux 2.2, then say so, though you should consider switching to e2compr-0.4.x, which fixes a couple of bugs.

e2compr patch forkernel 2.1.78.

e2compr-pre0.3.5patch for 2.1.48–2.1.77. Patch made against 2.1.71.Probably works for most 2.1 kernels above 2.1.47.

e2compr-pre0.3.5 patch forkernel 2.1.42. Only tested it with 2.1.42.


e2compr-0.3.9 patch against 2.0.35

e2compr-0.3.8 patch against 2.0.30. Only difference from 0.3.7 is for 26-bit ARM users (and anyone else with a page size > 8KB).

e2compr-0.3.7 patch against 2.0.34. Only differences from the below (other than patching cleanly against fs/Config.in) is for ext2 quotas and enabling assembly versions of some compression algorithms.

e2compr-0.3.6 patch against 2.0.32.

e2compr-pre0.3.5 patch for2.0.x kernels. Patch made against 2.0.29, but should workwith almost all 2.0 kernels less than 2.0.31.

See also older releases.

patches to patches: inode.cpatch

Here is a patch that should correct a long-standing bugthat affects mainly new e2compr users. This patch should be appliedafter the appropriate main e2compr patch. Here’s a version for2.1.4x/e2compr-pre0.3.5 and here’s one for 2.0/e2compr-pre0.3.5. Themost recent e2compr patches already have this patch applied.

Other software

e2fsprogs: e2fsck, chattr, lsattr, etc.

This used to be distributed with the “ancillary” package below, but has now been moved to a separate e2fsprogs page.

E2compr ancillary programs anddocumentation

The binaries in the below are x86/ELF. Source is included in thebelow packages.

Note that current versions of e2fsprogs (e2fsck etc.) are available on the e2fsprogs page.



A description of the software components is below.


All the newer e2compr patches include support for an algorithm derived from that used by the bzip2 program.

Software descriptions

Kernel patch

The kernel patch is the heart of e2compr; it is the only thing that isabsolutely required to use e2compr.

The 2.0 kernel patch has been confirmed to work on 2.0.7 through2.0.33. If you want a patch for 1.2.13, you might as well useAntoine’s version of the patch; but then, you should probably upgradeto kernel 2.0 anyway.

The current 2.1 kernel patch has necessarily been tested for ashorter period of time than the 2.0 patches, because it keeps needingchanges to adapt to the latest 2.1 fad…. However, a number ofpeople do use e2compr with 2.1 kernels.

Lsattr, chattr

These are replacements for the lsattr andchattr from the standard e2fsprogs distribution. Themain difference is the ability to display or set the compressionalgorithm and cluster size.

In more detail: The standard e2fsprogs lsattr andchattr only allow you to see or set whether or not a fileis stored in compressed form. If you use the standard e2fsprogschattr to enable compression, then the defaults (as setat kernel compile time in ext2_fs.h, or in the kernelconfiguration stage for recent test kernels) are used for cluster sizeand compression algorithm.

e2compress, e2decompress

`e2compress’ is just another way of achieving`chattr +c’ (or `chattr -c). Unlike`chattr +c’, `e2compress’ creates a new filefor the compressed file, deleting the original once the compressionhas been verified. The advantage of this is that the newly createdfile needn’t be fragmented. (You may also consider it an advantagethat the transformation is verified.) It should also be safer in thecase that your machine is switched off (etc.) part way throughcompression (because the original file should still be on on the harddisk). Another difference from `chattr +c’ is that thecompression occurs in user space rather than kernel space. Thedisadvantage is that you need to have space on your hard disk for bothto exist simultaneously.


You need to use this modified version of e2fsck iff you have enabledindirect blocks for the cluster bitmap. By default this is disabled,so you can continue to rely on the standard e2fsck, but only the fewdozen kilobytes (the first 16 clusters, to be precise, which is asmuch as 512KB if you set the cluster size to the maximum, 32KB) ofeach file can be compressed in this case.

e2fsprogs source patch

This modifies e2fsck, lsattr, chattr, and the ext2 library. (Maybe adefragmenter would work if compiled with this library? I haven’ttried.)

Alternative chattr source

This alternative chattr.c is derived from Antoine’schattr. See comment at the head of the source file. The reason Iinclude this is in case I accidentally introduce some bugs as I tinkerwith the other one. Also there are things I like among Antoine’smodifications that haven’t yet been merged back into the standardchattr.

The reasons I’m keeping the other chattr as close as possible to thestandard chattr are:

  1. smaller patch, so easier to see what the changes are,and easier to con[vince] the maintainer of e2fsprogs to accept thesechanges into the official version;
  2. incorporation of features both present and future that aren’tpresent in the chattr here (e.g. autoconf, verbose operation).

Old Software

Due to space restrictions, the netspace mirror doesn’t keep much of the older software. Try the captechmirror of this page if you get a`file not found’ error with any of this. On a related note, if whatyou want isn’t below, you could try mailing me.

Antoine’shome page contains links to the work that was done before I got myhands on it, and possibly a couple of things since.

Old kernel patches

e2compr-pre0.3.5patch for kernel 2.1.59. Seems to work with kernels up to (butnot later than) 2.1.67.

e2compr-pre0.3.5patch for kernel 2.1.48. This patch isn’t as good as the 2.1.59one. If you must use a 2.1.x kernel for 42 < x <59, then you should probably use the 2.1.59 patch. (You may find one.rej file, but that can easily be applied by hand.) Theonly good reason for leaving this patch here is that it is possiblethat the 2.1.59 patch introduces a race, in which case this 2.1.48patch would be better. Why this 2.1.48 patch is bad: Files only getcompressed when shrink_dcache() in the kernel is called,which happens when the system needs more memory or when the filesystemis umounted.

e2compr-0.3.1 patch forkernel 2.1.42. Tested for about 5 minutes, seems to work.Don’t use this patch on non-little-endian machines.

Credit for adapting e2compr-0.2-patch-2.0 to work under 2.1kernels goes to Tom Lees. [Incidentally, previously I said on thispage that the adaptation was likely to be trivial. Apparently thiswas not the case; I’d forgotten about the change to access of userspace from kernel space; and possibly other things.]

Return to Main Entrance
e2compr maintainersLast modified: Mon Mar 6 10:44:16 EST 2000