Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fsadm_vxfs(1M) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mkfs(1M-vxfs)

fcntl(2)

fs(4-vxfs)

vxfsio(7)

fsadm(1M)                          (VxFS)                         fsadm(1M)

NAME
     fsadm - resize or reorganize a Veritas File System (VxFS)

SYNOPSIS
     fsadm [-F vxfs] [-b newsize] [-r rawdev] mountpoint

     fsadm [-F vxfs] [-E] mountpoint

     fsadm [-F vxfs] [-D] mountpoint

     fsadm [-F vxfs] [-e] [-E] [-s] [-v] [-l largesize] [-a days]
           [-t time] [-p passes] [-r rawdev] mountpoint

     fsadm [-F vxfs] [-d] [-D] [-s] [-v] [-a days] [-t time] [-p passes]
           [-r rawdev] mountpoint

DESCRIPTION
     The fsadm utility is designed to perform file system administrative
     operations. The current version supports file system resizing, extent
     reorganization, and directory reorganization. The fsadm utility
     operates on file systems mounted for read/write access. Only the
     superuser can resize or reorganize file systems.

OPTIONS
     -F vxfs       Specifies a Veritas file system type (FSType).

     -b newsize   Resizes the file system to newsize sectors.

     -D            Reports on directory fragmentation. If specified in con-
                   junction with the -d option, the fragmentation report is
                   produced both before and after the directory reorganiza-
                   tion.

     -E            Reports on extent fragmentation. If specified in con-
                   junction with the -e option, the fragmentation report is
                   produced both before and after the extent reorganiza-
                   tion.

     -d            Reorganizes directories. Directory entries are reordered
                   to place subdirectory entries first, then all other
                   entries in order of time since last access. The direc-
                   tory is also compacted to remove free space.

     -e            Extent reorganization. Attempt to minimize fragmenta-
                   tion. Aged files are moved to the end of the allocation
                   units to produce free space. Other files are reorganized
                   to have the minimum number of extents possible.








Page 1                       Reliant UNIX 5.44                Printed 11/98

fsadm(1M)                          (VxFS)                         fsadm(1M)

     -a days       Consider files not accessed within the specified number
                   of days as aged files. The default is 14 days. Aged
                   files are moved to the end of the directory by the
                   directory sort, and reorganized differently by the
                   extent reorganization.

     -l largesize Large file size in file system blocks. Indicates size of
                   files to be considered as large files. The value must be
                   between 8 and 2048 blocks. The default is 64 blocks.

     -p passes     Maximum number of passes to run. The default is five
                   passes. Reorganizations are processed until complete or
                   the specified number of passes have been run.

     -r rawdev    Path name of raw device to use. Should be used when the
                   mount point or fsck device for the mount point is not
                   specified in /etc/vfstab.

     -t time       Maximum time to run. Reorganizations are processed until
                   complete, or the time limit has expired. The time is
                   specified in seconds.

     -s            Prints a summary of activity at the end of each pass.

     -v            Verbose. Report reorganization activity.

     The -b, -D, -E, -d, and -e options determine what function will be
     performed. At least one of these options must be selected. The -b
     option cannot be specified if any of the other options are specified.
     If both -e and -d are specified, the fsadm utility will do the direc-
     tory reorganization first. It will do the extent reorganization after
     the directory reorganization has been completed.

     For optimal performance, the kernel extent allocator must be able to
     find large extents when it wants them. To maintain the file system
     performance levels, the fsadm utility should be run periodically
     against all Veritas file systems to reduce fragmentation. The fsadm
     utility should be run somewhere between once a day and once a month
     against each file system. The frequency depends on file system usage
     and activity patterns, and the importance of performance. The -v
     option can be used to examine the amount of work performed by fsadm.
     The frequency of reorganization can be adjusted based on the rate of
     file system fragmentation.

     There are two options that are available to control the amount of work
     done by the fsadm utility. The -t option is used to specify a maximum
     length of time to run. The -p option is used to specify a maximum
     number of passes to run. If both are specified, the utility exits if
     either of the terminating conditions is reached. By default, the fsadm
     utility will run two passes. If both the -e and -d options have been
     specified, the utility will run all the extent reorganization passes
     before any directory reorganization passes.


