Generally, each EC2 instance you launch using an AMI has a root volume of 30 GiB during launch. However, you can increase this general-purpose SSD (gp2) space afterward by expanding the EBS volume size first and then extending the associated file system space at the OS level.
The Amazon EC2 console or the AWS CLI is enough to get you through the first phase. But you’ll need to navigate through Disk Management or PowerShell for the latter. Let’s get into the details of how to increase the root volume in AWS EC2.
How Do I Increase the Root Volume in EC2?
Increasing the root volume in AWS EC2 consists of two main steps.
Step 1: Expand EBS Volume Size
As mentioned earlier, the Amazon EC2 console or the AWS CLI will help you expand the EBS volume size. Here’s how.
Expand EBS Volume Size Using Amazon EC2 Console
Below are the steps required to expand the size of your EBS volume through the EC2 console.
1. Log into your EC2 console and select Instances from the navigation menu.
2. Choose your instance, go to the Storage tab, and select the desired volume ID.
3. From Volumes, check the box next to the volume to increase. Next, click on Modify volume from the Actions pane.
4. In the Volume details section, enter the Size and IOPS for the corresponding type of volume.
5. Click Modify twice, once from here and once from the dialog box that arrives.
You can view the progress below the Volume state. Once the state turns to Optimize, it is time to extend the file system of the EBS volume.
Expand EBS Volume Size Using AWS CLI
Follow the steps below to utilize command lines instead of the EC2 console for expanding the root volume size.
1. Expand the EBS volume using the following command.
aws ec2 modify-volume –region RegionName –volume-id VolumeId –size NewSize –volume-type NewType –iops NewIops
Use the actual values of the region, volume ID, and volume type instead of the placeholders.
2. Like the EC2 console, you can also view the optimization status by running the command below.
aws ec2 describe-volumes-modifications –volume VolumeId –region RegionName
Step 2: Extend the File System of the EBS Volume
Extending the file system is doable through the Disk Management of PowerShell. You may choose either as per your preferences.
If you use Disk Management, the steps involved are as follows.
1. Connect to your EC2 Windows instance using the Remote Desktop Protocol (RDP).
2. Extend the file system of the EBS volume using the Disk Management Utility.
But if you prefer using PowerShell instead, here’s what to do.
1. Connect to your EC2 instance using RDP.
2. Extend the file system space through PowerShell.
Questions May Ask
How do I increase root volume in AWS EC2 without restarting?
Open the AWS console, sign in, and go to EC2 > Elastic Block Store > Volumes. Choose the root volume you want to increase and click Actions. Then, select Modify Volume to open the popup dialog box and enter your desired volume size.
Can we increase EBS volume size without downtime?
It is possible to increase EBS volume size without any downtime. Therefore, the resizing does not take up valuable runtime, making it quite convenient. Besides, you can even change the volume type and calibrate its performance with zero downtime.
How do I add storage to root volume?
If you’re running out of storage despite opting for the maxed-out volume, you can get a bit of headroom. It is achievable by deleting aged and unused files or adding disks and partitioning the root system.
Here’s one last tip. Before you follow the second step of increasing root volume in AWS EC2, which is extending the file system, create a snapshot of the volume. That way, you can roll back to a previous version and, in turn, secure valuable data in the file system.