.\" -*- nroff -*- .TH E2COMPRESS 1 "April 1997" "E2Compress Utilities" .SH NAME e2compress, e2decompress \- compress file in a format readable by the kernel on a Linux second extended file system .SH SYNOPSIS (N.B. This manual page is not up to date. The results of `e2compress --help' are reasonably correct, as is the information in the Texinfo file: *See (e2compr)e2compress.) .B e2compress [ .B \-vf ] [ .B -m algorithm_name ] [ .B -b cluster_size ] [ .B -S suffix ] .I files ... .PP .B e2decompress [ .B \-vf ] [ .B -S suffix ] .I files ... .SH DESCRIPTION .B e2compress compresses the files directly into the format readable by the kernel on a second extended file system. Unlike .B chattr +c, .B e2compress does the compression jobs in the user space. This may have some advantages. .B e2compress opens the file it is working on, and creates a new temporary file (whose name is derived from the original file by adding .B suffix (`~z~' by default)) for which the automatic compression will be turned off. It then reads from the input file, compresses each cluster in memory, verifies the compression by decompressing to a work area and comparing with the original, and then writes the compressed data to the temporary file, using the lseek() system call to create the necessary holes as it goes. When it is done, automatic compression is turned on again for the temporary file, and the temporary file is renamed to replace the original file. .LP When .B e2decompress or .B e2compress -d is called to decompress a file, we create a temporary file, remove the compression attribute, attempt to disable automatic decompression on the input file, and do decompression in user space, performing some checks on the way. .LP Using .B e2compress instead of .B chattr +c has some advantages. The main one is that the resulting file will not be fragmented as it would be with .B chattr : this comes from the fact that .B e2compress does not free some blocks as the kernel would do. Also, the compression is done in the user space. Some people may consider it is better. .B e2compress is also more safe, since the compressed data is immediatly checked for decompression. .LP One disadvantage of using .B e2compress is that the original file and the temporay must coexist. This may be not possible if the file system is completely full. .B chattr +c will work even on a completely full file system. .SH OPTIONS .TP .I -m algorithm_name Set the algorithm used for compression. Valid algorithms are the same as for the .B chattr utility. .TP .I -S suffix Uses the provided suffix to create the temporary file, instead of the default suffix (which is `~z~'). .TP .I -b cluster_size Set the cluster size (measured in filesystem blocks) for compressed files. Valid sizes are the same as for the .B chattr utility. .TP .I -c Compress files. This is the default behaviour, unless the program is called under the name .B e2decompress .TP .I -d Decompress files. .TP .I -f Force compression. If this flag is not used, .B e2compress will stop if the input file has more than one link, or if the temporary file already exists. If this flag is used, .B e2compress will continue. No verification will be performed when you use this flag. .TP .I -h Display a short help message. .TP .I -v Display some statistics about clusters. .SH AUTHOR .B e2compress was first written by Antoine de Maricourt , and has been extensively modified by Peter Moulder . .SH BUGS AND LIMITATIONS This program still isn't finished -- but it's now ready enough that the author uses it to compress directory trees (find DIRS -type f -print0|xargs -0 e2compress -mgzip9 -b32). .LP The precise behaviour of this program in certain circumstances has changed. This will continue to occur until it is considered `finished' in some sense. .LP Any writes to the file while e2compress is in action (that is to say after e2compress has read the file but before the file is replaced with the compressed version) are lost. (For decompressing, no writes are possible because the NOCOMPR flag is set on the input file, which prevents any other processes from having the file open.) In both cases (compressing and decompressing) the results of ,any `chmod', `chown' or `touch' operation during this period` will be lost. .SH AVAILABILITY The latest release of this program is available from the e2compr home page, .SH SEE ALSO .BR chattr (1) , .BR e2ratio (1) , .BR lsattr (1)