How to Increase AWS EBS Volume Size

2020/12/111 min read
bookmark this

This quick note shows how to increase AWS EC2 Linux's EBS volume size.

First, log in to AWS, and select the target EBS, update the size. The volume size will update right away, but you'll do the following.

Next, ssh into the EC2 Linux instance, we would check the current Linux size.

After ssh into the EC2, type the following command so we'll know does the increased volume had changed or not.

lsblk

Following is the sample result when you type lsblk. Here we'll know that you have size as 16G but current EBS only has 8G.

nvme1n1 30G
nvme0n1 16G
|-----nvme0n1p1 8G

Now, the following command will change the size to use maximum size base on the above sample result. After you run the command, your EBS should be 16G now.

sudo growpart /dev/nvme0n1 1

another command might be useful, this is to check the folder size

sudo du -sh /var/www/my-folder-size