EC2
AWS
storage
resizing
troubleshooting

EC2 Storage attached at sda is /dev/xvde1 cannot resize

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

On EC2, the device name you specify when attaching a volume is not always the same name the operating system shows inside the instance. That is why a volume attached as /dev/sda in AWS may appear as something like /dev/xvde1 or another mapped device in Linux. The resize process still works, but you must identify the actual block device and then grow both the partition and the filesystem inside the guest OS.

Why The Device Name Looks Different

AWS exposes a logical device name through the EC2 API, but the Linux kernel and virtualization layer may rename it.

That means this is normal:

  • AWS console shows /dev/sda1
  • Linux shows /dev/xvda1 or /dev/xvde1

So the first step is not guessing from the console. It is checking what the instance actually sees.

Identify The Real Volume And Partition

Use lsblk or nvme list depending on the instance type.

bash
lsblk

Typical output might show something like:

text
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvde    202:64   0  50G  0 disk
└─xvde1 202:65   0  20G  0 part /

That tells you the disk is xvde and the filesystem is mounted on partition xvde1.

Resize The EBS Volume First

The operating system cannot grow beyond the size the EBS volume provides. Increase the EBS volume size in AWS first, using the console or CLI.

bash
aws ec2 modify-volume --volume-id vol-1234567890abcdef0 --size 50

After AWS reports the modification is complete or optimizing, the instance can see the larger block device, but the partition and filesystem usually still need to be expanded.

Grow The Partition

If the filesystem lives on a partition such as /dev/xvde1, grow that partition after the EBS volume is enlarged.

bash
sudo growpart /dev/xvde 1

This tells growpart to expand partition 1 on disk /dev/xvde.

Run lsblk again afterward to confirm the partition size changed.

Grow The Filesystem

The final step depends on the filesystem type.

For ext4:

bash
sudo resize2fs /dev/xvde1

For xfs:

bash
sudo xfs_growfs /

You can check the filesystem type with:

bash
df -Th

Only after this step will df -h show the newly usable space in the mounted filesystem.

A Typical End-To-End Sequence

bash
1lsblk
2sudo growpart /dev/xvde 1
3sudo resize2fs /dev/xvde1
4df -h

Replace the last command with xfs_growfs if the filesystem is XFS.

The important pattern is:

  • enlarge the EBS volume in AWS
  • enlarge the partition in the guest OS if one exists
  • enlarge the filesystem

Common Pitfalls

The most common mistake is trying to resize the filesystem before enlarging the EBS volume itself. The guest OS cannot grow into space that AWS has not added yet.

Another issue is confusing the AWS attachment name with the Linux block device name. Always trust lsblk inside the instance.

It is also easy to forget the partition step. If the disk grew but the partition did not, the filesystem still cannot use the extra capacity.

Finally, use the correct filesystem tool. resize2fs is for ext-family filesystems, while XFS uses xfs_growfs.

Summary

  • AWS device names and Linux device names on EC2 often differ.
  • Use lsblk inside the instance to identify the real disk and partition.
  • First enlarge the EBS volume in AWS, then grow the partition, then grow the filesystem.
  • Use resize2fs for ext filesystems and xfs_growfs for XFS.
  • Do not assume the console attachment name is the exact path the OS will use.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.