Defragmenting VxFS file systems

I came across Scott Kaiser’s defrag.pl script a while back, and have found it useful for determining if the VxFS free extent map is fragmented. The script takes a file system as an option, and prints a one-line string to indicate if the file system should be defragmented:

$ defrag.pl /u01
/u01 is badly fragmented. Defragmentation is recommended.

If the script determines that the free extent map (the script doesn’t report on directory entry fragmentation) is fragmented, you can perform an online defragmentation by invoking fsadm with the “-e” (reorganize extents) and “-d” (reorganize directory entries) options:

$ /usr/lib/fs/vxfs/fsadm -v -e -d /u01

UX:vxfs fsadm: INFO: V-3-20287: using device /dev/vx/rdsk/oradg/oravol01
UX:vxfs fsadm: INFO: V-3-20223: directory reorganization complete
UX:vxfs fsadm: INFO: V-3-20261: extent reorg pass 1
AU: aun =  16, tfree =  32064, sfree =    384
aun =  16, seg =   0, nfrag =   95, fblks = 1690, devid =    0 start =   524288, len =  2048
req[0] fset 999 ino 32 blocks 1  off 0x0 len 1
req[0] fset 999 ino 33 blocks 1  off 0x0 len 1
UX:vxfs fsadm: ERROR: V-3-24364: reorg failed for fset 999 ino 33
req[0] fset 999 ino 34 blocks 1  off 0x0 len 1
req[0] fset 999 ino 35 blocks 1  off 0x0 len 1
req[0] fset 999 ino 36 blocks 1  off 0x0 len 1
req[0] fset 999 ino 37 blocks 1  off 0x0 len 1
req[0] fset 999 ino 38 blocks 1  off 0x0 len 1
[ ... ]
aun =  16, seg =   0, nfrag =   86, fblks = 5397, devid =    0 start =   524288, len =  6144
UX:vxfs fsadm: INFO: V-3-20262: extent reorg complete


I prefer to avoid fragmentation, and try to preallocate all files to avoid this issue (for dynamic applications this isn’t always possible). For further information please refer to the fsadm_vxfs(1m) manual page.

2 thoughts on “Defragmenting VxFS file systems”

  1. What’s so special about fset 999 ?
    I am getting the similar errors during fs reorg :

    # fsadm -v -e -d -p 2 /myfs

    UX:vxfs fsadm: ERROR: V-3-24364: reorg failed for fset 999 ino 1536248
    UX:vxfs fsadm: ERROR: V-3-20274: reorg ioctl returned errno 61441

    Thanks,
    — Leon

  2. VxFS contains 2 filesets – each its own file system. VxFS structural data is contained in fileset 1 while user data is contained in fileset 999. If you use checkpoints, each checkpoint is assigned a fileset starting at fileset 1000.

Leave a Reply

Your email address will not be published. Required fields are marked *