When running workloads on Amazon EC2, you may encounter situations where your instance storage becomes insufficient. Fortunately, AWS allows you to resize your EBS volumes without downtime. This guide explains how to increase the size of a Linux EC2 volume step by step.
Table Of Content
Step 1: Identify the Current Volume
- Log in to the AWS Management Console.
- Navigate to EC2 > Instances and select your instance.
- Under the Storage tab, note the volume ID attached to your EC2 instance.

This step ensures that you are working with the correct volume.
Step 2: Modify the EBS Volume
- Go to EC2 > Volumes in the AWS Console.
- Select the volume you want to increase.
- Click Actions > Modify Volume.
- Enter the new desired size.
- Confirm and apply the changes.

At this point, the volume size is updated at the AWS level, but the filesystem inside the Linux instance must also be extended.
Step 3: Connect to the Instance
- Open a terminal on your local machine.
- Use SSH to connect to your EC2 instance:
ssh -i your-key.pem ec2-user@your-instance-public-ipReplace your-key.pem with the path to your key and your-instance-public-ip with your actual instance IP.
Step 4: Check the Current Disk Size
Run the following command to check the attached disk size:
lsblkThis command displays block devices and will help verify whether the new volume size is recognized.
Step 5: Extend the Partition
If your disk uses gp2/gp3 and standard partitioning:
sudo growpart /dev/xvda 1This command extends the partition to use the new volume size.
Step 6: Resize the Filesystem
The next step depends on the filesystem type:
- For ext4:
sudo resize2fs /dev/xvda1 - For XFS:
sudo xfs_growfs -d /
This ensures that the extra storage is available to your operating system.
Step 7: Verify the Changes
Finally, run:
df -h
The output should now display the increased volume size.

Best Practices
- Always take a snapshot of your EBS volume or an AMI before making changes.
- Avoid over-provisioning. Increase storage only as needed to optimize costs.
- Regularly monitor your disk usage with CloudWatch to plan for scaling.
Conclusion
Expanding the disk size of a Linux EC2 instance is straightforward when done carefully. By following these steps, you can ensure that your application continues running smoothly without downtime.
If you want to learn more about managing storage and Linux environments, check out our guides on Understanding the Linux File System Hierarchy and Managing Packages in Linux: apt vs yum vs snap.


