How to expand elastic root volume on aws ubuntu with zero down-time
How to expand elastic root volume on AWS ubuntu with no down-time
To expand AWS EC2 volume size first we need to increase volume size in AWS console and then SSH to EC2 instance and extend the partition to use available space. Follow the steps below to expand the volume size with no down-time.
-
First login to your AWS console.
-
Choose “EC2” from the services list
-
Click on “Volumes” under ELASTIC BLOCK STORE menu (on the left)
-
Choose the volume that you want to resize, right-click on “Modify Volume”
-
Then you will see a window like below
Enter the required size in size input box in the above case we extended the 8GB volume to 20GB.
7. Click on modify.
Now we need to allocate more space to the root partition. Follow the below steps to do so.
List block devices by following command
$ lsblk
Extend the partition in a partition table to fill available space
(1) sudo growpart /dev/xvda 1
Expand an ext2, ext3, ext4 file system
(2)sudo resize2fs /dev/xvda1
You can verify by the following commands
$ lsblk
Now we have extended EBS volume size with zero down-time, enjoy..