Monday, February 22, 2021

how to increase disk size in aws ec2 instance

First of all let’s connect to our EC2 instance using ssh, and check the current disk size by below following command.

$ sudo df -h
$
sudo lsblk


 

Step 1) Click On volumes under "Elastic Block Store"


 

Step 2) Click on Action >> Click on Modify Volume


 

Step 3) here write the increase size >> and click on modify

note:- Current size is 8GB and increase size will 10GB


 

Step 4) Check the increased disk size.

$ sudo lsblk 


 

Step 5)  Use the growpart command to extend the partition. 

Note:- there is a space between the device name and the partition number.

$ sudo growpart /dev/xvda 1


 

Step 6) Use the resize2fs command that allows you to resize ext2, ext3, or ext4 file systems.

$ sudo resize2fs /dev/xvda1


 

Step 7) Now check the increased file system size.

$ sudo df -h



No comments:

Post a Comment

testing