Go to the first, previous, next, last section, table of contents.


Installation instructions for e2compr-0.4.x

Minimum things to download to start with: e2fsprogs, the appropriate kernel patch, and this user manual. (At a bare minimum, you need to read the section Quickstart page.)

In brief:

  1. Install the e2compr version of e2fsprogs (e2fsck & friends). The e2compr version of e2fsck works fine for non-e2compr filesystems, but the non-e2compr version of e2fsck will refuse to check e2compr filesystems.
  2. Apply the appropriate e2compr patch to your kernel source.
  3. Reconfigure the kernel, answering `y' to CONFIG_EXPERIMENTAL, `y' (or `m') to the ext2 filesystem, and `y' to ext2 compression.
  4. Compile the kernel. While this is happening, read the section Quickstart section of the user manual. (If you've followed the above steps, you can start using e2compr as soon as you reboot to this new kernel.)
  5. At your leisure, install the other e2compr software: the modified versions of `e2defrag' (if you use that) and `find', and the `e2c-ancil' package. (These can all be found in the SourceForge download area).

Detailed Instructions

The remainder of this appendix goes into more detail on the above steps. Note that what follows may be out of date in a few places.

This section is organised into 3 parts: how to build a new kernel; how to build and install the utilities; how to update e2fsck.

Getting & Installing e2fsprogs

The e2compr version of e2fsprogs can be found in the SourceForge download area.

The instructions for building e2fsprogs from source follow, for those for whom no prebuilt binaries are available on the web site.

Assuming you don't already have the full source code to standard e2fsprogs-1.14, get `e2fsprogs-e2c-1.14.6.tar.gz' (or whatever the current version on the web site is). If you use Debian, then also get `e2fsprogs-e2c_1.14.6-1.diff.gz'.

Extract the tar file:

$ tar xzf e2fsprogs-e2c-1.14.6.tar.gz

cd into the newly-created `e2fsprogs-e2c-1.14.6' directory.

If you use Debian, then do:

$ gzip -cd e2fsprogs-e2c_1.14.6-1.diff.gz | patch -p1
$ chmod 755 debian/rules
$ ./debian/rules build
$ fakeroot -c ./debian/rules binary
$ cd ..
$ ls -ltr *.deb     # Check that you want to install all of them.
$ su
# dpkg -i *.deb

(If you do not have fakeroot, then do `su' and run `./debian/rules binary' from inside the root shell.)

If you do not use Debian, then do the following:

  1. Rebuild e2fsck, as described in the file `INSTALL' from the e2fsprogs distribution. Make sure that the test suite is passed without any problem.
  2. Install the new e2fsck so that this will be the one used the next time your machine needs it. Note: using the `make install' of e2fsprogs will not back up your existing e2fsck, so you may wish to do that manually beforehand.

Updating the kernel

E2compr is a patch against the ext2 fs code. You just have to apply the patch (gzip -cd patch-file | patch -d /usr/src/linux -p1) and recompile your kernel.

Here are more detailed instructions. I assume you have the correct permissions for everything (e.g. by running the commands as root), and that you are in the directory that was created after extracting the e2compr archive (i.e. the directory where you find this file).

  1. First, check if you have the correct kernel sources and patch. E2compr kernel patches are available from the download area. (If you have a kernel older than 2.0, then take a look at Antoine's page (or upgrade your kernel).) In the following text, patch-file will refer to the correct patch file for your kernel version.
  2. The following shouldn't be necessary, but if you want to be really safe then you can check that your ext2 filesystems do not already contain any files with the compressed attribute. There probably won't be any such files (unless you've been playing with chattr before), and even if there are, there shouldn't be a problem, because the i_reserved2[] fields (which hold the bitmap) should be zero. But to be really safe:
    find mountpoints -xdev \( -type f -o -type d \) -print0 | 
    xargs -0r lsattr -d | grep -v '^..-'
    
    where mountpoints might be `/ /usr' or ` `grep ext2 /etc/mtab | cut -d\ -f2` '. (That's two spaces after `-d\', and the back-quote before `grep' and after `-f2' are included.) If there are any compressed files, then try to find why, and to turn it off (e.g. by doing chattr -c).
  3. Check for existing patch cruft, so that you can identify what cruft was created by the e2compr patch. Assuming that your linux source tree is in /usr/src/linux, do:
    $ find /usr/src/linux/. -path '*.orig' -ls
    $ find /usr/src/linux/. -path '*.rej' -ls
    
    For most people, these either produce no output, or lots of `*.orig' files but no `*.rej' files. The first of these commands displays backups from earlier patching; the second displays the results of previous bad patching. If any `*.rej' files are found, then look carefully at them: they may mean that there are existing problems in your kernel source tree.
  4. Apply the patch. If your kernel source tree is in the directory /usr/src/linux, you can do:
    # gzip -cd patch-file | patch -d /usr/src/linux -p1
    
    Note: if you have a previous version installed, you will first need either to uninstall that one with gzip -cd old-patch-file | patch -d /usr/src/linux -R -p1, or else to start with a clean kernel source tree.
  5. Verify if the patch has been correctly applied:
    $ find /usr/src/linux/. -path '*.rej' -print
    
    If this command displays any file names, the patch has not been correctly applied. (Probably you don't have a clean kernel source tree or you have the wrong kernel version.) Either try to get a matching clean source tree and e2compr patch and start again, or look at the .rej files and try to patch manually. If neither of these is practical then you can cancel the effect of applying the patch at step 3 with the command gzip -cd patch-file | patch -R -d /usr/src/linux -p1.
  6. Remove the original files. (This is completely redundant with recent (>= 2.4) versions of patch, and optional with older patch versions.)
    $ find /usr/src/linux/. -path '*.orig' -exec rm {} \;
    
  7. Tune the configuration. Most of the configuration options can now be set by running make *config:
       $ cd /usr/src/linux
       $ make config
    or $ make oldconfig
    or $ make menuconfig
    or $ make xconfig
    
    See `/usr/src/linux/README' if you don't know which *config you want. The only option that isn't set during `make *config' is that you can define various things in `fs/ext2/debug.h' to control what goes to your kernel log.
  8. Update dependencies:
    $ cd /usr/src/linux
    $ make clean; make dep
    
  9. Build your kernel:
       $ cd /usr/src/linux
       # make zlilo
    or $ make zImage
    or # make zdisk
    or whatever you usually do when rebuilding your kernel.
    
  10. Reboot your machine:
    # shutdown -r now
    (or however you usually do it)
    
  11. That's all. There is no need to change the fstab, nor to repartition your disk.

Building utilities

ELF binaries of the utilities are included in the distribution. (cd to the directory named `prebuilt', examine the makefile, type `make install'.)

However, if you wish to rebuild from source, follow the following instructions.

To build everything from source, you will need to have the source for e2fsprogs, which should be available for ftp from ftp.ibp.fr and tsx-11.mit.edu in /pub/linux/packages/ext2fs .

Apply the e2fsprogs patch.

$ tar xzf e2fsprogs-1.14.tar.gz
$ cd e2fsprogs-1.14
$ patch -s -F0 -p1 < somewhere/e2fsprogs-1.14-patch

Then just follow the instructions included with e2fsprogs.

Note: You may wish to keep a copy of the old lsattr and chattr, in case you want to de-install the patch. (Myself I wouldn't bother, because the new ones should work fine on an unpatched system.)


Go to the first, previous, next, last section, table of contents.