How do you troubleshoot disk space issues on a Linux server?
Systematic disk investigation:
# Step 1: Check overall disk usage
df -h
# Step 2: Find which directory is consuming space
du -sh /* 2>/dev/null | sort -rh | head -20
# Step 3: Drill down into the problem directory
du -sh /var/* | sort -rh | head -10
# Step 4: Find specific large files
find / -type f -size +500M 2>/dev/null
# Step 5: Check for deleted-but-open files still consuming inodes
lsof | grep deleted
Common causes: application logs not rotating, large core dumps, MySQL/Postgres WAL overflow, old Docker images/volumes.