Symptoms
When a disk is full, you may see errors like "No space left on device", services crashing, or inability to create files. Even databases can corrupt if they cannot write.
Quick Assessment
# Check all filesystems
df -h
# Check inode usage (can be full even with free space)
df -iFind What Is Using Space
# Largest directories
du -h --max-depth=1 / 2>/dev/null | sort -rh | head -15
# Common space hogs
du -sh /var/log/*
du -sh /tmp/*
du -sh /var/cache/*Quick Cleanup
# Truncate large log files (don't delete — services may hold file handles)
sudo truncate -s 0 /var/log/syslog
sudo truncate -s 0 /var/log/kern.log
# Clean package manager cache
sudo apt clean
# Remove old journals
sudo journalctl --vacuum-size=100M
# Find files over 100MB
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/nullHandle Deleted-But-Open Files
A deleted file still uses space if a process has it open:
# Find deleted files still using space
sudo lsof +L1 | grep deleted
# Restart the service to release the file handle
sudo systemctl restart rsyslogPrevention
- Set up log rotation (
/etc/logrotate.d/) - Monitor disk usage with cron alerts
- Use
tmpwatchortmpreaperto clean temporary files