• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Resize Root Partition on Linux in Amazon EC2

Written by Rahul, Updated on August 3, 2020

One of my EC2 Linux instance is getting out of disk. Initially, we forgot to add higher disk size and it was launched with default 8GB disk. Now, our system required more disk space to run properly.

This tutorial, will help you to resize root partition of ec2 Linux instance.

Backups Instance

It is strongly recommended to create full backup (AMI) of your instance before resizing root volume. This will be helpful for recover from any unexpected issues.

Now, follow one of the below methods to resize root disk on your EC2 Linux system.

Method 1 – Using Disk Snapshot

  1. Stop your instance
  2. Go to volumes and create a snapshot from volume. You can find volume details from your instance description.
  3. Go to snapshots and wait for the snapshot completed. After that:
    • Create a new volume from the newly created snapshot.
    • Set the new size in Size (GiB) column.
    • Set the proper availability zone. It must be the same as your instance is running in.
    • Now click on “Create Volume”.
  4. Attach new volume as root to your instance
  5. Start your instance

Method 2 – Using Instance AMI

In this method, current a new instance will be launched. In that case, the instance ID will be changed.

  1. Stop your instance
  2. Create an AMI of your instance
  3. Go to AMIs pages. Once the AMI is created, launch a new instance from AMI
  4. In the wizard, you must set new disk size in Add Store step.
  5. Complete the wizard to launch your instance
  6. Once instance launch complete, you may need to swap elastic IP from old instance

Verify Upgraded Disk

At this point your root volume has been resized successfully. Just verify your disk has been resizes properly

df -h 

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

9 Comments

  1. Avatar Deepak Sharma Reply
    June 14, 2018 at 11:47 am

    after doing this could we save data?

  2. Avatar Fazlu Reply
    July 16, 2017 at 6:17 pm

    Never save after making the changes in the disk partition. Just Quit without saving and perform a reboot. After that, log in and you can see the root volume size has increased.

  3. Avatar Someone Reply
    May 14, 2017 at 5:12 pm

    Excellent! thank you very much for this step by step guide!

  4. Avatar giuseppe Reply
    May 4, 2017 at 10:45 am

    After delete the partition I can’t boot anymore…grub shows up

  5. Avatar giuseppe Reply
    May 4, 2017 at 10:45 am

    After delete the partition I can’t boot enaymore…grub shows up

  6. Avatar prem Reply
    April 19, 2017 at 6:59 am

    wow and gud job plz update in future this type of cmd

  7. Avatar Kevin Reply
    August 6, 2016 at 9:07 am

    This is great info, much easier than detaching, reattaching to a different instance to resize it, etc, etc.
    It’s just what is needed for resizing a CentOS instance that was launched with a bigger-than-default size boot volume. Thank you so much for posting this!

  8. Avatar Carlo Reply
    May 30, 2016 at 8:25 am

    This is really helpful. Thank you very much.

  9. Avatar Rohit Reply
    February 10, 2016 at 3:27 pm

    Thanks man,

    You saved my lot of time.
    It will be great if you explain how you achieved this.

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Debian 10
  • Download Ubuntu 20.04 LTS – DVD ISO Images
  • Linux Run Commands As Another User
  • How to Check PHP Version (Apache/Nginx/CLI)
  • How To Install and Configure GitLab on Ubuntu 20.04
  • How to Install PyCharm on Ubuntu 20.04
  • How to Check Ubuntu Version with Command or Script
  • How to Set all directories to 755 And all files to 644
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy