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.
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/xvda1or/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.
Typical output might show something like:
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.
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.
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:
For xfs:
You can check the filesystem type with:
Only after this step will df -h show the newly usable space in the mounted filesystem.
A Typical End-To-End Sequence
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
lsblkinside 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
resize2fsfor ext filesystems andxfs_growfsfor XFS. - Do not assume the console attachment name is the exact path the OS will use.
Related reading
- EC2 Ubuntu 14 default password
- EC2/Route53 How Do I Point Apex Record at Load Balancer?
- ECS Fargate Scheduled Task not running
- ECS unable to assume role
- echo that outputs to stderr
- Eclipse cannot load SWT libraries
- Efficient substring Search in DynamoDB
- EHCache RMI Replication on JBoss/EC2 throws java.rmi.NoSuchObjectException no such object in table

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack 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.