Page 2                       Reliant UNIX 5.44                Printed 11/98

fsadm(1M)                          (VxFS)                         fsadm(1M)

     The fsadm utility 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
     mountpoint. If the file does not exist, it is created. The fcntl(2)
     system call is used to obtain a write lock on the file. If the write
     lock fails, fsadm will fail because another invocation of fsadm is
     running against the file system. The fsadm utility will report the
     process ID of the process holding the write lock on the .fsadm file.

   File System Resizing
     If the -b option is specified, the fsadm utility will resize the file
     system whose mount point is mountpoint. If newsize is larger than
     the current size of the file system, the file system will be expanded
     to newsize sectors. Similarly, if newsize is smaller than the
     current size of the file system, an attempt will be made to shrink the
     file system to newsize sectors.

     Reducing the size of a file system can fail if there are file system
     resources currently in use within the sectors to be removed from the
     file system. In this case, a reorganization may help free those busy
     resources and allow a subsequent reduction in the file system size.

   Directory Reorganization
     If the -d option is specified, the fsadm utility will reorganize the
     directories on the file system whose mount point is mountpoint.
     Directories are reorganized in two ways, compression and sorting.

     For compression, the entries in the directory are moved to the front
     of the directory, and the free space is grouped 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 lowered. If the direc-
     tory entries are small enough, the directory will be placed in the
     inode immediate data area.

     The entries in a directory are also sorted to improve path name lookup
     performance. Entries are sorted based on the last access time of the
     entry. The -a option is used to specify a time interval; seven 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, with the most recently accessed files.

     The directory reorganization runs in passes across the entire file
     system. On each pass, all eligible directories have a single pass of a
     bubble sort performed on them. When one pass through each inode has
     been completed, the fsadm utility will go back to the beginning of the
     file system and start another pass. The first pass does the first pass
     of a bubble sort on all directories containing one or more blocks. The
     second pass does the second pass of a bubble sort on all directories
     having two or more blocks. Each succeeding pass will be limited to


Page 3                       Reliant UNIX 5.44                Printed 11/98

fsadm(1M)                          (VxFS)                         fsadm(1M)

     larger and larger directories. After three passes, all directories of
     three blocks or less will have been completely sorted. After four
     passes, all directories of four blocks or less will have been com-
     pletely sorted, and so on.

   Extent Reorganization
     If the -e option is specified, the fsadm utility will reorganize the
     data extents on the file system whose mount point is mountpoint. The
     primary goal of extent reorganization is defragmentation of the file
     system.

     To reduce fragmentation, the reorganization tries to place all small
     files in one contiguous extent. The -l option is used to specify the
     size of a file that is considered large. The default is 64 blocks. The
     reorganization also tries to group large files into large extents of
     at least 64 blocks. In addition to reducing fragmentation, these reor-
     ganizations can improve performance. Small files can be read or writ-
     ten in one I/O operation. Large files can approach raw disk perfor-
     mance for sequential I/O operations.

     The extent reorganization also tries to improve locality of reference
     on the file system. Files are moved into the same allocation unit as
     their inode. Within the allocation unit, small files and directories
     are migrated to the front of the allocation unit. Large files and
     inactive files are migrated towards the back of the allocation unit. A
     file is considered inactive if the access time on the inode is more
     than 14 days old. The time interval can be varied using the -a option.
     This reorganization should reduce the average seek time by placing
     inodes and frequently used data closer together.

     The fsadm utility will try performing these reorganizations on all
     inodes on the file system. Each pass through the inodes will move the
     file system closer to the organization considered optimal by the fsadm
     utility. The first pass might place a file into one contiguous extent.
     The second pass might move the file into the same allocation unit at
     its inode. Then, since the first file has been moved, a third pass
     might move a file from another allocation unit into the space vacated
     by the first file during the second pass.

NOTE
     fsadm is invoked as /etc/fs/vxfs/fsadm or /sbin/fsadm. This should
     change to the same invocation mechanism as other file system specific
     utilities in the future.

FILES
     lost+found/.fsadm
          lock file

SEE ALSO
     mkfs(1M-vxfs), fcntl(2), fs(4-vxfs), vxfsio(7).




Page 4                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026