Interview Prep/Linux/Disk, Capacity & Backups

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).

All Linux questions Roadmap: Linux

More on Disk, Capacity & Backups