How to Increase EBS Volume Size Without Downtime (EC2)
To increase an EBS volume without downtime, take a snapshot, then in the EC2 console choose the volume → Actions → Modify volume and enter the new size while the instance keeps running. Inside Linux, grow the partition with sudo growpart /dev/nvme0n1 1 and the filesystem with sudo xfs_growfs -d / (XFS, Amazon Linux) or sudo resize2fs /dev/nvme0n1p1 (ext4, Ubuntu). No stop or reboot is needed; EBS volumes can only grow, never shrink.
Students in my class always ask: "Sir, I increased the size in the console, so why does df -h still show 8G?" Look – the disk grew, but the partition and filesystem inside Linux did not. Example: your web server – logs filled the disk. Let's add space without stopping the server. Let's go.
माझ्या क्लास मध्ये स्टुडंट्स नेहमी विचारतात: "सर, कन्सोल मध्ये साइज वाढवला, मग df -h अजून 8G का दाखवतो?" बघा – डिस्क वाढली, पण Linux मधलं partition आणि filesystem नाही वाढले. उदाहरण: तुमचा वेब सर्व्हर – logs ने डिस्क भरली. सर्व्हर बंद न करता जागा वाढवूया. चला.
मेरी क्लास में स्टूडेंट्स हमेशा पूछते हैं: "सर, कंसोल में साइज़ बढ़ाया, फिर df -h अभी भी 8G क्यों दिखाता है?" देखो – डिस्क बढ़ गई, पर Linux के अंदर का partition और filesystem नहीं बढ़े. उदाहरण: आपका वेब सर्वर – logs से डिस्क भर गई. सर्वर बंद किए बिना जगह बढ़ाते हैं. चलो.
Quick answer
After Actions → Modify volume (e.g. 8 → 20 GiB) and the state shows optimizing or completed, run on the instance:
lsblk # disk 20G, partition still 8G
sudo growpart /dev/nvme0n1 1 # grow partition 1 (note the space)
sudo xfs_growfs -d / # XFS (Amazon Linux, CentOS) – mount point
# sudo resize2fs /dev/nvme0n1p1 # ext4 (Ubuntu) – partition device
df -hT / # new size
What do I need before resizing an EBS volume?
- An EC2 instance and SSH access — see How to SSH into EC2.
- The volume ID: EC2 → Instances → select the instance → Storage tab.
- A snapshot of the volume, taken first (Step 1).
- To know the device names: on Nitro instances (t3 and newer) the root disk is
/dev/nvme0n1and its first partition/dev/nvme0n1p1; on older Xen instances (t2) they are/dev/xvdaand/dev/xvda1.
What happens when an EBS volume grows?
The instance keeps running. First the EBS volume grows (Modify volume), then the partition (growpart), then the filesystem (xfs_growfs). Only then does df -h show the new size.
Instance चालूच राहतो. आधी EBS volume वाढतो (Modify volume), मग partition (growpart), मग filesystem (xfs_growfs). तेव्हाच df -h नवीन साइज दाखवतो.
Instance चलता रहता है. पहले EBS volume बढ़ता है (Modify volume), फिर partition (growpart), फिर filesystem (xfs_growfs). तभी df -h नया साइज़ दिखाता है.
Resizing is a two-part job: (A) make the EBS volume bigger in AWS, then (B) make the partition and the filesystem inside Linux use the new space.
Before: [ EBS 8 GiB ][ partition 8 GiB ][ filesystem 8 GiB ]
Step A: [ EBS 20 GiB ][ partition 8 GiB ][ filesystem 8 GiB ] ← lsblk shows 20G disk, df still 8G
Step B1 growpart: [ partition 20 GiB ]
Step B2 xfs_growfs / resize2fs: [ filesystem 20 GiB ] ← df now shows 20G
How do I increase the size of an EBS volume?
Step 1 — Take a snapshot
EC2 → Volumes → select the volume → Actions → Create snapshot → description before-resize → Create snapshot. EBS volumes can only be made bigger, never smaller, so the snapshot is your way back.
Step 2 — Modify the volume in the console
- EC2 → Instances → select the instance → Storage tab → click the Volume ID.
- Select the volume → Actions → Modify volume.
- Enter the new Size (e.g. 20 GiB); optionally change the type to gp3 → Modify → confirm.
- Wait until the Volume state shows in-use – optimizing or completed. The new size is usable as soon as it enters optimizing.
CLI alternative: aws ec2 modify-volume --volume-id vol-0123456789abcdef0 --size 20
Step 3 — Check the current layout
lsblk
df -hT
Example on a Nitro instance after Step 2 (root volume grown from 8 to 20 GiB):
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 8G 0 part /
├─nvme0n1p127 259:2 0 1M 0 part
└─nvme0n1p128 259:3 0 10M 0 part /boot/efi
Filesystem Type Size Used Avail Use% Mounted on
/dev/nvme0n1p1 xfs 8.0G 1.9G 6.1G 24% /
The disk is 20G, but the partition nvme0n1p1 and the filesystem are still 8G.
Step 4 — Grow the partition
Note the space between the disk and the partition number:
sudo growpart /dev/nvme0n1 1 # Nitro instance
# sudo growpart /dev/xvda 1 # older Xen instance (t2)
lsblk # nvme0n1p1 should now be 20G
growpart comes from cloud-utils-growpart (Amazon Linux, CentOS) or cloud-guest-utils (Ubuntu) and is usually pre-installed.
Step 5 — Grow the filesystem
Check the type in the df -hT output, then:
# XFS (default on Amazon Linux 2023, Amazon Linux 2 and CentOS Stream 9) – give the MOUNT POINT
sudo xfs_growfs -d /
# ext4 (default on Ubuntu) – give the PARTITION DEVICE
sudo resize2fs /dev/nvme0n1p1
Step 6 — Verify
df -hT /
lsblk
df shows 20G, and the server never stopped. 🎉
Ravindra Bagale's Tip
💡 Many students run resize2fs on XFS or forget the space in growpart /dev/nvme0n1 1. First check the filesystem type with df -hT: XFS needs xfs_growfs -d / (mount point), ext4 needs resize2fs (partition device). And always take a snapshot before resizing. Remember the order!
Ravindra Bagale's Tip – मराठी
💡 खूप स्टुडंट्स XFS वर resize2fs चालवतात किंवा growpart /dev/nvme0n1 1 मधली स्पेस विसरतात. आधी df -hT ने filesystem टाइप बघा: XFS ला xfs_growfs -d / (mount point), ext4 ला resize2fs (partition device). आणि resize आधी snapshot नक्की घ्या. क्रम लक्षात ठेवा!
Ravindra Bagale's Tip – हिंदी
💡 बहुत स्टूडेंट्स XFS पर resize2fs चला देते हैं या growpart /dev/nvme0n1 1 वाला स्पेस भूल जाते हैं. पहले df -hT से filesystem टाइप देखो: XFS के लिए xfs_growfs -d / (mount point), ext4 के लिए resize2fs (partition device). और resize से पहले snapshot ज़रूर लो. क्रम याद रखो!
How do I grow a data volume without a partition?
If you formatted a whole extra disk directly (for example /dev/nvme1n1 mounted on /data, with no p1 partition), skip growpart. After Modify volume, just run:
sudo xfs_growfs -d /data # XFS
sudo resize2fs /dev/nvme1n1 # ext4
cloud-init on Amazon Linux and Ubuntu also grows the root partition automatically at boot. If you increased the root volume and rebooted, df -h may already show the new size — the steps above are for doing it live, without a reboot.
Ravindra Bagale's Tip
After you modify a volume, you usually have to wait up to 6 hours before modifying the same volume again. So don't make lots of tiny changes – think about what you need for the next few months and pick the size once. And check df -h regularly, not when the disk is already at 100%.
Ravindra Bagale's Tip – मराठी
एक volume modify केल्यावर त्याच volume ला परत modify करायला साधारण 6 तासांपर्यंत थांबावं लागतं. म्हणून खूप छोटे-छोटे बदल करू नका – पुढच्या काही महिन्यांची गरज विचार करून एकदाच साइज ठरवा. आणि df -h रोज बघा, डिस्क 100% झाल्यावर नाही.
Ravindra Bagale's Tip – हिंदी
एक volume modify करने के बाद उसी volume को फिर से modify करने के लिए आमतौर पर 6 घंटे तक रुकना पड़ता है. इसलिए बहुत छोटे-छोटे बदलाव मत करो – अगले कुछ महीनों की ज़रूरत सोचकर एक बार में साइज़ तय करो. और df -h रोज़ देखो, डिस्क 100% होने के बाद नहीं.
How do I fix common EBS resize errors?
Ghabru naka 😅 — the fix is almost always one of these:
| Symptom | Likely cause | Fix |
|---|---|---|
df -h still shows the old size |
Partition and filesystem not grown | sudo growpart /dev/nvme0n1 1, then xfs_growfs / resize2fs |
growpart: NOCHANGE: partition 1 ... could only be grown by 0 |
Volume change not visible yet, wrong device, or already grown | Wait for optimizing; check lsblk; use the disk name, not the partition |
resize2fs: Bad magic number in super-block |
Ran resize2fs on an XFS filesystem |
Use sudo xfs_growfs -d / |
xfs_growfs: ... is not a mounted XFS filesystem |
Gave a device or an ext4 filesystem | XFS takes the mount point (/); ext4 uses resize2fs |
growpart: command not found |
Package missing | sudo yum install -y cloud-utils-growpart (Ubuntu: cloud-guest-utils) |
| Modify volume is greyed out or refused | Modified less than ~6 hours ago | Wait, then try again |
| Want a smaller disk | EBS cannot shrink | Create a smaller new volume and copy the data |
Learn it properly
This guide is the short path. The free AWS course explains every step in depth, with labs:
Got it? Growing the volume in the console is only half the job – the partition and filesystem inside must grow too. Snapshot, modify, growpart, xfs_growfs – and the server is not down for a single second.
समजलं का? कन्सोल मध्ये volume वाढवला की काम अर्धंच होतं – आत partition आणि filesystem पण वाढवावे लागतात. Snapshot, modify, growpart, xfs_growfs – आणि सर्व्हर एक सेकंद पण बंद नाही.
समझ आया? कंसोल में volume बढ़ाना सिर्फ़ आधा काम है – अंदर partition और filesystem भी बढ़ाने पड़ते हैं. Snapshot, modify, growpart, xfs_growfs – और सर्वर एक सेकंड भी बंद नहीं.
Frequently asked questions
Can I increase an EBS volume without stopping the instance?
Yes. Modify the volume in the console while the instance runs, then grow the partition with growpart and the filesystem with xfs_growfs or resize2fs. No stop and no reboot are needed.
Why does df -h still show the old size after I modified the volume?
Only the disk grew. The partition and the filesystem inside Linux still use the old size until you run sudo growpart /dev/nvme0n1 1 and sudo xfs_growfs -d / (XFS) or sudo resize2fs /dev/nvme0n1p1 (ext4).
Can I make an EBS volume smaller?
No. EBS volumes can only be made bigger, never smaller. To get a smaller disk you must create a new volume and copy the data.
How often can I modify an EBS volume?
After a modification you must wait, usually up to 6 hours, before you can modify the same volume again.
Which command do I use: xfs_growfs or resize2fs?
Check with df -hT. XFS (default on Amazon Linux and CentOS Stream) uses xfs_growfs -d / with the mount point; ext4 (default on Ubuntu) uses resize2fs with the partition device.
Why does growpart say NOCHANGE?
The partition already fills the disk: the volume change has not reached the instance yet, you gave the wrong device, or cloud-init already grew it at boot. Check with lsblk.