# No space left on device, but df shows free space (inodes exhausted)

**Code:** `No space left on device (inodes)` · **Category:** Linux · **Seen on:** Linux

The filesystem has run out of inodes — the slots for files — even though there are gigabytes free, usually because of millions of tiny files.

## Meaning

Every file uses an inode; ext4 fixes the inode count at format time. Session files, mail queues, cache directories, node_modules trees or Docker overlay layers can exhaust them. df -h looks fine, df -i shows 100%.

## Common causes

- Millions of small files (PHP sessions, cache, mail queue)
- Runaway log/temp file creation
- Docker overlay/image layers
- Small partition formatted with few inodes

## Quick fix

1. Check inodes: df -i
2. Find directories with the most files and clean them
3. Fix the job creating them (session GC, cache cleanup)

## Detailed fix by platform

### Linux

1. 

```bash
df -i
sudo find / -xdev -type d -size +1M 2>/dev/null | head   # huge directories
for d in /var/* /tmp; do echo "$(sudo find "$d" -xdev | wc -l) $d"; done | sort -n | tail
```


## How to diagnose

1. **Inodes** — df -i usage per mount
2. **Where** — Directory with most files
3. **Source** — Which process writes them?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/linux/no-space-left-inodes)
