Home / AWS

AWSRunbookBeginner

Extending an EBS volume without downtime (Linux and Windows)

Increase an EBS volume online with modify-volume, then grow the partition and filesystem on Linux (ext4, XFS, LVM) and Windows, with a snapshot first.

Deepak Bhardwaj2 min read

Applies toAmazon EBS (gp2, gp3, io1/io2), Nitro instances

1. Snapshot first

VOL=vol-0abc123
aws ec2 create-snapshot --volume-id $VOL --description "pre-resize $(date +%F)" \
  --tag-specifications 'ResourceType=snapshot,Tags=[{Key=Purpose,Value=pre-resize}]'

2. Modify the volume

aws ec2 modify-volume --volume-id $VOL --size 200
aws ec2 describe-volumes-modifications --volume-ids $VOL \
  --query "VolumesModifications[].{state:ModificationState,progress:Progress,target:TargetSize}" --output table

You can extend the filesystem as soon as the state is optimizing; you don't need to wait for completed.

Important

One modification per volume every 6 hours, and volumes can't shrink.

3. Linux: grow the partition and filesystem

lsblk
# NVMe example: root on /dev/nvme0n1p1
sudo growpart /dev/nvme0n1 1
df -hT /                          # check the filesystem type
sudo xfs_growfs -d /              # XFS (Amazon Linux 2023, RHEL)
sudo resize2fs /dev/nvme0n1p1     # ext4 (Ubuntu)

A data volume without a partition table (filesystem created directly on /dev/nvme1n1) skips growpart:

sudo resize2fs /dev/nvme1n1       # or: sudo xfs_growfs /data

LVM:

sudo growpart /dev/nvme1n1 1
sudo pvresize /dev/nvme1n1p1
sudo lvextend -r -l +100%FREE /dev/vg_data/lv_data

If growpart says NOCHANGE, the OS hasn't seen the new size yet. Check with lsblk, wait a moment, and retry. Install it if missing: cloud-utils-growpart or cloud-guest-utils.

4. Windows

Update-HostStorageCache
$max = (Get-PartitionSupportedSize -DriveLetter D).SizeMax
Resize-Partition -DriveLetter D -Size $max

Or use Disk Management → Rescan Disks → Extend Volume.

5. Verify

  • df -h / Get-Volume shows the new size.
  • The application logs show writes succeeding again.
  • Delete the pre-resize snapshot after a few days, if your backup policy already covers the volume.

Don't forget performance

While you're modifying the volume, check whether it should move to gp3 with explicit IOPS and throughput (see the EBS performance post). You can change type, size, IOPS and throughput in the same modify-volume call.