The canonical location of these pages is at http://e2compr.memalpha.cx/e2compr/.

0.4.x Software

Notes for 0.4.x.

  1. The file format of 0.4.x is different from that of all previous releases.
  2. You need to have the special e2compr-0.4.x version of e2fsprogs (i.e. e2fsck, chattr, lsattr, libext2fs, libe2p). The e2compr-0.3.x version will not do.
  3. There is no e2compress program for 0.4.x yet. Do not try to use the 0.3.x version. If you have the 0.3.x version around, remove it or archive it (so that you don't run it accidentally).
  4. You must enable CONFIG_EXPERIMENTAL in your kernel config in order to use e2compr. (This is in preparation for integration into standard kernel.)
  5. e2compr-0.4.x patches are not available for Linux 2.0 (and might never be).
  6. Keep an eye on your kernel log (probably either /var/log/kern.log or /var/log/messages; see /etc/syslog.conf to know which). If there are any strange messages, particularly any `Assertion failed' messages, then please write to the e2compr maintainer. Also it would be wise to reboot, as there is no error handling for failed assertions, so bad things could happen.

Kernel patches

(If you downloaded 0.4.21 during the short time that it was available here, be sure to upgrade or downgrade.)

E2compr-0.4.38 includes the fix to the truncate problem (previously seen mainly with samba), as well as the nfsd problem.
e2compr-0.4.38 patch against kernel 2.2.16.
e2compr-0.4.38 patch against kernel 2.2.15.
e2compr-0.4.38 patch against kernel 2.2.14.
e2compr-0.4.38 patch against kernel 2.2.13.
e2compr-0.4.38 patch against kernel 2.2.12.
e2compr-0.4.38 patch against kernel 2.2.11.
e2compr-0.4.38 patch against kernel 2.2.10.
e2compr-0.4.38 patch against kernel 2.2.9. Should also work for 2.2.8.

Note: From now on, all patches will be compressed with bzip2.

e2compr-0.4.30 patch against kernel 2.2.7. Also works for 2.2.6.
e2compr-0.4.30 patch against kernel 2.2.5.

e2compr 0.4.30 is the first e2compr patch to exclude the LZRW algorithm. If you still have files compressed with the lzrw algorithm, see LZRW algorithm.

e2compr-0.4.29 patch against kernel 2.2.3.

e2compr 0.4.29 includes:

Patches against linux-2.3

Note: there are significant changes in kernels 2.3.7, 2.3.8, and it will take a while to produce an updated e2compr patch for them. For the moment, stick with 2.3.6.

e2compr-0.4.34 patch against kernel 2.3.6.
e2compr-0.4.34 patch against kernel 2.3.2.
e2compr-0.4.33 patch against kernel 2.3.1.

Older patches

e2compr-0.4.28 patch against kernel 2.1.132.

e2compr-0.4.27 patch against kernel 2.1.131. Fixes "unsupported inode size" problem reported by Junichi Saito.

e2compr-0.4.24 patch against kernel 2.1.126. Includes modularization of the compression algorithms, thanks to Jan Rêkorajski baggins@hunter.mimuw.edu.pl. I wouldn't place a lot of trust in this version. In particular, there are some things with SEPARATE_WORK_AREAS that I'd like to check. Stick to 0.4.18 if you're timid.

Obviously you shouldn't compress the gzip.o module with the gzip algorithm, but I'd be interested to know what happens if you compress it with some other compression method that's also a module. If it causes a problem, post a note to the e2compr mailing list.

e2compr-0.4.18 patch against kernel 2.1.125. Includes working LZO support.

e2compr-0.4.15 patch against kernel 2.1.115. Includes fix for `deadlock on core-dump' problem.

e2compr-0.4.12 patch against kernel 2.1.105. Probably suitable for kernels 2.1.101--106.

If you have a 2.1 kernel before 2.1.101, then either upgrade your kernel (preferable) or ask me for a patch against whatever kernel you use. The 0.4.12+ patches include a bug fix not present in earlier versions.

There is little feature difference between the following patches; the differences are due to changes in the rest of the kernel. There are slight changes in 0.4.9.

e2compr-0.4.9 patch against kernel 2.1.103. Suitable for kernels 2.1.101 and up.

e2compr-0.4.7 patch against kernel 2.1.101. Probably useless now -- use the above patch instead.

e2compr-0.4.6 patch against kernel 2.1.98. Probably suitable for kernels up through 2.1.100 (except for arch/ppc/defconfig).

e2compr-0.4.6 patch against kernel 2.1.94. This patch should be suitable for 2.1.93--7.

e2compr-0.4.5 patch against kernel 2.1.89.

e2compr-0.4.4 patch against kernel 2.1.88.

LZRW Algorithm

LZRW is an optional extra compression algorithm for e2compr. If you don't already use lzrw3a, then there's no reason to start. LZRW3a is somewhere between lzv1 and gzip2 in amount of compression and speed.

The main reason that it is excluded from the main e2compr patch (from e2compr 0.4.30 and up) is that the lzrw3a compression method is patented in some countries (including the US), which restricts its use -- and correspondingly conflicts with the GNU GPL.

Here's the patch: e2compr-lzrw-patch.bz2. It should apply cleanly to all e2compr patches from 0.4.30 upwards. (I.e. apply the main e2compr patch before this LZRW patch.)

If you want to change all lzrw-compressed data to be compressed with, say, lzv1, then do (as root):


mountdevs=`grep ext2 /etc/mtab |
   cut -d' ' -f 1 |
   tr '\n' ' '`
for i in ${mountdevs}; do
  if dd if=$i bs=1 skip=1224 count=1 |
    od |
    sed -n '1s,.*\(...\),\1,p' |
    grep '^..[2367]$' > /tmp/curr-algs
  then
    dir=`grep "^$i " /etc/mtab |
      cut -d' ' -f 2`
    echo "Recompressing all of $dir filesystem..."
    if find ${dir} -xdev -attr +cB -printf \
'=\0=\0=\0=\0=\0%p\0=%E\0-m\0%M\0-b\000%B\0%p\0'|
      sed s/lzrw3a/lzv1/g |
      xargs -0 -r -n 6 chattr
    then
      echo "Marking lzrw as not in use on ${i}..."
      sed 's/2$/0;s/3$/1/;s/6$/4/;s/7$/5/' \
        < /tmp/curr-algs \
        > /tmp/new-algs
      printf '\'`cat /tmp/new-algs` | 
        dd of=$i bs=1 seek=1224 count=1
      echo "Done ${i}."
    else
      echo "chattr failed under $dir: xargs exited with $?"
    fi
  else
    echo "lzrw not used on $i"
  fi
done

That will take some time, as it takes the precaution of decompressing then recompressing even files that ostensibly don't use the lzrw algorithm. (If lsattr says gzip9, the file could still have one or more lzrw-compressed clusters; the `gzip9' just means that future writes to that file will be compressed using gzip9.)

