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


`none' method

The "compression algorithm" in `fs/ext2/none.c' just returns 0, meaning "I couldn't compress this cluster to any smaller than it is, so just store it in uncompressed form."

Changing the method from `none' to some other algorithm (using chattr) makes it apply the new compression algorithm to any uncompressed clusters (and only uncompressed clusters). (This is a special case for the `none' algorithm. Comments welcome on the e2compr list.)

This allows you to defer compression until late at night, so that you won't notice the slowdown.

Here's one example of how it could be used.

Do `touch /timestamp/file; chattr -m none files_and_dirs'. Further writes to these files and within these directories will not use compression. Then, when you want the compression to take place:

find files_and_dirs -type f -newer /timestamp/file -print0 | 
  xargs -0r chattr -m gzip9;
touch /timestamp/file2;
find files_and_dirs -type f -newer /timestamp/file -print0 |
  xargs -0r chattr -m none;
mv /timestamp/file2 /timestamp/file

(Of course `/timestamp/file', `/timestamp/file2' and files_and_dirs should be replaced with whatever's suitable/applicable for you.)

Not a perfect solution, but it's a useful trick.


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