Best Way to Extend a Linux File System After Resizing AWS EBS Volume

Fabiano Becatini
3 min readMar 24, 2024
Best Way to Extend a Linux File System After Resizing AWS EBS Volume

AWS allows you to increase the size of Elastic Block Store (EBS) volumes on the fly. This feature is useful when you’re running low on disk space.

However, just resizing the volume through the AWS Console or AWS CLI isn’t enough.

You also must extend the partition and file system of your EC2 instance volume to make use of the extra space. You can do this as soon as the volume enters the optimizing state.

This blog post will guide you through the process of extending your EC2 volume running a Linux OS.

IMPORTANT! Before you begin

  • Take a snapshot of the volume, just in case you can revert the changes if needed.
  • Make sure the volume modification was successful and that it’s either in theoptimizingor completed state.
  • Check if the root partition is full. If it’s 100% used, run the command below. Otherwise, you won’t be able to execute growpart command.
sudo mount -o size=10M,rw,nodev,nosuid -t tmpfs tmpfs /tmp

Prerequisites

The purpose of this blog post is to show you how to extend the file system running a Linux OS.

--

--