HP-UX Reference (11i v2 07/12) - 1M System Administration Commands A-M (vol 3)
f
fsadm_vxfs(1M) fsadm_vxfs(1M)
Large files can be created only on file systems with disk layout Version 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 -o largefiles
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 current version. Clearing the flag with the
-o nolargefiles 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
-o largefiles and -o nolargefiles
options are the only fsadm options that can be used
on an unmounted file system. An unmounted file system can be specified by invoking
fsadm with a spe-
cial device rather than a mount point. If an unmounted file system is specified, it must be clean.
Changing the
largefiles flag may require changes to
/etc/fstab . For example, if fsadm is used
to set the
largefiles flag, but nolargefiles
is specified as a mount option in /etc/fstab , the
files system is not mountable.
Defragmentation
For optimal performance, the kernel-extent allocator must be able to find large extents when it wants
them. To maintain file-system performance, run
fsadm periodically against all VxFS file systems to
reduce fragmentation. The frequency depends on file system usage and activity patterns, and the impor-
tance of performance; typically between once a day and once a month against each file system. The
-v
option can be used to examine the amount of work performed by fsadm. 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 fsadm. The
-t option
specifies a maximum length of time to run. The
-p option specifies a maximum number of passes to run.
If both are specified, fsadm exits if either of the terminating conditions is reached. By default,
fsadm
runs 5 passes. If both the -e and -d options are specified,
fsadm runs all the directory reorganization
passes before any extent reorganization passes.
fsadm uses the file .fsadm in the lost+found directory as a lock file. When fsadm
is invoked, it
opens the file
lost+found/.fsadm
in the root of the file system specified by mount_point. If the file
does not exist, it is created. The fcntl(2) system call obtains a write lock on the file. If the write lock fails,
fsadm assumes that another instance of fsadm is running and fails. fsadm reports the process ID of the
process holding the write lock on the .fsadm file.
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 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 reorganization (using
fsadm -e) can free busy resources and allow shrinking the file system. If there are still file system struc-
tural 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
278 Hewlett-Packard Company − 3 − HP-UX 11i Version 2: December 2007 Update