The Veritas File System (VxFS) allows file systems to be grown and shrunk with the fsadm(1m) utility. This activity can occur while a file system is online, and is relatively safe ( I have personally grown dozens of file systems, and have yet to have a single problem). To display the current size of a file system in blocks, we can use the df(1m) utility:
$ df -t /u05
/u05 (/dev/vx/dsk/oradg/oravol05): 209158736 blocks 3268092 files
total: 209698816 blocks 3268096 files
To shrink /u05 to 50000000 blocks, we can invoke fsadm with the desired block count, and the file system to shrink:
$ /usr/lib/fs/vxfs/fsadm -b 50000000 /u05
UX:vxfs fsadm: INFO: V-3-23586: /dev/vx/rdsk/oradg/oravol05 is
currently 209698816 sectors - size will be reduced
We can verify that volume was shrunk with the df(1m) utility:
$ df -t /u05
/u05 (/dev/vx/dsk/oradg/oravol05): 49464784 blocks 772859 files
total: 50000000 blocks 772864 files
We could have grown this file system instead of shrinking it by adjusting the number of blocks passed to the “-b” option. As with all operations that modify the structure of storage, you should test this on a non-production system prior to implementing this on production servers.