You enlarged the EBS volume but the instance still shows the old size
df -h shows the old size after the volume was increasedShort answer
Enlarging an EBS volume only changes the disk. The partition and the file system inside it keep their old size until you extend them. Run lsblk to compare sizes, growpart on the partition, then xfs_growfs for XFS or resize2fs for ext4. Take a snapshot first.
Fix it fast
1Find out which cause you have
Compare the disk size with the partition size, then the file system size and type.
lsblk df -hT2Match what you see, then jump to its fix
- 1
lsblk shows the disk larger than its partitionThe partition was never extendedFix - 2
df -hT shows type xfs and the old size, even though the partition is now largeThe XFS file system was not extendedFix - 3
df -hT shows type ext4 with the old sizeThe ext4 file system was not extendedFix - 4
mkdir: cannot create directory ... No space left on device and FAILED: failed to make temp dirThe disk is out of space, so growpart cannot startFix
- 1
What does the error look like?
df -h shows the old size after the volume was increasedNOCHANGE: partition 1 is size 16773087. it cannot be grownxfs_growfs: /data is not a mounted XFS filesystemThe filesystem is already 3932160 blocks long. Nothing to do!
Cause 1 of 4
The partition was never extended
1Check
In the lsblk output, if the partition is smaller than the volume, the partition must be grown first. The volume must be in the optimizing or completed state.
sudo lsblk2Fix
Run growpart with the device name and partition number, with a space between them. Use the device lsblk shows (nvme0n1 on Nitro, xvda on Xen).
sudo growpart /dev/nvme0n1 13Verify
lsblk now shows the partition and the volume at the same size.
sudo lsblkConfirmed by docs.aws.amazon.com
Cause 2 of 4
The XFS file system was not extended
1Check
Get the mount point and type from df -hT.
df -hT2Fix
Run xfs_growfs against the mount point, not the device.
sudo xfs_growfs -d /3Verify
df -hT shows the new size for that mount point.
df -hT /Confirmed by docs.aws.amazon.com
Cause 3 of 4
The ext4 file system was not extended
1Check
A Bad magic number error from resize2fs means the file system is not ext4, so check the type again.
df -hT2Fix
Run resize2fs with the partition device that df -hT shows.
sudo resize2fs /dev/nvme0n1p13Verify
The reported size equals the volume size.
df -hT /Confirmed by docs.aws.amazon.com
Cause 4 of 4
The disk is out of space, so growpart cannot start
1Check
growpart needs a little free space for a temporary directory.
df -h /tmp /2Fix
Free some space, for example by removing old logs or packages, then run growpart again.
sudo du -xh / --max-depth=1 | sort -h | tail3Verify
growpart completes and lsblk shows the larger partition.
sudo growpart /dev/nvme0n1 1Confirmed by docs.aws.amazon.com
How do I stop it coming back?
- Take a snapshot before every partition change, as AWS advises.
- Wait until the volume modification reaches optimizing or completed.
- If the volume uses LVM, extend the logical volume as well; growpart alone is not enough.
- Write the steps in a runbook with your device names so the next resize takes minutes.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
dnf cannot install MySQL on Amazon Linux 2023
dnf cannot find a mysql-server package on Amazon Linux 2023
Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.
3 causes, each with a fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fixServers
Apache returns 504 Gateway Timeout when PHP takes too long
Quick requests work, slow ones end in a 504 after a fixed wait
A 504 from Apache means the backend did not answer within the proxy timeout.
2 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
Apache warns that a ${VAR} config variable is not defined
${VAR} left unchanged in the configuration, with a warning in the error log
Apache expands ${VAR} from Define or from the shell environment that exists when the server starts.
3 causes, each with a fix