fsadm_vxfs: fsadm - resize or reorganize a VxFS file system
ckpt_name] largesize] passes] rawdev] time] mount_point
newsize] rawdev] mount_point
fsadm [-F vxfs] [-L] mount_point
performs online administration functions on VxFS file systems, Storage
Checkpoints, or individual files and directories. supports file-system
resizing, extent reorganization, directory reorganization, and querying
or changing the flag. operates on file systems mounted for read/write
access, however, the option can also operate on a special device con‐
taining a clean, unmounted file system. Only a privileged user can
change the flag on a mounted file system, or resize or reorganize a
file system. You can invoke only one instance of fsadm per file system
at a time.
If mount_point is a Storage Checkpoint, performs the specified opera‐
tion on the entire file system, including all of its Storage Check‐
VxFS file systems running on HP-UX 10.20 and later contain features
that are incompatible with earlier versions of HP-UX and applications.
These features are large files (file sizes greater than two gigabytes),
and hierarchical storage management via the DMAPI (Data Management
Applications Programming Interface).
The online reorganization and online resize features of are available
only with the HP OnLineJFS product.
If no options are specified, fsadm prints the current largefiles flag
setting, then exits. The -b, -L, -o largefiles, and -o nolargefiles
options cannot be specified if any other options are given. If both -e
and -d are specified, fsadm first completes the directory reorganiza‐
tion, then does the extent reorganization. recognizes the following
Consider files not accessed within the specified number of
days as aged files. The default is 14 days. The
option moves aged files to the end of the directory.
The days option applies only with
Resize the file system to
newsize sectors. cannot be used with the options.
Convert the inode format of files upgraded from the Version 2
so that they can grow beyond a two-gigabyte offset.
This option is required because some file systems
upgraded from the Version 2 disk layout could not be
extended past two gigabytes or contain more than 8
Directory entries are reordered to place subdirec‐
tory entries first, then all other entries in
decreasing order of time of last access. The direc‐
tory is also compacted to remove free space.
Report on directory fragmentation. If specified in conjunction
with the option, the fragmentation report is pro‐
duced both before and after the directory reorgani‐
Minimize file system fragmentation. Files are reor‐
ganized to have the minimum number of extents.
Report on extent fragmentation. If specified in conjunction
with the option, the fragmentation report is pro‐
duced both before and after the extent reorganiza‐
Performs and reports extent reorganization or directory reorga‐
on an individual file or directory. For example,
when used with the option, a reorganization is per‐
formed on the specified directory. When used with
the option, an extent reorganization is performed on
a specified file. If you specify (dash), the com‐
mand reads input from the standard input device
instead of using a file name or directory name.
Specify the VxFS file system type.
Reorganizes or reports directories or extent fragmentation
on the specified Storage Checkpoint.
Large extent size in file system blocks.
Indicates the size of extents to be considered as
large extents, that is, extents that are immovable
while performing an extent defragmentation. The
value must be between 8 and 2048 blocks. The
default is 64 blocks. The largesize option applies
only with or
Queries the current size of the intent log as well as the volume
it resides. On single-volume file systems, will be
System performance can improve by increasing the size of the
because it reduces the frequency at which the log
wraps. Increasing the intent log size can also
increase the time required for a log replay.
See the logsize specific option of the mkfs_vxfs(1M)
manual page for more information on log sizes.
Directs the intent log size allocation specified by
logsize to the specified intent logging volume.
volumename must exist and belong to the same volume
set as the file system. This modifies the file sys‐
tem log allocation policy to contain the specified
device. The old log space is freed after the com‐
If logvol is specified and logsize is not specified,
the log is moved to the new volume while retaining
the existing size.
Clear the flag for the file system. When this flag is not
set, large files cannot be created on the file sys‐
tem. Any attempt to clear the flag fails if a large
file exists on the file system.
You can set or clear the flag on a mounted file sys‐
tem by specifying mount_point, or on an unmounted
file system on the device special.
When invoked without arguments, prints the current
state of the largefiles flag.
The option cannot be used with the options.
Note: Large files are supported on HP-UX 10.20 sys‐
tems and above. Be careful when implementing large
file system capability. System administration util‐
ities such as backup may not operate correctly if
they are not large file aware.
Maximum number of
passes to run. The default is 5 passes. Reorgani‐
zations are processed until reorganization is com‐
plete, or the specified number of passes are run.
Pathname of raw device to read to determine file layout and
This option can be used when cannot determine the
Print a summary of activity at the end of each pass.
Maximum time to run. Reorganizations are processed until
reorganization is complete, or the time limit has
expired. time is specified in seconds.
Echo the completed command line, but do not execute the command.
The command line is generated by incorporating the
user-specified options. This option allows the user
to verify the command line.
Specify verbose mode.
Report reorganization activity.
If no options are specified, prints the current flag setting, then
exits. The and options cannot be specified if any other options are
given. If both and are specified, first completes the directory reor‐
ganization, then does the extent reorganization.
recognizes the following operands:
mount_point Name of the mount_point for a mounted VxFS file.
special Name of a special device containing a clean,
unmounted file system.
Files larger than two gigabytes are called large files. The and
options change the flag, allowing or disallowing large files in the
Large files can be created only on file systems with disk layout Ver‐
sion 3 or above. A file system with large files cannot be mounted on
an HP-UX system older than HP-UX 10.20. Many existing applications
cannot operate on large files.
Setting the flag with the option succeeds only if the file system has
the Version 3 disk layout or above. See vxupgrade(1M) for information
on how to upgrade a file system from an older disk layout to the cur‐
rent version. Clearing the flag with the option succeeds only if the
flag is set and there are no large files present on the file system.
See mkfs_vxfs(1M) and mount_vxfs(1M) for information on creating and
mounting file systems with large files.
The and options are the only options that can be used on an unmounted
file system. An unmounted file system can be specified by invoking
with a special device rather than a mount point. If an unmounted file
system is specified, it must be clean.
Changing the flag may require changes to For example, if is used to set
the flag, but is specified as a mount option in the files system is not
For optimal performance, the kernel-extent allocator must be able to
find large extents when it wants them. To maintain file-system perfor‐
mance, run periodically against all VxFS file systems to reduce frag‐
mentation. The frequency depends on file system usage and activity
patterns, and the importance of performance; typically between once a
day and once a month against each file system. The option can be used
to examine the amount of work performed by You can adjust the frequency
of reorganization based on the rate of file system fragmentation.
There are two options that are available to control the amount of work
done by The option specifies a maximum length of time to run. The
option specifies a maximum number of passes to run. If both are speci‐
fied, exits if either of the terminating conditions is reached. By
default, runs 5 passes. If both the and options are specified, runs
all the directory reorganization passes before any extent reorganiza‐
uses the file in the directory as a lock file. When is invoked, it
opens the file in the root of the file system specified by mount_point.
If the file does not exist, it is created. The system call obtains a
write lock on the file. If the write lock fails, assumes that another
instance of is running and fails. reports the process ID of the
process holding the write lock on the file.
File System Resizing
If the option is specified, 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, shrinks
the file system to newsize sectors.
Increasing the size of a file system requires that the file system con‐
tain 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
available, the attempt to increase the size of the file system will
fail (see extendfs(1M) for an alternate method to increase file system
In a Version 3 or above disk layout, if there are file system resources
in use in the sectors being removed, relocates those resources to sec‐
tors staying within the resized file system. The time needed for relo‐
cation depends on the number of blocks being moved.
In older 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 reorga‐
nization (using can free busy resources and allow shrinking the file
system. If there are still file system 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:
The following is some example output from the command:
The column labeled "Dirs Searched" contains the total number of direc‐
tories. A directory is associated with the extent-allocation unit con‐
taining the extent in which the directory's inode is located. The col‐
umn labeled "Total Blocks" contains the total number of blocks used by
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" con‐
tains 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 reorgani‐
zation. The (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 resolu‐
tion. 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.
If the option is specified, reorganizes the directories on the file
system whose mount point is mount_point. Directories are reorganized
in two ways: compression and sorting.
For compression, 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, puts
the directory in the inode immediate data area.
also sorts directory entries to improve pathname lookup performance.
Entries are sorted based on the last access time of the entry. The
option specifies a time interval; 14 days is the default if 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:
days] passes] rawdev] time] mount_point
The following example shows the output of the command:
The column labeled "Dirs Searched" contains the number of directories
searched. Only directories with data extents are reorganized. Immedi‐
ate directories are skipped. The column labeled "Dirs Changed" con‐
tains the number of directories for which a change was made.
The column labeled "Total Ioctls" contains the total number of
VX_DIRSORT ioctls performed. Reorganization of directory extents is
performed using this ioctl.
The column labeled "Failed Ioctls" contains the number of requests that
failed for some reason. The reason for failure is usually that the
directory being reorganized is active. A few failures should be no
cause for alarm. If the option is used, all ioctl calls and status
returns are recorded.
The column labeled "Blocks Reduced" contains the total number of direc‐
tory blocks freed by compressing entries. The column labeled "Blocks
Changed" contains the total number of directory blocks updated while
sorting and compressing entries.
The column labeled "Immeds Added" contains the total number of directo‐
ries with data extents that were compressed into immediate directories.
Reporting on Extent Fragmentation
As files are created and removed over time, the free extent map for an
allocation unit changes from having one large free area to having many
smaller free areas. This process is known as fragmentation. Also,
when files increase in size (particularly when growth occurs in small
increments) small files can be allocated in multiple extents. In the
best case, each file that is not sparse would have exactly one extent
(containing the entire file), and the free-extent map is one continuous
range of free blocks.
Conversely, in a case of extreme fragmentation, there can be free space
in the file system, none of which can be allocated. For example, on
Version 2 disk layouts, the indirect-address extent size is always 8K
long. This means that to allocate an indirect-address extent to a
file, an 8K extent must be available. If no extent of 8K byes or
larger is available, even though more than 8K of free space is avail‐
able, an attempt to allocate a file into indirect extents fails and
To determine whether a file system is fragmented, the free extents for
that file system must be examined. If a large number of small extents
are free, then there is fragmentation. If more than half of the amount
of free space is taken up by small extents (smaller than 64 blocks), or
there is less than 5 percent of total file system space available in
large extents, then there is serious fragmentation.
Running the Extent-Fragmentation Report
The extent-fragmentation report provides detailed information about the
degree of fragmentation in a given file system.
The command syntax for an extent-fragmentation report is:
largesize] rawdev] mount_point
The extent reorganization facility considers some extents to be immov‐
able: that is, if reallocating and consolidating extents does not
improve performance, those extents are considered immovable. For exam‐
ple, if a file already contains large extents, reallocating and consol‐
idating these extents does not improve performance. The option con‐
trols when considers an extent as immovable. By default, largesize is
64 blocks, meaning that any extent larger than 64 blocks is considered
to be immovable. For the extent-fragmentation report, the value for
largesize affects which extents are reported as being immovable
The following is an example of the output generated by the command:
The numbers in the column "Total Files" indicate the total number of
files that have data extents. The column "Average File Blks" contains
the average number of blocks belonging to all files. The column "Aver‐
age # Extents" contains the average number of extents used by files in
the file system. The column "Total Free Blks" contains the total num‐
ber of free blocks in the file system. The total number of blocks used
for indirect address extent are reported as "blocks used for indi‐
The general shape of free extent map is also reported. There are two
percentages reported: % free extents smaller than 64 blocks and % free
extents smaller than 8 blocks. These numbers are typically near zero
on an unfragmented file system.
Another metric reported is the percentage of blocks that are part of
extents 64 blocks or larger. Files with a single small extent are not
included in this calculation. This number is generally large on file
systems that contain many large files, and is small on file systems
that contain many small files.
The figures under the heading "Free Extents By Size" indicate the
totals for free extents of each size. The totals are for free extents
of size 1, 2, 4, 8, 16, ... up to a maximum of the number of data
blocks in an allocation unit. The totals are similar to the output of
the command unless there was recent allocation or deallocation activity
(because acts on mounted file systems). These figures provide an indi‐
cation of fragmentation and extent availability on a file system.
If the option is specified, reorganizes the data extents on the file
system whose mount point is mount_point. The primary goal of extent
reorganization is to defragment the file system.
To reduce fragmentation, extent reorganization tries to place all small
files in one contiguous extent. The option specifies the size of a
file that is considered large. The default is 64 blocks. Extent reor‐
ganization also tries to group large files into large extents of at
least 64 blocks. Extent reorganization can improve performance. Small
files can be read or written in one I/O operation. Large files can
approach raw-disk performance for sequential I/O operations.
performs extent reorganization on all inodes on the file system. Each
pass through the inodes will move the file system closer to optimal
reduces both file fragmentation and free extent fragmentation in each
pass. In older versions of VxFS, considerable effort was made to
obtain an optimal file system layout. In current versions, relies on
VxFS kernel allocation mechanisms to reallocate files in a more favor‐
able extent geometry. At the same time, the kernel allocation mecha‐
nism is prevented from using blocks in areas of the free list that
tries to make more contiguous.
The command syntax to perform extent reorganization is
largesize] passes] rawdev] time] mount_point
The following example shows the output from the command:
Note that the default five passes were scheduled, but the reorganiza‐
tion finished in two passes.
This file system had a significant amount of free space although there
were several free small extents. The situation was corrected by real‐
locating one or more of the extents on many of the files. The files
selected for reallocation in this case are those with extents in the
heavily fragmented section of the allocation units. The time it takes
to complete extent reorganization varies, depending on the degree of
fragmentation, disk speed, and the number of inodes in the file system.
In general, extent reorganization takes approximately one minute for
every 100 megabytes of disk space.
In the preceding example, the column "Extents Searched" contains the
total number of extents examined. The column "Reallocations Attempted"
contains the total number of consolidations or merging of extents per‐
formed. The column "Ioctls Issued" contains the total number of reor‐
ganization request calls made during the pass. This corresponds
closely to the number of files that are being operated on in that pass
as most files can be reorganized with a single ioctl. (More than one
extent may be consolidated in one operation.)
The column "FileBusy" (located under the heading "Errors") shows the
total number of reorganization requests that failed because the file
was active during reorganization. The column "NoSpace" (located under
the heading "Errors") contains the total number of reorganization
requests that failed because an extent presumed free was allocated dur‐
ing the reorganization. The column "Total" (located under the heading
"Errors") is the total number or errors encountered during the reorga‐
nization and may include errors that were not included with "FileBusy"
The following command performs an extent reorganization on sll individ‐
ual files under the mount point
file system devices for legacy DSFs
file system devices for persistent DSFs
Contains static information about file systems.
SEE ALSOdf_vxfs(1M), fsadm(1M), mkfs_vxfs(1M), mount_vxfs(1M), vxupgrade(1M),
fcntl(2), fstab(4), vxfsio(7).