Getting started with Linux: expanding the XFS File System
Problem: I have extra space on the disk, so I want to extend the existing XFS file system created on it to fully use the extra space. What is the correct way to expand the XFS file system?
XFS is an open-source (GPL) Log File System. It was initially developed by Silicon Valley graphics (SGI) and is now supported by most Linux distributions. In fact, XFS has been adopted by the latest CentOS/RHEL 7 and become its default file system. Among its many features, the "online resizing" feature allows the existing XFS file system to be expanded when it has been mounted. However, the XFS file system is not supported yet.
To expand an existing XFS file system, you can use the command line tool xfs_growfs, which is available in most Linux distributions by default. Because XFS supports online resizing, the target file system can be mounted or not mounted.
Install XFS in RedHat
Configure XFS filesystem on RHEL6
DBA conclusion: MySQL has the greatest advantage in combination with XFS file systems
The basic usage of xfs_growfs is as follows:
As an extension of the target XFS file system, you can specify the mount point, disk partition, or logical volume (when using LVM) and the number of data blocks to specify the size of the new XFS file system. You can use the xfs_info command line tool to check the data block size and quantity:
To extend the XFS file to 1986208:
- $ Sudo xfs_growfs/dev/centos/root-D 1986208
If you do not use the "-D" option to specify the size, xfs_growfs will automatically expand the XFS File System to the maximum available size.
- $ Sudo xfs_growfs/dev/centos/root
Note: When you expand an existing XFS file system, you must be prepared to add the space for extension of the XFS File System in advance. Although this is obvious, if there is no free space available in the partition or disk volume, xfsGrowfs has no way. At the same time, if you try to expand the size of the XFS file system to more than the size of the disk partition or volume, xfsGrowfs will fail.
This article permanently updates the link address: