An EC2 instance's root volume is at 99% and you can't take downtime. How do you grow it?
BeginnerTroubleshootingDisk, memory and CPU
Answer
Likely causes → The volume was sized too small for logs, data or packages. EBS volumes can be grown online without a reboot.
Diagnose →
df -hT /
lsblk
Fix →
aws ec2 modify-volume --volume-id vol-0abc --size 100
aws ec2 describe-volumes-modifications --volume-ids vol-0abc # wait for "optimizing" or "completed"
sudo growpart /dev/nvme0n1 1
sudo resize2fs /dev/nvme0n1p1 # ext4
# or
sudo xfs_growfs -d / # xfs
If the disk is completely full, growpart may fail to write its temp file; free a little space first (old journal logs: journalctl --vacuum-size=200M).
Prevent → Alert at 80% disk with a growth-rate forecast (predict_linear(node_filesystem_avail_bytes[6h], 24*3600) < 0), and keep data and logs on separate volumes.
More on Disk, memory and CPU
The app fails to write with "No space left on device", but `df -h` shows the volume is only 40% used.Beginner`df -h` says `/` is 100% full, but `du -sh /*` only adds up to 30% of the disk.BeginnerA server shows load average 40 on 8 cores, but `top` shows CPU 60% idle and the app is crawling.BeginnerPods are being evicted with "The node was low on resource: ephemeral-storage. Container app was using 18Gi, which exceeds its request of 0."IntermediateCI build agents running Docker fail with "no space left on device" while pulling images; `/var/lib/docker` is 95% full.IntermediatePostgres on a VM died overnight; `dmesg` shows "Out of memory: Killed process 2314 (postgres) total-vm:..., anon-rss:...".Intermediate