Founding prices until 15 December: 30% off Pro, locked for life. See pricing

$ … No space left on device

'No space left on device': find what's filling the disk

A write failed because the filesystem is full, or out of inodes, or a deleted file is still held open.

Linux

What it means

The kernel refused a write (ENOSPC). Usually the filesystem is full, but it can also be out of inodes (many tiny files) while df still shows free space, or the space belongs to a deleted file that a running process keeps open.

Causes and fixes

Most likely first. Run the check, and if it matches, apply the fix.

1. The filesystem is full (logs, caches, old releases, core dumps)

Check:

df -h
du -xh / --max-depth=2 2>/dev/null | sort -h | tail -20

Fix: Remove or compress what you don't need, rotate logs, and set limits so it can't happen again.

2. Out of inodes (df -h shows space, df -i shows 100%)

Check:

df -i

Fix: Find the directory with millions of small files (sessions, mail queue, cache) and clean it.

3. A deleted file still held open by a process (du and df disagree)

Check:

lsof +L1 2>/dev/null | head

Fix: Restart or signal the process that holds it (or truncate it through /proc/<pid>/fd/<n>).

The long version, step by step: No space left on device: find what is filling the disk on Linux

Fix it yourself

A live machine in your browser with this problem already on it. The grader checks the result.

Open the lab

No account needed for your first tries.

Related errors

  • Permission denied

    The user the process runs as lacks the read, write or execute right on the file or a directory on its path.

  • no space left on device (Docker)

    Old images, stopped containers, volumes, build cache or container logs filled /var/lib/docker.