XFS grow not working

Before running xfs_growfs

Give this one a go:

sudo growpart /dev/xvda 1

As per https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html


You have a 4GB xfs file system on a 4GB partition, so there is no work to do.

To overcome, enlarge the partition with parted then use xfs_growfs to expand the fs. You can use parted rm without losing data.

# umount /data
# parted
GNU Parted 3.1
Using /dev/xvda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) print
....
(parted) rm 2
(parted) mkpart
....
(parted) print
(parted) quit

# xfs_growfs /dev/xvda2
# mount /dev/xvda2 /data

Done. No need to update /etc/fstab as the partition numbers are the same.


Before running xfs_growfs, Please do the following step first:

#growpart <devicenametobeextend> 

# growpart /dev/xvda 1                                                                                                                                                                   
CHANGED: partition=1 start=4096 old: size=31453151 end=31457247 new: size=41938911,end=41943007

#xfs_growfs -d /

enter FYI for your reference