HP-UX Reference (11i v2 03/08) - 1M System Administration Commands A-M (vol 3)

f
fsadm_vxfs(1M) fsadm_vxfs(1M)
Directory Fragmentation Report
Dirs Total Immed Immeds Dirs to Blocks to
Searched Blocks Dirs to Add Reduce Reduce
total 15 3 12 0 0 0
The column labeled "Dirs Searched" contains the total number of directories. A directory is associated
with the extent-allocation unit containing the extent in which the directory’s inode is located. The column
labeled "Total Blocks" contains the total number of blocks used by directory extents.
The column labeled "Immed Dirs" contains the number of directories that are immediate, meaning that
the directory data is in the inode itself, as opposed to being in an extent. Immediate directories save
space and speed up pathname resolution. The column labeled "Immeds to Add" contains the number of
directories that currently have a data extent, but that could be reduced in size and contained entirely in
the inode.
The column labeled "Dirs to Reduce" contains the number of directories for which one or more blocks
could be freed if the entries in the directory are compressed to make the free space in the directory con-
tiguous. Since directory entries vary in length, it is possible that some large directories may contain a
block or more of total free space, but with the entries arranged in such a way that the space cannot be
made contiguous. As a result, it is possible to have a non-zero "Dirs to Reduce" calculation immediately
after running a directory reorganization. The
-v (verbose) option of directory reorganization reports
occurrences of failure to compress free space.
The column labeled "Blocks to Reduce" contains the number of blocks that could be freed if the entries in
the directory are compressed.
Measuring Directory Fragmentation
If the totals in the columns labeled "Dirs to Reduce" are substantial, a directory reorganization can
improve performance of pathname resolution. The directories that fragment tend to be the directories
with the most activity. A small number of fragmented directories may account for a large percentage of
name lookups in the file system.
Directory Reorganization
If the
-d option is specified, fsadm reorganizes the directories on the file system whose mount point is
mount_point. Directories are reorganized in two ways: compression and sorting.
For compression,
fsadm moves valid entries to the front of the directory and groups the free space at the
end of the directory. If there are no entries in the last block of the directory, the block is released and the
directory size is reduced.
If the total space used by all directory entries is small enough,
fsadm puts the directory in the inode
immediate data area.
fsadm also sorts directory entries to improve pathname lookup performance. Entries are sorted based
on the last access time of the entry. The -a option specifies a time interval; 14 days is the default if
-a is
not specified. The time interval is broken up into 128 buckets, and all times within the same bucket are
considered equal. All access times older than the time interval are considered equal, and those entries
are placed last. Subdirectory entries are placed at the front of the directory and symbolic links are placed
after subdirectories, followed by the most-recently-accessed files.
The command syntax for reorganizing directories in a file system is:
fsadm -d [-D][-v][-s][-a days][-p passes][-r rawdev][-t time] mount_point
The following example shows the output of the
fsadm -d -D command:
#fsadm -F vxfs -d -D -s /opt
Directory Fragmentation Report
Dirs Total Immed Immeds Dirs to Blocks to
Searched Blocks Dirs to Add Reduce Reduce
total 34663 8800 26655 2569 2716 2836
Directory Reorganization Statistics (pass 1 of 2)
Dirs Dirs Total Failed Blocks Blocks Immeds
Searched Changed Ioctls Ioctls Reduced Changed Added
fset 999 8008 3121 5017 0 3037 4428 2569
total 8008 3121 5017 0 3037 4428 2569
HP-UX 11i Version 2: August 2003 4 Hewlett-Packard Company Section 1M209