Growing an XFS File System

Note:

You can't grow an unmounted XFS file system. Also, no command exists to shrink an XFS file system.

You can use the xfs_growfs command to increase the size of a mounted XFS file system if space is available on the underlying devices to accommodate the change. The command doesn't have any effect on the layout or size of the underlying devices. If needed, use the underlying volume manager to increase the physical storage that's available. For example, you can use the vgextend command to increase the storage that's available to an LVM volume group and lvextend to increase the size of the logical volume that contains the file system.

You can't use the parted command to resize a partition that contains an XFS file system. You must instead re-create the partition with a larger size and restore its contents from a backup if you deleted the original partition or from the contents of the original partition if you didn't delete it to free up disk space.

For example, you would increase the size of /myxfs1 to 4 TB, assuming a block size of 4 KB, as follows:

sudo xfs_growfs -D 1073741824 /myxfs1

To increase the size of the file system to the maximum size that the underlying device supports, specify the -d option:

sudo xfs_growfs -d /myxfs1

For more information, see the xfs_growfs(8) manual page.