Logo

dev-resources.site

for different kinds of informations.

How to extend an EBS volume in AWS and then grow EFS Filesystem

Published at
7/26/2023
Categories
aws
ebs
efs
filesystem
Author
noyonict
Categories
4 categories in total
aws
open
ebs
open
efs
open
filesystem
open
Author
8 person written this
noyonict
open
How to extend an EBS volume in AWS and then grow EFS Filesystem

Here are the steps to extend an EBS volume in AWS and then to grow the filesystem on it:

1) Increase the EBS volume size in AWS:

  • Open the EC2 console on AWS.
  • On the left-hand side menu, navigate to 'Volumes' under 'Elastic Block Store'.
  • Identify the volume connected to your instance, right-click on it and select 'Modify Volume'.
  • Specify the new desired volume size and then select 'Modify'. The state of the volume will change to 'Optimizing' after a short while, this indicates that the size alteration has been recognized by AWS.

Note: The process can be executed while your instance is still running, but it's advisable to take a snapshot before making changes to avoid any data loss.

2) Rescan the disk on your EC2 instance:

To ensure that your EC2 instance identifies the new disk size, connect via SSH and execute the command:

sudo lsblk
Enter fullscreen mode Exit fullscreen mode

The output should reveal that the disk size has increased, but the partition size hasn't.

3) Grow the partition to use the new space:

If the partition does not reflect the new size, you will need to expand it. Run the following command to do this:

sudo growpart /dev/xvda 1
Enter fullscreen mode Exit fullscreen mode

In the command above, /dev/xvda is the disk, and 1 is the partition number.

4) Resize the filesystem:

Following the partition extension, resize the filesystem with the following command (assuming the filesystem is XFS):

sudo xfs_growfs /dev/xvda1
Enter fullscreen mode Exit fullscreen mode

The command may vary based on the filesystem. For instance, if the filesystem is EXT, you'd use resize2fs instead of xfs_growfs. If you're unsure of the filesystem, use sudo file -s /dev/xvda1 to find out.

IMPORTANT: Always ensure you have a solid backup of your data before running these operations. Misusing these commands can lead to data loss.

5) Verify the changes:

Finally, verify that your filesystem is using the new space by running the df -h command:

df -h
Enter fullscreen mode Exit fullscreen mode

You should now see that the size of the filesystem matches the size of the EBS volume you set in AWS.

Remember, these steps are specific to an AWS EC2 instance using an EBS volume with an XFS filesystem. If your setup is different, the steps may vary.

filesystem Article's
30 articles in total
Favicon
List filenames recursively in a directory using this utility function.
Favicon
Where Does Deleted Data Go? Unveiling the Secrets of File Deletion and Overwriting
Favicon
Amazon FSx for NetApp ONTAP - Expert Storage for any workload
Favicon
Understanding the Linux Filesystem, Root File System, and EXT File System
Favicon
How to fix RHEL file system
Favicon
Understanding the Linux Filesystem: A Quick Guide
Favicon
Introducing Cora: A Powerful File Concatenation Tool for Developers
Favicon
Hitchhikers guide to building a distributed filesystem in Rust. The very beginning…
Favicon
Understanding Where Deleted Files Go After Deleting them from Recycle Bin and How to Recover Them
Favicon
I wrote a File System CLI in Rust
Favicon
La extravagante posibilidad de los espacios en los nombres de archivos.
Favicon
Starting with C
Favicon
Getting the list of files and their info
Favicon
Processing flags
Favicon
Sorting and formatting the output. The Finale.
Favicon
Command, file types and flags
Favicon
Unit test in Laravel by example
Favicon
What is File Manipulation?
Favicon
you are not the owner so you cannot change the permissions Error in Linux
Favicon
Setting Up OpenZFS on Rocky Linux
Favicon
How to extend an EBS volume in AWS and then grow EFS Filesystem
Favicon
Efficient File Naming Systems for Better File Management
Favicon
Improving the .NET API to work with the structure of the file system. Part 2. Manipulate filesystem objects.
Favicon
Improving the .NET API to work with the structure of the file system. Part 1. Enumerate filesystem objects.
Favicon
How to format SD Card to APFS on Mac
Favicon
What are linux inodes?
Favicon
Block and Filesystem side-by-side with K8s and Aerospike
Favicon
How to copy lots of data fast?
Favicon
EFS vs. FSx for ONTAP
Favicon
Use Inflint to follow files and folders convention

Featured ones: