Comprehensive Guide: How to Increase EBS Volume Size on EC2 Instances — Step-by-Step Instructions

Prateek Mishra
2 min readNov 22, 2022

--

  1. Modify the size of the attached EBS volume using the Amazon EC2 Management Console or the AWS CLI.
  2. Connect to the EC2 instance using SSH.
  3. Run the lsblk command to list the block devices on the instance.
  4. Use the growpart command to resize the root partition: growpart /dev/xvda 1
  5. Use the xfs_growfs command to resize the XFS file system: xfs_growfs -d / or resize2fs /dev/xvda1
  6. Run the fdisk -l command to verify the new size of the volume.

Note 1: Make sure to replace /dev/xvda the actual device name of the root partition on your EC2 instance.

These steps should increase the size of the EBS volume attached to your EC2 instance. You may need to reboot the instance for the changes to take effect.

Note 2:
>> xfs_growfs -d /

xfs_growfs: / is not a mounted XFS filesystem

then you need to run df -h command and need to see which file system is mounted on / drive

in my case

then you need to run this command

>> resize2fs /dev/root

If you have a nvmeon1 disk type then you can follow this:-

>> lsblk

>> growpart /dev/nvme0n1 1

>> resize2fs /dev/nvme0n1p1

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Prateek Mishra
Prateek Mishra

Written by Prateek Mishra

I am a tech enthusiast who thrives on experimenting with cutting-edge technologies

No responses yet

Write a response