One of the great uses of EBS volumes is there persistence, however, there often comes a time when the data outgrows the original size of the volume. It is a fairly easy matter to remedy this, however, there does tend to be a moment of downtime.
While many filesystems do have a method for ‘growing’, my filesystem preference has been, of late, XFS.
The basic procedure to grow an EBS volume with an XFS filesystem, would be as follows:
- (Freeze the filesystem with
xfs_freezeif needed, or stop the instance, or detach the volume)
- Take a snapshot of the volume (you can use the AWS console)
- Create a new volume from the snapshot, specifying a larger size
- Attach the new volume to an instance
- (For consistency, you should unmount the volume, run xfs_check, and remount the volume)
xfs_growfs -d MOUNTPOINT
The df command is quite handy during this, both to see the total space (i.e. before and after you grow the volume) (use
df -h) and for finding the type of filesystem you are using (use