Previous  |  Next  >  
Product: Storage Foundation for Databases Guides   
Manual: Storage Foundation 4.1 for Oracle Administrator's Guide   

Monitoring Fragmentation

You can monitor fragmentation in VxFS by running reports that describe fragmentation levels. Use the fsadm command to run reports on directory fragmentation and extent fragmentation. The df command, which reports on file system free space, also provides information useful in monitoring fragmentation.

Use the following commands to report fragmentation information:

  • fsadm -D, which reports on directory fragmentation.
  • fsadm -E, which reports on extent fragmentation.
  • /usr/bin/df -F vxfs -o s, which prints the number of free extents of each size.

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:

  • Removing unused space from directories.
  • Making all small files contiguous.
  • Consolidating free blocks for file system.

The following options are for use with the fsadm utility:


Options

-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.

-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.

-D -E

Produces reports on directory and extent fragmentation, respectively.

-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.

-p

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

-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.


Usage Notes

  • If you specify -d and -e, directory reorganization is always completed first.
  • If you use both -D and -E with the -d and -e options, the fragmentation reports are produced both before and after reorganization.
  • 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.

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

  To defragment a file system using the command line

Run the fsadm command followed by the options specifying the type and amount of defragmentation. Complete the command by specifying the mount point or raw device to identify the file system.


 # /opt/VRTS/bin/fsadm -F vxfs [-d] [-D] [-e] [-E] [-s] [-v] \
  [-l largesize] [-a days] [-t time] [-p pass_number] \
  [-r rawdev_pathmount_point

Refer to the File System Administrator's Guide for instructions and information on scheduling defragmentation.


Example

To defragment a file system:


    # /opt/VRTS/bin/fsadm -F vxfs -d -D /oradata_qiovm
Directory Fragmentation Report
             Dirs        Total      Immed    Immeds   Dirs to   Blocks to
             Searched    Blocks     Dirs     to Add   Reduce    Reduce
  total             5         1         4         0         0 0


  Directory Fragmentation Report
             Dirs        Total      Immed    Immeds   Dirs to   Blocks to
             Searched    Blocks     Dirs     to Add   Reduce    Reduce
  total             5         1         4         0         0 0

  To defragment a file system on a volume using the GUI

  1. Select the volume containing the file system to be defragmented.
  2. Choose Actions > File System > Defrag File System.
  3. Select Yes in the displayed dialog box.
 ^ Return to Top Previous  |  Next  >  
Product: Storage Foundation for Databases Guides  
Manual: Storage Foundation 4.1 for Oracle Administrator's Guide  
VERITAS Software Corporation
www.veritas.com