cmpress(1M) SYSTEM ADMINISTRATION COMMANDS cmpress(1M)
NAME
cmpress - re-link file system to remove fragmentation
SYNOPSIS
/usr/sbin/cmpress
DESCRIPTION
cmpress 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.
cmpress 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.
Notice that the file system is destroyed during the process
of compressing it. For this reason it is strongly recom-
mended 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.
Since the file system is destroyed during the compression
process, it is not possible to compress the root file sys-
tem. The cmpress command will reject the file system name /
if it is entered.
Compressing any file system except /usr can be done through
the sysadm command. An example of such a file compression
is given below. Compressing the /usr file system is some-
what more complex a process, since the sysadm facilities
reside in the /usr file system. A scheme for compressing
/usr is given in the examples.
EXAMPLES
To compress a file system named applic, the following com-
mand would be issued:
sysadm tapemgmt
When the tape management facilities menu is displayed,
select the compress facility and answer the questions posed
by the shell procedure. This compress facility invokes the
/usr/sbin/cmpress procedure.
1
cmpress(1M) SYSTEM ADMINISTRATION COMMANDS cmpress(1M)
To compress the /usr file system the UNIX system has to be
in single user mode with the /usr file system mounted. The
following sequence of commands will take the system from
multiuser to single user mode, compress the /usr file sys-
tem, 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.
First check to see how /usr is mounted.
mount
Make note of the /dev/dsk/c?d?s? information, as you will
need it later.
Now take the system down to single user mode.
init 1
Lots of messages will now appear, and you will need to log
back in as root.
Now mount the /usr file system. Use the /dev/dsk/c?d?s?
information from the mount command above.
mount /dev/dsk/c?d?s? /usr
Now compress the file system
/usr/sbin/cmpress /dev/rSA/ctape?
The procedure will pose a series of questions. As the
compression process runs it will display a series of mes-
sages indicating its progress.
When compression is complete the following commands will
unmount the /usr file system and return the system to multi
user mode. Many messages will be displayed during this pro-
cess.
umount /dev/dsk/c1d0s2
init 2
SEE ALSO
sysadm(1M)
DIAGNOSTICS
The diagnostic messages are intended to be self explanatory.
2
cmpress(1M) SYSTEM ADMINISTRATION COMMANDS cmpress(1M)
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.
3