As long as you are all right with a little downtime of the EC2 instance (in a few minutes), it is possible to extend the root partition on a running EBS boot EC2 instance, without needing to start a new instance.
Before starting playing the trick, you need to have Amzon EC2 API tools installed.
Then the steps are:
- Shutdown the instance and detach the volume.
- Build a snapshot for the detached volume and create a volume with a larger size based on the snapshot.
- Attach the new volume to the instance and start it.
- Login the instance and resize the root file system to fill the new EBS volume.
Commands for the last step are listed as below:
# ext3 root file system (more common): sudo resize2fs /dev/sda1 # XFS root file system (less common): sudo xfs_growfs /
xfs_growfs is supplied by xfsprogs, which can be installed via yum (or apt-get).