Manual Page Result
0
Command: defragment | Section: 8 | Source: Digital UNIX | File: defragment.8.gz
defragment(8) System Manager's Manual defragment(8)
NAME
defragment - Makes the files in a file domain more contiguous
SYNOPSIS
/usr/sbin/defragment [-e] [-n] [-t time] [-T time] [-v] [-V] domain
PARAMETERS
Specifies the name of the file domain.
FLAGS
Ignores errors and continues, if possible. Errors that are ignored are
usually related to a specific file. Prevents defragmentation from ac-
tually taking place. Use in conjunction with the -v flag to display
statistics on the number of extents in the file domain. Specifies a
flexible time interval (in minutes) for the defragment utility to run.
If the utility is performing an operation when the specified time has
elapsed, the procedure continues until the operation is complete.
Specifies an exact time interval (in minutes) for the defragment util-
ity to run. When the specified time has elapsed, the defragmentation
procedure stops, even if it is performing an operation. Displays sta-
tistics on the amount of fragmentation in the file domain and informa-
tion on the progress of the defragment procedure. Displays the same
information provided by the -v flag along with information about each
operation the defragment utility performs on each file. This flag
slows the defragment procedure.
DESCRIPTION
When a file consists of many discontiguous file extents, the file is
fragmented on the disk. File fragmentation reduces the read/write per-
formance because more I/O operations are required to access a frag-
mented file.
The defragment utility attempts to reduce the number of file extents in
a file domain by making files more contiguous. Defragmenting a file
domain often makes the free space on a disk more contiguous, resulting
in less fragmented file allocations in the future.
Before you can defragment a file domain, all filesets in the file do-
main must be mounted. If you try to defragment an active file domain
that includes unmounted filesets, the system displays an error message
indicating that a fileset is unmounted.
To determine the amount of file fragmentation in a file domain before
using the defragment utility, issue the defragment command with the -v
and -n flags. This provides the fragmentation information without
starting the defragment utility.
Before running the defragment utility, delete any files in the domain
that you do not need. This gives the defragment utility more free space
to use, which produces better results. Deleting files afterwards cre-
ates more free-space fragments.
To monitor the improvement made to the file domain by the defragment
utility, use the verbose mode flag, -v, which displays the following
information:
Extents The number of extents in the specified domain. (Contiguous ex-
tents in sparse files are counted as one extent after defragmentation,
when in fact there are several contiguous file extents.) Files w/ ex-
tents The number of files that have extents. (Note that files do not
have extents if the files are so small that they are kept with the
metadata.) Avg exts per file w/ exts The average number of extents for
each file that has one or more extents. Aggregate I/O perf The effi-
ciency of the entire file domain. An increase in value indicates im-
provement. Free space fragments The number of free-space fragments in
the domain.
RESTRICTIONS
The defragment utility requires a minimum of 1 percent of the total
space, or 5 megabytes per volume (whichever is less) to be free in or-
der to run.
The defragment utility does not defragment striped files.
You cannot run the defragment utility while the addvol, balance, de-
fragment, rmfset, or rmvol utility is running on the same file domain.
You must be the root user to use this utility.
EXAMPLES
The following example defragments the file domain called accounts_dmn.
A flexible time limit of 15 minutes is imposed and verbose mode is re-
quested to display the fragmentation data:
# defragment -v -t 15 accounts_dmn defragment: defragmenting domain
'accounts_dmn'
Pass 1; Clearing
Volume 1: area at block 11680 ( 103072 blocks): 81% full
Domain data as of the start of this pass:
Extents: 10432
Files w/extents: 4305
Avg exts per file w/exts: 2.42
Aggregate I/O perf: 52%
Free space fragments: 2743
<100K <1M <10M >10M
Free space: 38% 0% 0% 62%
Fragments: 2742 0 0 1
Filling . . . Pass 13; Clearing
Volume 1: area at block 559744 ( 62736 blocks): 0% full
Volume 2: area at block 76640 ( 24624 blocks): 18% full
Domain data as of the start of this pass:
Extents: 4306
Files w/extents: 4305
Avg exts per file w/exts: 1.00
Aggregate I/O perf: 100%
Free space fragments: 23
<100K <1M <10M >10M
Free space: 0% 9% 27% 64%
Fragments: 6 10 5 2
Filling
Current domain data:
Extents: 4305
Files w/extents: 4305
Avg exts per file w/exts: 1.00
Aggregate I/O perf: 100%
Free space fragments: 17
<100K <1M <10M >10M
Free space: 0% 6% 29% 65%
Fragments: 3 8 4 2
defragment: defragmented domain 'accounts_dmn' The information dis-
played before each pass and at the conclusion of the defragmentation
process shows the improvement made to the file domain by the defragment
utility.
RELATED INFORMATION
addvol(8), balance(8), rmvol(8). delim off
defragment(8)