vxcompress is a new utility introduced in 6.0 to compress files on VXFs filesystem.
For now, it is only supported on Linux and Solaris. Support for HP-UX and AIX will come later.
We can compress the files on vxfs filesystem using vxcompress.
Compressed file is a file with compressed extents.
Compression can only be done on disk layout version 9.
# fstyp -v /dev/vx/rdsk/aarifdg/aarif | grep version
magic a501fcf5 version 9 ctime Fri Jan 20 06:55:41 2012
If the filesystem is lower then version 9, it will fail with error cannot use vxcompress..
To compress a file:
#vxcompress lib
To compress all the files in a directory:
#vxcompress -r dirname
Compressed file is indistinguishable from uncompressed file.
- It has the same name and same inode number
-Can be read or written as usual
-Reads cause uncompression in memory and not on disk
-Writes cause uncompression on disk
-vxcompress uses gzip to compress the file.
-Default compression strength is 6. Can specify compression strength from 1 - 9.
-Default compression block size is 1MB.
How to check if a file is compressed or not
#vxcompress -L lib
%Comp Physical Logical %Exts Alg-Str BSize Filename
49% 37 KB 73 KB 100% gzip-6 1024k lib/cpp
44% 31 KB 55 KB 100% gzip-6 1024k lib/librpcsvc.so.1
44% 28 KB 50 KB 100% gzip-6 1024k lib/librt.so.1
51% 31 KB 63 KB 100% gzip-6 1024k lib/libtsol.so.2
64% 5 KB 14 KB 100% gzip-6 1024k lib/libsendfile.so.1
Total: 237 files 13.25 MB (55%) storage savings
bash-3.00#
-----------------------------------------------------------------------------
#fsadm -S compressed /data1
Can be used to check compression on entire filesystem
To uncompress use
#vxcompress -u