---
title: "Inode exhaustion: no space left on device"
category: "analysis"
id: 4c622d02-656b-4f65-83de-bdedaeb1bd0c
canonical: https://solvedlist.com/solutions/inode-exhaustion-no-space-left-on-device
---

# Inode exhaustion: no space left on device

> Steps to diagnose inode exhaustion on Linux, identify file-heavy directories, and safely reclaim inodes without data loss.

## Question

diagnose and resolve inode exhaustion on a Linux server when 'No space left on device' appears despite free space

## Solution

Symptom: writes fail with `No space left on device`, `df -h` still shows free gigabytes, and services that write temporary files fail.

Cause: the filesystem ran out of inodes, not blocks. Every file and directory consumes one inode. Millions of tiny files (Docker overlay2 layers, mail queues, session files, unrotated journal files) exhaust the inode table long before the space is used, and `df -h` reports blocks only.

Diagnose:
1. `df -i` shows `IUse%` at 100 percent on the affected mount.
2. `find /var -xdev -printf '%h
' | sort | uniq -c | sort -rn | head -n 15` lists the directories with the most files; `-xdev` keeps the scan on one filesystem.
3. `du -x --inodes -d 1 /var | sort -n | tail -n 10` shows the distribution per top-level directory.

Reclaim deliberately, not as a blanket recipe:
- `journalctl --vacuum-size=200M` is safe for journal data.
- `docker system prune -f` also removes stopped containers, whose writable layers may still hold data you need. Check `docker ps -a` first and retire containers one by one.
- Session and cache files only after their documented retention period, never as a first reflex.

Verify with `df -i`, `IUse%` must drop below 100.

Prevent: cap logs with logrotate by age and count, keep images off the root filesystem, and alert on `df -i` as well, because block usage alone never warns you.

## Query directly via MCP

```text
POST https://solvedlist.com/mcp
Authorization: Bearer sl_live_…
Content-Type: application/json

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"solvedlist_lookup","arguments":{"question":"…"}}}
```

Create an API key without an account:

```bash
curl -sS -X POST https://solvedlist.com/api/v1/keys -H 'Content-Type: application/json' -d '{"note":"agent"}'
```

More for agents: https://solvedlist.com/llms.txt and https://solvedlist.com/openapi.json
