HP-UX Reference (11i v1 05/09) - 1M System Administration Commands A-M (vol 3)
f
fsadm_vxfs(1M) fsadm_vxfs(1M)
File System Resizing
If the -b option is specified,
fsadm resizes the file system whose mount point is mount_point. If newsize is
larger than the current size of the file system, the file system is expanded to newsize sectors. Similarly, if
newsize is smaller than the current size of the file system,
fsadm shrinks the file system to newsize sec-
tors.
Increasing the size of a file system requires that the file system contain enough free space, prior to the
expansion, for the growth of the structural files. In the case where a file system has no free blocks avail-
able, the attempt to increase the size of the file system will fail (see extendfs(1M) for an alternate method to
increase file system size).
In a Version 3 or above disk layout, if there are file system resources in use in the sectors being removed,
fsadm relocates those resources to sectors staying within the resized file system. The time needed for
relocation depends on the number of blocks being moved.
In Version 2 disk layouts, file system structural components are fixed, so reducing the size of a file system
fails if there are file system resources in use in the sectors being removed. In that case, a reorganization
(using fsadm -e) can free busy resources and allow shrinking the file system. If there are still file sys-
tem structural components within the area to be removed, you must upgrade the file system to a Version 3
or above disk layout to do a resize (see vxupgrade(1M)).
Reporting on Directory Fragmentation
As files are allocated and freed, directories tend to grow and become sparse. In general, a directory is as
large as the largest number of files it ever contained, even if some files were subsequently removed.
To obtain a directory fragmentation report, use the command syntax:
fsadm -D [-r rawdev] mount_point
The following is some example output from the fsadm -D command:
# fsadm -F vxfs -D /lhome
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 contiguous.
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 direc-
tory 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 look-
ups 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.
Section 1M−−252 Hewlett-Packard Company − 3 − HP-UX 11i Version 1: September 2005