'\"macro stdmacro
.if n .pH g1a.cmpress @(#)cmpress	40.6 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} cmpress 1M "Cartridge Tape Utilities" "\&"
.if \nX=1 .ds x} cmpress 1M "Cartridge Tape Utilities"
.if \nX=2 .ds x} cmpress 1M "" "\&"
.if \nX=3 .ds x} cmpress "" "" "\&"
.TH \*(x}
.SH NAME
\f4cmpress\f1 \- re-link file system to remove fragmentation
.SH SYNOPSIS
\f4/usr/sbin/cmpress\f1
.SH DESCRIPTION
\f4cmpress\fP re-links the input file system to improve access time 
by cleaning up fragmentation of files throughout the file system. 
The file system must be mounted in order for this procedure to find the
file system and determine its characteristics.
.PP
\f4cmpress\fP uses a 3B2 Computer cartridge tape for intermediate storage. 
The file system is first copied onto the tape, the old file system
is removed and the free block list is sorted into sequential order, then
the file system is copied back onto the disk so that file system blocks that 
previously were scattered throughout the file system are in contiguous
space.
.PP
Notice that the file system is destroyed during the process of
compressing it.  For this reason it is strongly recommended that an 
up-to-date
backup of the file system be made before the file system is compressed.
In the event of a mishap during file system compression the file system
could be restored from the backup.  
.PP
Since the file system is destroyed during the compression process, it is
not possible to compress the root file system.  The \f4cmpress\fP
command will reject the file system name \f4/\f1 if it is entered.
.PP
Compressing any file system except \f4/usr\f1 can be done through the
\f4sysadm\fP command.  An example of such a file compression is given
below.  Compressing the \f4/usr\f1 file system is somewhat more complex a
process, since the \f4sysadm\fP facilities reside in the \f4/usr\f1 file
system.  A scheme for compressing \f4/usr\f1 is given in the examples.
.SH EXAMPLES
To compress a file system named \f4applic\f1, the following command
would be issued:
.PP
.ce
\f4sysadm  tapemgmt\f1
.sp
When the tape management facilities menu is displayed, select the
\f4compress\fP facility and answer the questions posed by the shell
procedure.  This \f4compress\fP facility invokes the \f4/usr/sbin/cmpress\f1
procedure.
.PP
To compress the \f4/usr\f1 file system the UNIX system has to be in single
user mode with the \f4/usr\f1 file system mounted.  The following sequence
of commands will take the system from multiuser to single user mode,
compress the \f4/usr\f1 file system, then return the system to multiuser
mode.  Notice that any work going on in the system at the time that the
system is changed to single user mode will be terminated, so this
process should be done at a time when there are no other users logged
in, and no background tasks are being done.  It should be done only
from the console from the root login.
.br
.ne 5
First check to see how \f4/usr\f1 is mounted.
.PP
	\f4mount\f1
.PP
Make note of the \f4/dev/dsk/c\f2?\fPd\f2?\fPs\f2?\fP\f1 information, as you
will need it later.
.PP
Now take the system down to single user mode.
.PP
	\f4init 1\f1
.PP
Lots of messages will now appear, and you will need to log back in as 
root.
.PP
Now mount the \f4/usr\f1 file system.  Use the 
\f4/dev/dsk/c\f2?\fPd\f2?\fPs\f2?\fP\f1 information from the \f4mount\fP
command above.
.PP
	\f4mount  /dev/dsk/c\f2?\fPd\f2?\fPs\f2?\fP  /usr\f1
.PP
Now compress the file system
.PP
	\f4/usr/sbin/cmpress\0/dev/rSA/ctape\f2?\fP\f1
.PP
The procedure will pose a series of questions.  As the
compression process runs it will display a series of messages 
indicating its progress.
.PP
When compression is complete the following commands will 
unmount the \f4/usr\f1 file system and return the system to multi user mode.
Many messages will be displayed during this process.
.PP
	\f4umount  /dev/dsk/c1d0s2
.br
	init 2\f1
.PP
.SH SEE ALSO
\f4sysadm\fP(1M)
.SH DIAGNOSTICS
The diagnostic messages are intended to be self explanatory.
.SH NOTES
As mentioned above, since the compression of the file system entails
its destruction and restoration it is strongly recommended that a
backup copy of the file system be made before its compression is
attempted.
.Ee