Note that the above script writes directly to the filesystem (dd), and hasn't been tested... You may prefer just downloading the LZRW patch.

Note too that an unfortunate side effect of the above script is that it decompresses all files marked with compression method none (or defer). I suppose that could be corrected by being clever with the sed filter applied to the find -printf output: replace all pairs of sextuplets (meaning 6 null-separated items) involving `defer' with three sextuplets where the first is all `=', the second compresses with gzip9 (or whatever), and the third sets the compression method back to `defer'.

e2fsprogs

e2fsprogs software (e2fsck, chattr, etc.) is now on a separate page.

e2defrag (ext2fs defragmenter)

e2defrag information is now on a separate page.

Ancillary Programs

The e2c-ancil package contains e2ratio, e2bitmap, and clear-e2c.

e2ratio is like du, but also shows how much space would be taken up if each file weren't compressed. Also shows percentage compression.

e2bitmap shows which parts (clusters) of a file are compressed and uncompressed.

clear-e2c allows you to remove the e2compr flag from the superblock of an ext2 filesystem, so that you can mount the filesystem under non-e2compr kernels. (You should decompress all files before using this unless you know what you're doing. See the man page.)

e2c-ancil_0.4.1-1_i386.deb: Debian i386 package (binaries). Linked against glibc2.1.

e2c-ancil_0.4.1.orig.tar.gz: Source (without Debian parts).

e2c-ancil_0.4.1-1.diff.gz: Debian diffs to source.

Documentation

These three are equivalent:

See also Documentation/filesystems/ext2_compression and fs/ext2/ChangeLog.e2compr in your kernel tree.


Return to Main Entrance
e2compr maintainers
Last modified: Fri Jun 9 13:16:36 EST 2000