test veritas logo



vxcompress - compress or uncompress files




vxcompress [ -v ] [ -r ] [ -t type ] [ -b bsize ] [ -n numthreads ] { filename ... | - }

vxcompress -u [ -v ] [ -r ] [ -n numthreads ] { filename ... | - }

vxcompress -l [ -v ] [ -r ] { filename ... | - }

vxcompress -L [ -v ] [ -r ] { filename ... | - }

vxcompress -a


The vxcompress command compresses or uncompresses files, or reports on compressed files.

Files compressed by the vxcompress command do not get a new name. The files do not change size, as reported by the stat command or the ls -l command. However, the number of blocks allocated to the file as reported by the stat command or the ls -s command may be significantly reduced, depending on the compressibility of the data.

Files compressed by the vxcompress command can be accessed in the same way that they were accessed before being compressed. Reads return uncompressed data, but the compressed data on disk does not change. Writes cause a portion of the file to be uncompressed on disk. However, both reads and writes are slower to compressed files. Generally, the best files to compress are ones that are rarely accessed.

Once a file is compressed, the vxcompress -l command shows the file as compressed, even if all extents have become uncompressed due to writes. The file shows as uncompressed only with the vxcompress -u command. You can compress a compressed file, as long as you supply the same compression parameters (algorithm, strength, block size). This is how the uncompressed extents can get compressed again. However, attempting to compress a compressed file using different parameters results in an error. To change compression parameters, use the vxcompress -u command to uncompress, and then use the vxcompress command with the new parameters.

Some files are incompressible. If invoked on such a file, the vxcompress command claims to have compressed the file, but the vxcompress -l command will show 0% savings.

Cluster File System Issues

No cluster issues; command operates the same on cluster file systems.


-a Lists the supported compression algorithms, along with the supported block sizes. There is one line of output per algorithm; each line contains the algorithm name and the supported block sizes in bytes, separated by blanks.
-b blocksize Compresses using the specified block size.
-l Displays the compression of the file. The vxcompress command displays the compression algorithm, the strength, the compression block size, the percentage of data saved by compression, and the percentage of extents that are compressed. Extents become uncompressed due to writes that occur after the file was compressed.
-L Displays the compression of the file in human-friendly units, such as 1 KB, 200 MB, or 4.2 TB. The -L option is otherwise identical to the -l option.
-n Runs the given number of threads to do compression or uncompression. By default, the vxcompress command limits the number of threads to 4 to avoid competing for CPU time with other programs. With this option, the number of threads can be increased or decreased. The vxcompress command never uses more than one thread per file, so this option is useful only when vxcompress is given multiple files to compress or uncompress.
-r Recurses into any specified directories.
-t type Compresses using the specified type. The type name may be followed by a hyphen and then a digit 1-9, inclusive, to specify the strength of the compression. See ALGORITHMS AND BLOCK SIZES for the supported types.
-v Verbose output.


filename Specifies the file to compress or uncompress. You can specify multiple files. If you specify a directory, the vxcompress command recurses into the directory if you specify the -r option.


The default compression type and strength is gzip-6. The following algorithms and block sizes are supported:

Type    Block Size
gzip    8k - 1024k


The vxcompress command returns 0 on success, and non-0 on failure.


To compress the file file1:

# vxcompress file1

To compress a directory of files using quick compression and the lowest strength:

# vxcompress -r -t gzip-1 dir1

To uncompress the file file1:

# vxcompress -u file1

To uncompress all compressed files under the directories dir1 and dir2:

# vxcompress -u -r dir1 dir2

To report on degree of compression to see how compressible the data in file1 is:

# vxcompress -L file1 %Comp Physical Logical %Exts Alg-Str BSize Filename 83% 75.0 MB 448.0 MB 100% gzip-5 128 KB file1

To compress a list of files given on stdin:

# find /vxfs1 | vxcompress -

To show the supported compression algorithms and block sizes:

# vxcompress -a gzip 8k - 1024k


fsadm_vxfs(1M), fsmap(1M)

VxFS 7.4 vxcompress(1)