How to increase the root disk space of instance in AWS ?

From PheonixSolutions
Jump to navigation Jump to search

Introduction

[edit]

As your system grows, you may find the need to increase the root disk space of your AWS EC2 instance. This guide walks you through the steps to expand the root disk space of an instance running Ubuntu 20.04 on AWS. By following these steps, you can efficiently scale your instance's storage capacity to accommodate growing storage requirements.

Prerequisites

[edit]
  • Access to the AWS root account.
  • Operating System: Ubuntu 20.04.

Steps

[edit]

1. Login to the AWS Account:

Access your AWS account using your credentials.

2. Navigate to EC2 Service:

Go to the EC2 service dashboard.

3. Select the Instance:

Search for and select the instance for which you want to increase the root disk space.

4. Access Storage Options:

In the instance details, click on the "Storage" option.

5. Modify Volume:

Click on the Volume ID associated with the root volume of the instance.

6. Modify Volume Size:

Click on "Actions" and choose "Modify" from the dropdown menu at the top right corner.

7. Adjust Size:

Under the "Size (GiB)" section, modify the size of the root disk space as per your requirements. Click the "Modify" button at the bottom to apply the changes.

Note: Increasing the volume size on AWS will affect the server.

8. Update Partition and Filesystem:

If the disk space increase is not reflected on the server, run the following commands:

 # growpart /dev/xvda 1

Here, xvda refers to the disk, and 1 refers to the partition number.

 # resize2fs /dev/xvda1

Here, xvda1 refers to partition 1 on disk xvda.

Conclusion

[edit]

Expanding the root disk space of an AWS EC2 instance running Ubuntu 20.04 is essential for accommodating increasing storage demands. By following the outlined steps and ensuring proper configurations, you can effectively scale your instance's storage capacity to meet the needs of your growing system. With the increased root disk space, you can continue to leverage AWS infrastructure for optimal performance and scalability of your applications and services.