<img alt="" src="https://secure.leadforensics.com/150446.png " style="display:none;">
Go to top icon

Simple steps to change size of EBS volume in EC2 of AWS using AWS console

Vivek Danej May 31, 2012

AWS AWS console elastic block store EC2 ebs Amazon Elastic Compute Cloud cloud computing Technology

I found many of us who use EC2 (Amazon Elastic Compute Cloud) instances of AWS (Amazon Web Services) face issue of increasing size of their current EC2 instance without disturbing environment at run time.

Here are simple steps which will help you to change your current EC2 instance's EBS (Elastic Block Store) volume size at run time through AWS console only.

    1. Create snapshot of existing (old) volume

Create Snapshot of Existing Volume

    1. Then create new volume from created snapshot with new size

Create New Volume With New Snapshot

    1. Put new size there

Put New Volume

    1. Stop running instance

Stop Running Instance

    1. Detach current volume

Detach Current Volume

    1. Attach newly created volume in step 2 with Device as /dev/sda1 (It works only with /dev/sda1)

Attach Newly Created Volume

    1. Then check with elastic IP address

Check With Elastic IP For Same

    1. Then start instance.If you are not able to log-in, then disassociate IP and attach again and then start instance
    2. Finally after you gets connected through putty using either ec2-user for fedora/Amazon AMI and root for centOS
      Run following commands

sudo su
sudo resize2fs /dev/sda1

If this command does not work, then give sudo resize2fs /dev/xvda1. Basically /dev/xvda1 denotes your existing name on file system.

It's done. :)

Reference Link:

https://forums.aws.amazon.com/message.jspa?messageID=340550

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.