A disk is 100% full in production. What do you do first?
BeginnerProductionDisk, Capacity & Backups
Answer
df -h; df -i
sudo du -xh --max-depth=1 / 2>/dev/null | sort -h | tail
sudo lsof +L1 # deleted-but-open files
sudo journalctl --vacuum-size=500M
sudo find /var/log -name '*.gz' -mtime +7 -delete
Free space safely first (old rotated logs, caches, package caches apt clean/dnf clean all), truncate rather than delete open logs (: > file), then grow the volume and fix the root cause (rotation, retention, alerting).
More on Disk, Capacity & Backups
How do you lay out filesystems on a production server?IntermediateHow do you do capacity planning for disk?IntermediateWhat disk usage alert thresholds do you use?BeginnerHow do you clean up disk space safely on Docker hosts?IntermediateWhat is the 3-2-1 backup rule?BeginnerHow do you use rsync for backups?Intermediate