
As your data volume grows, you might need to extend your existing EBS volume or you could add an another EBS volume and mount it into a directory. But in this section, we would explain how to extend an EBS volume in EC2 Linux Instance.
1.Go to AWS EC2 console & Select your AWS EC2 EBS volume
2. Create a Snapshot with a tag name from the EBS volume

4. Create a Volume from the Snapshot created in above step
Select the Snapshot-ID, Go to Action –> Create Volume . In Create volume step, select the below option
- Volume Type – Select the volume type as per your old EBS volume
- Size – Increase the Size as per your need [Here, we increased from 1 GiB to 2GiB]
- Availability Zone – This is mandate. Select the same availability zone as of your old EBS
- Encryption – This is not mandate. However if you want to encrypt your EBS volume, then you could do it using aws master key
- Tag Name – Provide a tag name to your new EBS volume
The state of the new volume would be in Available once upon its creation. The attached EBS state would always be in In-Use

5. Detach the old EBS from EC2 instance. Once its detached, it would be in Available state again

6. Attach the new EBS with the instance. Select the Instance ID, where you want to add and the device type would be same as that old EBS device type

6. Now SSH to your EC2 instance and type lsblk from root to verify the space you added in your EBS volume. However df -h would show you the previous volume space size until the added EBS is resized.
lsblk
df -h
7. Identify the Filesystem [ext2,ext3,ext4 or XFS] of your Volume. If your EC2 is nitro-based instance, then type file -s /dev/nvme?n* and as that of for T2 instance, type file -s /dev/xvd* to find the filesystem type
file -s /dev/nvme?n*
file -s /dev/xvd*

So here, the filesystem type is of XFS type
8. Install XFS tool to extend the XFS filesystem
yum install xfsprogs -y
9. Use xfs_growfs command to extend the disk space
xfs_growfs -d /data
10. Type df -h to verify the space again

Now the EBS volume (/dev/xvdf) size has extended from 1 GiB to 2GiB.
I hope this blog helps. Please comment below if you have any concerns/questions related to this block