This is just a quick one as I’m working hard on a big migration at the moment, but I’m sure it will come in handy in the future and with others. So we were having problems with the EBS disk being full, so I decided to up the disk space. The process is really quite simple.
- Login to AWS -> EC2
- Shut down your EC2 instance
- Click Snapshots on the left hand side and create a snapshot of your main root ebs volume
- Once completed, click volumes on the left and create a new volume (with the new disk size and the snapshot you just created)
- On the volumes page, make a note of the disk location (probably /dev/sda1)
- Detach the smaller volume
- Attach the larger volume (using the the ref noted above (probably /dev/sda1))
- Boot the EC2 instance
- Now login to the EC2 instance. If you run
df -h, you will see the disk still thinks it is the same size as before. Make a note of the Filesystem (probably /dev/xvda1)
resize2fs -p /dev/xvda1where /dev/xvda1 is the Filesystem noted above
df -h. You should now see that the main partition is the size of the new volume you created.
As always, I accept no responsibility for damage caused, loss of data, loss of anything. You use these instructions at your own risk.