linuxcentosgoogle-compute-enginexfs

How to resize xfs in CentOS on GCE?


I have a VM with CentOS on GCE (Google Compute Engine). I added 10GB of disk space in GCE, and the system can see this space. I tried to add 10GB to the partition with xfs_growfs, but it didn't work. What went wrong? Here's an image of the console where I tried to make the change.


Solution

  • You have to run growpart first to grow the partition that XFS is sitting on, like this:

    sudo growpart /dev/[DEVICE_ID] [PARTITION_NUMBER]
    sudo xfs_growfs /dev/[DEVICE_ID][PARTITION_NUMBER]
    

    This is documented pretty well in Google's official docs here.