Extend AWS linux volume ( resize volume in AWS )

Posted: January 7, 2021 in Server, Ubuntu

One of the System Architecture admin has to do is to resize AWS volume and like me, we don’t remember steps if you are not doing that frequently in your job. Today I have taken my time to write this blog to list simple steps when extending AWS linux volume. I know there are many blogs you can find in internet but none of the blogs has it simple steps wise and precise step.

Resize AWS volume can be done with downtime and without downtime. Both ways uses similar steps to upgrade your AWS volume.

Please check images as well to refer to visual guides.

  1. Login to AWS and go to list of AWS Instances, select instance that you want its volume to be resize.
  2. After you select instance, you will instance description below.
  3. Within that description, click into Root device or Block devices ( whichever you want to resize )
  4. You will see EBS ID, click into it to go to Volume list with that volume selected.
  5. Your instance volume will be listed and now right click and click Modify Volume.
  6. Your Volume go through process: Modifying, Optimizing and Complete ( Takes minimum 20 minutes to 2 hour ).
  7. Once complete, SSH to your instance.
  8. RUN these command as SUDO or ROOT user.
  9. These are following commands to know about your Volume or disk in linux.
    df -h
    lsblk
    fdisk -l /dev/xvda
As you can see xvda has new volume size 30GB and and xvda1 mounted partition is stilled 20GB.

    10. Now you have type this command to extend your mounted partition: sudo growpart /dev/xvda 1
    11. Now you should have new partition size, check by running: sudo lsblk
    12. Lastly, you should extend your file system depending upon XFS OR EXTs( ext2, ext3 & ext4 ).
    – If you have XFS volume, then run: sudo xfs_growfs /dev/xvda1
    – If you have EXT volume, then run: sudo resize2fs /dev/xvda1

That’s all folks!

Your volume has been resize and these can all be achieved without downtime or shutting down your server.

Here are some of the screenshot I created to help with visual guides:

Happy System Admin-ing !!
Linux is the King ! 🙂

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.