# Error response from daemon: mkdir /var/lib/docker/overlay2/...: no space left on device

- **ID:** `docker/overlay2-quota-exceeded`
- **Domain:** docker
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

The overlay2 filesystem has exhausted its inode or block quota, typically due to excessive container layers or dangling images consuming all available space.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Docker 20.10.0 | active | — | — |
| Docker 24.0.0 | active | — | — |
| Docker 25.0.0 | active | — | — |
| Docker CE 26.0.0 | active | — | — |

## Workarounds

1. **Run 'docker system prune --all --volumes' to remove unused containers, networks, images, and volumes. Then verify with 'df -h /var/lib/docker' and 'df -i /var/lib/docker'.** (75% success)
   ```
   Run 'docker system prune --all --volumes' to remove unused containers, networks, images, and volumes. Then verify with 'df -h /var/lib/docker' and 'df -i /var/lib/docker'.
   ```
2. **Increase the overlay2 storage quota by editing /etc/docker/daemon.json: add '{"storage-opts": ["overlay2.size=100G"]}' and restart Docker. Note: this works only with xfs filesystem and project quotas enabled.** (60% success)
   ```
   Increase the overlay2 storage quota by editing /etc/docker/daemon.json: add '{"storage-opts": ["overlay2.size=100G"]}' and restart Docker. Note: this works only with xfs filesystem and project quotas enabled.
   ```

## Dead Ends

- **** — Running 'docker system prune -a' without checking for running containers can remove essential images and containers, causing data loss. (40% fail)
- **** — Increasing overlay2 size via daemon.json 'storage-opts' often fails because the underlying filesystem (e.g., ext4) does not support per-directory quotas. (60% fail)
- **** — Rebooting the host only temporarily frees space if the root cause (e.g., log rotation) is not addressed. (70% fail)
