A service fails with "No space left on device". How do you fix it?
⚡
Quick Answer
The filesystem (or inodes) is full. Find what is consuming space with df -h and du, clear the culprit (logs, old images, temp files), and add rotation/limits so it does not recur.
Detailed Answer
df -h shows which mount is full; df -i checks inode exhaustion (many tiny files). du -sh /* narrows the big directories — usual suspects are /var/log, container images, and /tmp. Fixes: rotate/truncate logs (logrotate), docker/crictl image prune, delete temp files, then set retention and quotas. On nodes this often manifests as DiskPressure evictions.
Code Example
df -h df -i du -sh /var/* | sort -h | tail
💡
Interview Tip
Mention df -i (inode exhaustion) — a full disk with free space is the sneaky version interviewers probe.
linuxdiskno-spacetroubleshooting