Comprehensive Guide: How to Increase EBS Volume Size on EC2 Instances — Step-by-Step Instructions
- Modify the size of the attached EBS volume using the Amazon EC2 Management Console or the AWS CLI.
- Connect to the EC2 instance using SSH.
- Run the
lsblk
command to list the block devices on the instance. - Use the
growpart
command to resize the root partition:growpart /dev/xvda 1
- Use the
xfs_growfs
command to resize the XFS file system:xfs_growfs -d /
orresize2fs /dev/xvda1
- Run the
fdisk -l
command to verify the new size of the volume.
Note 1: Make sure to replace
/dev/xvda
the actual device name of the root partition on your EC2 instance.These steps should increase the size of the EBS volume attached to your EC2 instance. You may need to reboot the instance for the changes to take effect.
Note 2:
>> xfs_growfs -d /
xfs_growfs: / is not a mounted XFS filesystem
then you need to run df -h command and need to see which file system is mounted on / drive
in my case

then you need to run this command
>> resize2fs /dev/root
If you have a nvmeon1 disk type then you can follow this:-
>> lsblk

>> growpart /dev/nvme0n1 1
>> resize2fs /dev/nvme0n1p1