This document is for our product AMIMOTO AMI.
If you're using other AMI or product, the steps on that document might not run correctly.
Kindly check AWS official documents or ask AWS support desk to expand EBS volume.

While launching AMIMOTO AMI on Amazon Web Services, the EC2 volume size is a suggested 8GB by default.

This is more than enough space for most but if you've launched with 8GB and need more storage after the fact there's a way to change that.
 

Note

This document is for our product AMIMOTO AMI.
If you're using other AMI or product, the steps on that document might not run correctly.
Kindly check AWS official documents (Modifying the Size, IOPS, or Type of an EBS Volume on Linux) or ask AWS support desk to expand EBS volume.

TL;DR

  1. Log into your AWS account and navigate to EC2
  2. View Instance Details looking for the Root Device and Block Devices to identify the volume you want to resize
  3. Click the storage Device and select the EBS ID
  4. While in the Volumes panel click Actions at the top of the page
  5. Select Modify Volume to modify that particular volume
  6. Enter the desired volume size in GBs and click modify, yes to confirm
  7. SSH into your Instance
  8. Run lsblk to list available blocks (volumes) and note the volume size / names
  9. Run sudo growpart /dev/volumename 1 on the volume you want to resize, in our case it was sudo growpart /dev/xvda 1
  10.  Check new size with df -h command

Full Step by Step Guide

View Instance Details

Locate the Root Device and Block Devices. Identify the volume you want to resize.

Navigate to Volumes

Click on the Storage Device you'd like to modify. From the hover menu click EBS ID link to navigate to the EC2 Volumes page. Select Modify from the Actions menu to view available options.

Update Volume Size

From the Actions / Modify dialog box, verify the current volumes size and update it with your desired amount. In our case, we increased ours to 30GB.

Expand Volume via SSH

After completing the steps above EC2 increased the volume size to your desiered amount and made it available. However, for your EC2 instance to take full advantage of this newly available disk space you'll need to run a few more commands.

Log into your EC2 Instance with SSH. If you're not familiar with how to do that check our how-to guide for SSH.

List Available Storage Blocks

Using the lsblk command view the available and attached storage blocks on your EC2 Instance.

[ec2-user@ip-172-30-0-30 ~]$ lsblk

NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0  30G  0 disk
└─xvda1 202:1    0  30G  0 part /


This output shows one available disk with one partition. The disk (or volume) name is xvda and the partition name is xvda1.

Expand Partition to New Available Disk Volume

Using the growpart command expand the partition from it's original and current size to the new available disk size.

Please note, the name of your volume may be different.

$ sudo growpart /dev/xvda 1

Expand file system

Using resize2fs  command expand the file system from it's original and current size to the new available disk size.
Please note, the name of your volume may be different.

$ sudo resize2fs /dev/xvda1

Check Partitions and Disk Space

After expanding the partition to the new available size limit, you can check the volumes using the lsblk command again. Also confirm the available storage and usage with the df -h command.

[ec2-user@ip-172-30-0-30 ~]$ lsblk

NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0  30G  0 disk
└─xvda1 202:1    0  30G  0 part /
[ec2-user@ip-172-30-0-30 ~]$ df -h

Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        488M   56K  488M   1% /dev
tmpfs           497M     0  497M   0% /dev/shm
/dev/xvda1       30G  4.2G   26G  15% /

Caveats and Considerations

You may have a more than one Volume attached to your EC2 Instance. If that's the case identify which one you are using to store your sites files and expand that one.

See also AWS official documents for more details

Did this answer your question?