$linuxjunkies
>

xfs_growfs(8)

Expand the size of a mounted XFS filesystem to use available space on the underlying device.

UbuntuDebianFedoraArch

Synopsis

xfs_growfs [-d size] [-e rtextsize] [-L size] [-m maxpct] [-t mtab] [-D size] [-R size] mount-point

Description

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

FlagWhat it does
-d sizeSet the size of the data section to size blocks (useful for testing or reserving space)
-e rtextsizeSet realtime extent size in bytes (for realtime filesystems)
-L sizeSet the size of the log section to size blocks
-m maxpctSet the maximum percentage of filesystem space reserved for inodes (default 5%)
-t mtabRead filesystem mount point from alternate mtab file instead of /etc/mtab
-D sizeGrow data section to size blocks (allows shrinking in some cases)
-R sizeGrow realtime section to size blocks
-VPrint 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/data

Grow the data section of the filesystem to exactly 1048576 blocks (~4 GB with 4K blocks)

xfs_growfs -d 1048576 /mnt/data

Check filesystem size before and after growing to verify the expansion

df /mnt/data && xfs_growfs /mnt/data && df /mnt/data

Grow filesystem and increase the reserved inode space to 8% of total filesystem

xfs_growfs -m 8 /mnt/data

Grow filesystem using an alternate mtab file (useful in containers or special environments)

xfs_growfs -t /var/tmp/mtab /mnt/data

Extend 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

Related commands