14+ years building on WordPress / Replies in under 5 hours
PHP 3 min read · Updated July 2026

How to Resize an EBS Volume on EC2 (No Downtime)

Photo of Ajay Khandal
Ajay Khandal
WordPress Developer
TL;DR

Resizing an EBS volume on EC2 requires three steps, not one: modify the volume size in AWS (increase only, no downtime or reboot needed), extend the partition with growpart, then grow the filesystem — resize2fs for ext4, or xfs_growfs (pointed at the mount point, not the device) for XFS, which is the Amazon Linux default. Skipping the partition-extend step is why df still shows the old size after modifying the volume in AWS.

Resizing an EBS volume is three separate steps: modify the volume in AWS, extend the partition, then grow the filesystem. It’s easy to stop after the first step, since AWS confirms the volume is resized — but the OS won’t see the extra space until you do the other two. No reboot is required for any of it; Elastic Volumes support live modification while the instance keeps running.

Step 1: Snapshot the Volume First

Before changing anything, take a snapshot as a rollback point. In the AWS console, go to Elastic Block Store > Volumes, select the volume, then Actions > Create Snapshot. This step is cheap insurance and worth doing even though volume modification itself is a low-risk, well-tested AWS operation.

Step 2: Modify the Volume Size

In the console: Elastic Block Store > Volumes, select the volume, Actions > Modify Volume, increase the Size field, and confirm. Two things worth knowing before you do this: Modify Volume only increases size — AWS doesn’t support shrinking a volume this way, so pick a size you’re confident you need. And if you’ve modified this volume recently, AWS may require the previous modification to finish before starting a new one — check the volume’s state in the console if a second modification doesn’t start immediately.

Step 3: Extend the Partition

This is the step most guides skip, and it’s the reason df shows the old size after Step 2. AWS resized the block device, but the partition on it is still the old size — the OS won’t use space outside the partition boundary. Connect via SSH and run lsblk to see your current layout and confirm the device name. Then extend the partition with growpart:

sudo growpart /dev/xvda 1

(Device name and partition number depend on your instance — check what lsblk actually shows rather than assuming. Older instance types use /dev/xvdX naming; current-generation Nitro-based instances, which is most instance types running today, use NVMe naming like /dev/nvme0n1 with partitions as /dev/nvme0n1p1.)

Step 4: Extend the File System

Which command you need depends on your filesystem, and using the wrong one just returns an error rather than doing anything harmful. Check with df -T or lsblk -f first.

  • ext4 (common on Ubuntu and Debian AMIs): sudo resize2fs /dev/xvda1 — takes the device path.
  • XFS (the default on Amazon Linux): sudo xfs_growfs -d /mountpoint — takes the mount point, not the device path. Passing a device path here fails with an error rather than working.

Step 5: Verify

Run df -h and confirm the new size shows up for the correct mount point. If it doesn’t, double check Step 3 actually completed against the right device — a partition extend that targeted the wrong device or partition number is the most common reason this doesn’t work on the first try.

If you’re doing this as part of moving a WordPress install to bigger infrastructure rather than just freeing up space, the WordPress migration guide covers the rest of that process. And if PHP itself needs an upgrade while you’re already on the server, upgrading to PHP 8.5 on Ubuntu walks through that separately.

Frequently asked questions

No. Elastic Volumes support live modification, so the volume, partition, and filesystem can all be resized while the instance keeps running, with no reboot required at any step.

Because modifying the volume in AWS only resizes the underlying block device — it doesn't extend the partition or filesystem automatically. Run growpart to extend the partition, then resize2fs (ext4) or xfs_growfs (XFS) to grow the filesystem, and df -h will then show the new size.

Run df -T or lsblk -f and check the filesystem type column. Amazon Linux defaults to XFS; Ubuntu and Debian AMIs commonly use ext4. Using the wrong resize command for your filesystem just returns an error rather than causing damage.

No. AWS's Modify Volume feature only supports increasing size. To reduce a volume's size, you'd need to create a new, smaller volume and migrate the data over manually — there's no in-place shrink option.

It depends on the underlying instance hardware. Older, non-Nitro instance types use the traditional /dev/xvdX naming. Current-generation Nitro-based instances, which cover most instance types running today, use NVMe naming instead, like /dev/nvme0n1 with partitions as /dev/nvme0n1p1. Run lsblk to see which naming your instance actually uses rather than assuming.

Photo of Ajay Khandal

Written by Ajay Khandal

I'm a freelance WordPress developer with 14+ years of experience building, fixing, and speeding up sites for businesses, agencies, and store owners across the US, UK, Europe, and Australia. I specialize in custom themes, WooCommerce, and performance — the kind of work that shows up as faster load times and fewer support tickets. No account managers, no outsourced tickets — you work directly with me, with replies typically inside 5 hours.

Work with me →