The canonical location of these pages is at

0.3.x Software

You may like to see the announcement of pre0.3.5.

Kernel patches


e2compr patch for kernel 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 for kernel 2.1.78.

e2compr-pre0.3.5 patch 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 for kernel 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/ 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 for 2.0.x kernels. Patch made against 2.0.29, but should work with almost all 2.0 kernels less than 2.0.31.

See also older releases.

patches to patches: inode.c patch

Here is a patch that should correct a long-standing bug that affects mainly new e2compr users. This patch should be applied after the appropriate main e2compr patch. Here's a version for 2.1.4x/e2compr-pre0.3.5 and here's one for 2.0/e2compr-pre0.3.5. The most 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 and documentation

The binaries in the below are x86/ELF. Source is included in the below 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 is absolutely required to use e2compr.

The 2.0 kernel patch has been confirmed to work on 2.0.7 through 2.0.33. If you want a patch for 1.2.13, you might as well use Antoine's version of the patch; but then, you should probably upgrade to kernel 2.0 anyway.

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

Lsattr, chattr

These are replacements for the lsattr and chattr from the standard e2fsprogs distribution. The main difference is the ability to display or set the compression algorithm and cluster size.

In more detail: The standard e2fsprogs lsattr and chattr only allow you to see or set whether or not a file is stored in compressed form. If you use the standard e2fsprogs chattr to enable compression, then the defaults (as set at kernel compile time in ext2_fs.h, or in the kernel configuration stage for recent test kernels) are used for cluster size and compression algorithm.

e2compress, e2decompress

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


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

e2fsprogs source patch

This modifies e2fsck, lsattr, chattr, and the ext2 library. (Maybe a defragmenter would work if compiled with this library? I haven't tried.)

Alternative chattr source

This alternative chattr.c is derived from Antoine's chattr. See comment at the head of the source file. The reason I include this is in case I accidentally introduce some bugs as I tinker with the other one. Also there are things I like among Antoine's modifications that haven't yet been merged back into the standard chattr.

The reasons I'm keeping the other chattr as close as possible to the standard chattr are:

  1. smaller patch, so easier to see what the changes are, and easier to con[vince] the maintainer of e2fsprogs to accept these changes into the official version;
  2. incorporation of features both present and future that aren't present 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 captech mirror of this page if you get a `file not found' error with any of this. On a related note, if what you want isn't below, you could try mailing me.

Antoine's home page contains links to the work that was done before I got my hands on it, and possibly a couple of things since.

Old kernel patches

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

e2compr-pre0.3.5 patch for kernel 2.1.48. This patch isn't as good as the 2.1.59 one. 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.) The only good reason for leaving this patch here is that it is possible that the 2.1.59 patch introduces a race, in which case this 2.1.48 patch would be better. Why this 2.1.48 patch is bad: Files only get compressed when shrink_dcache() in the kernel is called, which happens when the system needs more memory or when the filesystem is umounted.

e2compr-0.3.1 patch for kernel 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.1 kernels goes to Tom Lees. [Incidentally, previously I said on this page that the adaptation was likely to be trivial. Apparently this was not the case; I'd forgotten about the change to access of user space from kernel space; and possibly other things.]

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