Defragmenting a file system

You can use the online administration utility fsadm to defragment or reorganize file system directories and extents.

The fsadm utility defragments a file system mounted for read/write access by:

The following options are for use with the fsadm utility:

-d

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

Note:

If you specify -d and -e, directory reorganization is always completed first.

-a

Use in conjunction with the -d option to consider files not accessed within the specified number of days as "aged" files. Aged files are moved to the end of the directory. The default is 14 days.

-e

Reorganizes extents. Files are reorganized to have the minimum number of extents.

Note:

If you specify -d and -e, directory reorganization is always completed first.

-D -E

Produces reports on directory and extent fragmentation, respectively.

Note:

If you use both -D and -E with the -d and -e options, the fragmentation reports are produced both before and after reorganization.

-v

Specifies verbose mode and reports reorganization activity.

-l

Specifies the size of a file that is considered large. The default is 64 blocks.

-t

Specifies a maximum length of time to run, in seconds.

Note:

The -t and -p options control the amount of work performed by fsadm, either in a specified time or by a number of passes. By default, fsadm runs five passes. If both -t and -p are specified, fsadm exits if either of the terminating conditions are reached.

-p

Specifies a maximum number of passes to run. The default is five.

Note:

The -t and -p options control the amount of work performed by fsadm, either in a specified time or by a number of passes. By default, fsadm runs five passes. If both -t and -p are specified, fsadm exits if either of the terminating conditions are reached.

-s

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

-r

Specifies the pathname of the raw device to read to determine file layout and fragmentation. This option is used when fsadm cannot determine the raw device.

Note:

You must have superuser (root) privileges to reorganize a file system using the fsadm command.

To defragment a file system