.TH dpac "" "" "Command"
.PC "De-fragment a COHERENT file system"
\fBdpac \fB[\-q] \fIraw_device\fR
.PP
.HS
.SH Option:
.IC \fB\-q\fR
Run quietly.
.HE
Command
.B dpac
de-fragments the COHERENT file system on
.IR raw_device .
Defragmentation leaves each file in the file system physically contiguous.
This reduces the number of seeks needed to access a file,
and threfore permits disk I/O to run at its maximum speed.
The default algorithm also sorts the i-nodes by modification date
and puts the oldest ones at the beginning of the partition.
This helps the file system remain un-fragmented longer.
.PP
You must
.B umount
the target file system
.I raw_device
before you run
.B dpac
on it.
Failure to do so will corrupt the file system.
For example, the command
.DM
	dpac /dev/rat0a
.DE
.PP
tells
.B dpac
to map the first partition on the first drive and prompt whether to continue.
.I raw_device
must be a partition or a floppy disk rather than an entire hard drive.
.PP
.B dpac
begins by making a map of the file system.
It displays a histogram of its activity as it builds the map;
this lets you see what the kernel must do in order to access each file.
When it has finished the file system map,
.B dpac
prompts you and asks whether to quit, continue with
defragmentatation using the default date sort, or to continue but to
use an unsorted method of defragmentation.
.B dpac
does not use terminfo or termcap for its display,
and is intended for use on the console's
.B ansipc
terminal setting.
This lets you run it from a bootable floppy disk.
.SH "See Also"
.Xr "commands," commands
.Xr "fmap," fmap
.Xr "fsck," fsck
.Xr "qpac," qpac
.Xr "spac," spac
.Xr "upac" upac
.SH Notes
To see how fragmented a file system is, use the command
.BR fmap .
.PP
Note that you can also de-fragment a file system by copying it to a tape,
then deleting it and restoring it from the tape.
Another method of defragmentation is to use the command
.B cpdir
to copy the file system to a spare partition (should you have one that
is large enough), then using the spare partition in place of the old partition.
.PP
Please note that if you use
.B dpac
incorrectly or without sufficient amounts of RAM or spare disk space,
you can damage or destroy your file system.
.I Never
run
.B dpac
on the partition-table device (e.g., /dev/at0x), or on the root device.
.I "Caveat utilitor!"
.PP
.II "Wright, Randy"
.B dpac
was written by Randy Wright (rw@rwsys.wimsey.bc.ca). 
