XFS is an open source (GPL) log file system that was originally developed by the Silicon Valley Graphics (SGI) and is now supported by most Linux distributions. In fact, XFS has been adopted by the latest Centos/rhel 7 as its default file system. Among its many features, the "online sizing" feature is included, enabling existing XFS file systems to be extended when they are already mounted. However, there is no support for the reduction of XFS file systems.
To extend an existing XFS file system, you can use the command-line tool XFS_GROWFS, which is available by default on most Linux distributions. Because XFS supports online sizing, the target file system can be hung or not mounted.
The following shows the basic usage of XFS_GROWFS:
Extended as a target XFS file system, you can specify mount points, disk partitions, or logical volumes (when using LVM), and use the number of blocks to specify the size of the new XFS file system. You can use the Xfs_info command-line tool to check the size and number of blocks of data:
To extend an XFS file to 1986208:
If you do not use the "-d" option to specify the size, XFS_GROWFS will automatically extend the XFS file system to the maximum available size.
Note that when you extend an existing XFS file system, you must be prepared to add space for the XFS file system expansion in advance. This is obviously the case, but if there is no free space available on the partition or disk volume, there is no way to XFSGROWFS. Also, XFSGROWFS will fail if you try to extend the XFS file system size to a disk partition or volume size.