Resizing an EBS Volume

For the longest time, if you wanted to resize a EBS volume (aka “your disk drive”) attached to an Amazon Web Services instance (aka “your server”), you had to go through a dance that involved shutting down the instance. This was relatively simple in spirit, but terrifying enough in practice that I procrastinated doing it as I watched the size of my primary volume on the server powering this blog gradually fill up.

Today I reached 100% and I had no choice: fortunately, things, it turns out, have become much easier. All I needed to do was resize the volume in the AWS console (select the volume, click Modify, change the size) and then extend the Linux filesystem to use the new capacity with:

sudo growpart /dev/xvda 1
sudo resize2fs /dev/xvda1

From start to finish it took about 2 minutes.

Now I’ve got gigabytes of free space to slowly fill up in the weeks and months to come, and the confidence that when I need to increase capacity again I won’t need to go into hiding to avoid it.