shrink(1)
NAME
shrink, unshrink - shrink and unshrink sparse files.
SYNOPSIS
shrink [ -v ] name...
unshrink [ -v ] name...
DESCRIPTION
shrink reduces the size of sparse files by removing the “holes” from them and creating compact files in the shrink format. The actual data is kept in its original format; that is, no data compression is performed. The offsets in the file are changed to provide a continuous stream of blocks. For each name on the command line, shrink will write a file called name.S (to distinguish it from the original file) in the shrink format. If the conversion succeeds and the shrink format file is smaller in size than the original file, name will be removed; otherwise, a notice of the failure is written to standard error, and name.S is removed. See shrink(4) for a description of the shrink format.
Unshrink restores a file in shrink format to its original size. For each name on its command line, the shrink format file is expanded into a sparse file with the “holes” restored. The name of the shrink format file is expected to end in “.S;” if it doesn’t, then “.S” is appended to it to obtain the shrink file. If the conversion is successful, the shrink format file is removed; otherwise, a notice of the failure is printed on standard error, and the failed sparse file is removed.
A sparse file is a regular UNIX file (i.e., byte stream); however, through a series of lseek(2) and write(2) operations, some of the data blocks have not been allocated. Note that the last block will always be present. These “missing” blocks constitute what is called “holes” in UNIX terminology; they are returned as zero-filled blocks by the read(2) system call.
OPTIONS
−v Be verbose.
This option instructs both shrink and unshrink to output verbose messages as they process the individual files.
SEE ALSO
shrink(4), lseek(2), write(2), read(2)
WARNINGS
During the operation of these tools, actual disk usage by the regular UNIX file and its shrink format version increases to slightly over twice the amount of actual data.
NOTES
shrink is unable to detect holes of less than 8192 bytes (8 Kb) or 8 Kb holes that are not aligned on an 8 Kb boundary.
Some examples of sparse files are system crash dumps created by savecore(1M) and file system quota files.
CX/UX User’s Reference Manual