xfs_growfs(8)
Expand the size of a mounted XFS filesystem to use available space on the underlying device.
Synopsis
xfs_growfs [-d size] [-e rtextsize] [-L size] [-m maxpct] [-t mtab] [-D size] [-R size] mount-pointDescription
xfs_growfs expands a mounted XFS filesystem to fill available space on its underlying block device. The filesystem must be mounted and actively in use; the command grows the filesystem metadata and allocation groups to utilize newly added space (typically from LVM or physical device expansion).
After expanding the underlying storage, run xfs_growfs on the mount point to update the XFS superblock and grow the filesystem online without downtime. The command may take several minutes on large filesystems but does not require unmounting.
Common options
| Flag | What it does |
|---|---|
-d size | Set the size of the data section to size blocks (useful for testing or reserving space) |
-e rtextsize | Set realtime extent size in bytes (for realtime filesystems) |
-L size | Set the size of the log section to size blocks |
-m maxpct | Set the maximum percentage of filesystem space reserved for inodes (default 5%) |
-t mtab | Read filesystem mount point from alternate mtab file instead of /etc/mtab |
-D size | Grow data section to size blocks (allows shrinking in some cases) |
-R size | Grow realtime section to size blocks |
-V | Print version number and exit |
Examples
Grow the XFS filesystem mounted at /mnt/data to use all available space on the underlying device
xfs_growfs /mnt/dataGrow the data section of the filesystem to exactly 1048576 blocks (~4 GB with 4K blocks)
xfs_growfs -d 1048576 /mnt/dataCheck filesystem size before and after growing to verify the expansion
df /mnt/data && xfs_growfs /mnt/data && df /mnt/dataGrow filesystem and increase the reserved inode space to 8% of total filesystem
xfs_growfs -m 8 /mnt/dataGrow filesystem using an alternate mtab file (useful in containers or special environments)
xfs_growfs -t /var/tmp/mtab /mnt/dataExtend LVM logical volume by 10GB, then grow the XFS filesystem to use the new space
lvextend -L +10G /dev/vg0/lv_data && xfs_growfs /mnt/data