0 Downtime Extended EBS Volume
Your server's humming along, life’s good, and then BAM! You get that dreaded monitoring alert: “25% disk remaining.” Uh-oh. On some cloud platforms, you'd have to shell out for a bigger server to get extra disk space—a total rip-off. Suddenly, you’re paying for more CPU and memory than you’ll ever use, and as if that’s not enough, you have to turn off your server to make it happen. Yep, cue the downtime dance, complete with awkward early deployment negotiations.
But wait—AWS to the rescue! With AWS, you can extend your EBS volume without upgrading to a monster server or dealing with downtime. Crisis averted, and no sweat!
Step 1 - Extending the root volume
- Log in to your AWS account.
- Head over to the EC2 section of the console.
- Click on EC2 Dashboard and then Instances.
- Select the EC2 instance you want to modify.
- Go to the Storage tab.
- Click on the Volume ID.
- Check the box next to the volume you want to change.
- Click Actions > Modify Volume.
- Enter the new volume size (in GiB) and click Modify.
Depending on the volume size, this process can take a few minutes to a few hours. Just wait for the in-use icon to turn green before moving on to the next step.
Step 2 - Extending the partition
- First, SSH into the web server that the volume belongs to.
- Install the required package by running: sudo apt-get install -y cloud-guest-utils
After it's installed, run lsblk to list the partitions for the volume.
nvme0n1 259:0 0 20G 0 disk └─nvme0n1p1 259:1 0 10G 0 part /
You might see something like this:
- Run: growpart /dev/nvme0n1 1 (This extends the partition.)
- Then, run: resize2fs /dev/nvme0n1p1 (This resizes the filesystem.)
Finally, run lsblk again. Your output should now show the extended partition.
nvme0n1 259:0 0 20G 0 disk └─nvme0n1p1 259:1 0 20G 0 part /
Yep, it’s that easy! AWS makes extending your EBS volume feel like a walk in the park—with zero downtime. No stress, no sweat, just more space!