To Resize the current EBS volume we need to find out the volume which is going to resize. Once Login the AWS account and Navigate to Ec2 ser...
To Resize the current EBS volume we need to find out the volume which is going to resize.
Once Login the AWS account and Navigate to Ec2 services you can able to see the Ec2 dashboard page.
Click the Instances option you can able to see the instances to make sure that the instance needs to be up and running.
Once click the Instance, you can able to see the security options, click that option you can able to see the Volume which is already attached to the Ec2-Instance.
Copy the volume id and go to the ec2-Dashboard --> elastic block storage --> volumes
Click the volume id it will go inside the volume you can see some details of the volume inside we need to click the modify option to modify the current EBS volume size.
Inside the Volume Modification page, you can able to change the size of the current volume default you have 8GB now you can add min 1G Max 16384 GB. click modify the option it takes some time to modify the volume.
After 5 minutes you can able see the modified volume size. Now AWS side we completed the volume modification step but for Linux, we need to add our disk into the Linux filesystem then only we can be able to use the extra modified volume.
For that, we need to log in to the Linux machine using either putty, or PowerShell or if you are using Amazon Linux or ubuntu you can able login using ec2-instance connect option. If you do not know how to do that please see our blog How to connect our EC2 Instances using EC2-Instance Connect in AWS.
Login to the instance and check whether disks are added successfully.
Check the below command
Command: lsblk
Command: df -Th --> check the volume details along with the file system.
Now we need to grow the partition command it extends a partition in a partition table to fill available space
Command: sudo growpart /dev/xvda 1 --> Extend the partition /dev/xvda is a partition, 1 is a partition number.
Already we checked the filesystem using the df -Th command if we are using XFS we need to use the below command to update the extra disks into the partition,
Command: xfs_growfs /dev/xvda1 or xfs_growfs -d /
If our Linux machine used the ext3 or ext4 file system we need to use the resize2fs command.
Once the file system is updated we need to check whether the disks are added to the partition. using df -h and lsblk command.