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.
Comments
Checking in from 2020, almost
Checking in from 2020, almost two years later: this still works exactly like it did in 2018. I bumped my primary EBS volume from 100 GB to 200GB after hitting 98% utilization.
Add new comment