IBM Books

IBM General Parallel File System for AIX: Administration and Programming Reference

mmdefragfs Command

Name

mmdefragfs - Reduces disk fragmentation by increasing the number of full free blocks available to the file system.

Synopsis

mmdefragfs Device [-i] [ -v] [-u BlkUtilPct]

Description

Use the mmdefragfs command to reduce fragmentation of a file system. The mmdefragfs command moves existing file system data within a disk to make more efficient use of disk blocks. The data is migrated to unused subblocks in partially allocated blocks thereby increasing the number of free full blocks.

The mmdefragfs command can be run against a mounted or unmounted file system. However, best results are achieved when the file system is unmounted. When a file system is mounted, allocation status may change causing retries to find a suitable unused subblock.

Parameters

Device
The device name of the file system to have fragmentation reduced. File system names need not be fully qualified. fs0 is as acceptable as /dev/fs0.

This must be the first parameter.

Options

-i
Specifies to query the current disk fragmentation state of the file system. Does not perform the actual defragmentation of the disks in the file system.

-u BlkUtilPct
The average block utilization goal for the disks in the file system. The mmdefragfs command reduces the number of allocated blocks by increasing the percent utilization of the remaining blocks. The command automatically goes through multiple iterations until BlkUtilPct is achieved on all of the disks in the file system or until no progress is made in achieving BlkUtilPct from one iteration to the next, at which point it exits.

-v
Specifies the output should be verbose.

Exit status

0
Successful completion.

1
A failure has occurred.

Security

You must have root authority to run the mmdefragfs command.

You may issue the mmdefragfs command from any node in the GPFS cluster.

In an SP environment:

  1. Verify the authentication method set for SP security services:
    1. If your authentication method is set to compatibility, Kerberos authentication is required. Issue the k4init command.
    2. If your authentication method is set to DCE, dce_login authentication is required.
    3. If your authentication method is set to NONE/std, there must be an entry in the /etc/sysctl.mmcmd.acl file on every node in the nodeset for the root user at every other node in the nodeset.

    For further information, see the latest IBM Parallel System Support Programs for AIX: Administration Guide, IBM Parallel System Support Programs for AIX: Command and Technical Reference, and RS/6000: Planning Volume 2, Control Workstation and Software Environment manuals at www.rs6000.ibm.com/resource/aix_resource/sp_books/pssp. Search for information on sysctl.

  2. You may issue the mmdefragfs command from any node running GPFS or the CWS.
  3. If you are executing the mmdefragfs command from the CWS on a multi-partitioned system, the SP_NAME environment variable must be properly set. It is suggested that you use a separate window for each partition and set the environment variable accordingly. For further information, see the IBM Parallel System Support Programs for AIX: Administration Guide and search for understanding system partitioning.

Examples

  1. To query the fragmentation state of file system fs0, enter:
    mmdefragfs fs0 -i
    

    The system displays information similar to:

    "fs0"    10304 inodes:    457 allocated / 9847 free
     
                             free subblk    free 
    disk            disk size  in full  subblk in      %       %
    name          in nSubblk   blocks   fragments free blk blk util
    --------------- --------- --------- --------- --------  -------
    gpfs68n1          4390912   4270112       551   97.249   99.544
    gpfs69n1          4390912   4271360       490   97.277   99.590
                    --------- --------- ---------           -------
    (total)           8781824   8541472      1041            99.567
    
  2. To reduce fragmentation of all files in the file system fs0 on all defined, accessible disks that are not stopped or suspended, enter:
    mmdefragfs fs0 
    

    The system displays information similar to:

    WARNING: "fs0" is mounted on 4 nodes(s) and in use on 4 node(s)
     
                          free subblk                 free
      disk                  in full                 subblk in       %             %
      name                  blocks       blk        fragments     free blk     blk util
                       before     after freed   before    after before after before after  
     ---------------  ------------------------ ---------------- ------------ ------------
      gpfs57n7          28896     29888    31     1462      463  50.39 52.12  94.86 98.31
      gpfs60n8          41728     43200    46     1834      362  59.49 61.59  93.55 98.66 
                        ---------------------  ---------------- 
     (total)            70624     73088    77     3296      825
    
  3. To reduce fragmentation of all files in the file system fs1 until the disks have an average block utilization percentage higher then 99%, enter:
    mmdefragfs fs1 -u 99 
    

    The system displays information similar to:

    WARNING: "fs1" is mounted on 1 nodes(s) and in use on 1 node(s)
     
    Start processing: iteration 1
    Processing Pass 1 of 1
    Disk Name gpfs57n7 gpfs60n8
       6 % complete
      12 % complete
      17 % complete
      22 % complete
      27 % complete
      32 % complete
      38 % complete
      43 % complete
      49 % complete
      56 % complete
      63 % complete
      70 % complete
      75 % complete
      81 % complete
      87 % complete
      92 % complete
      98 % complete
                            free subblk              free
      disk                    in full              subblk in          %           %
      name                    blocks     blk     fragments        free blk     blk util
                       before     after freed   before    after before after before after 
      ---------------  ------------------------ ---------------- ------------ ------------
      gpfs57n7          39424     40064    20     1347      589  68.75 69.87  92.48 96.59
      gpfs60n8          50688     51456    24     1555      593  72.26 73.36  92.01 96.83 
                        ---------------------  ---------------- 
      (total)           90112     91520    44     2902     1182 
    

See also

mmdf Command

Location

/usr/lpp/mmfs/bin


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]