AWS – Extending EBS Block linked to EC2 Instance

Say you are working on an EC2 instance with an EBS block provisioned.
But later you find that the storage already provisioned is insufficient. You might need to increase the volume size.

It’s pretty straight-forward on the AWS console. With the click of a button you can tell AWS to increase your EBS size.

Post this change,
Though AWS takes a few mins to extend this volume, this does not reflect on the EC2 instance.

Manual commands need to be run, to extend an existing EBS volume from the small to the newsly assigned bigger size.

Here’s the steps that got it working for me after connecting to the particular EC2 instance related to the volume.



1. df -hT -> Confirm existing storage size

2. lsblk -> display all information of the volumes.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

nvme1n1 259:0 0 30G 0 disk /data nvme0n1 259:1 0 16G 0 disk

└─nvme0n1p1 259:2 0 8G 0 part /

└─nvme0n1p128 259:3 0 1M 0 part

3. sudo growpart /dev/nvme0n1 1

4. sudo resize2fs /dev/nvme0
sudo resize2fs /dev/nvme0n1

This results in the EC2 instance now having access to the whole upgraded EBS volume.

Signing out,
VJ