Home >System Tutorial >LINUX >A practical guide to XFS file system extensions
Introduction | I have extra space on my 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 extend the XFS file system? |
XFS is an open source (GPL) journaling file system originally developed by Silicon Valley Graphics (SGI) and now supported by most Linux distributions. In fact, XFS has been adopted by the latest CentOS/RHEL 7 and has become its default file system. Among its many features, it includes the "online resize" feature, which allows the existing XFS file system to be expanded while it is already mounted. However, there is no support for XFS file system reduction.
Extended XFSTo expand an existing XFS file system, you can use the command line tool xfs_growfs, which is available by default on most Linux distributions. Since XFS supports online resizing, the target file system can be mounted or not mounted.
The following shows the basic usage of xfs_growfs:
As a target XFS file system to extend, you can specify a mount point, disk partition, or logical volume (when using LVM), and use 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 number:
To extend XFS files to 1986208:
$ sudo xfs_growfs /dev/centos/root -D 1986208
If you do not use the "-D" option to specify a size, xfs_growfs will automatically expand the XFS file system to the maximum available size.
$ sudo xfs_growfs /dev/centos/root
Note that when you extend an existing XFS file system, you must be prepared to add space for XFS file system expansion in advance. Although this is obvious, if there is no free space available on the partition or disk volume, xfsgrowfs has no choice. Also, if you try to extend the XFS file system size beyond the disk partition or volume size, xfsgrowfs will fail.
The above is the detailed content of A practical guide to XFS file system extensions. For more information, please follow other related articles on the PHP Chinese website!