docker resource_error ai_generated partial

守护进程响应错误:mkdir /var/lib/docker/overlay2/...:设备上没有剩余空间

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

ID: docker/overlay2-quota-exceeded

其他格式: JSON · Markdown 中文 · English
78%修复率
85%置信度
1证据数
2023-03-15首次发现

版本兼容性

版本状态引入弃用备注
Docker 20.10.0 active
Docker 24.0.0 active
Docker 25.0.0 active
Docker CE 26.0.0 active

根因分析

overlay2 文件系统的 inode 或块配额已耗尽,通常是由于过多的容器层或悬空镜像占用了所有可用空间。

English

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

generic

官方文档

https://docs.docker.com/storage/storagedriver/overlayfs-driver/

解决方案

  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'.
  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.

无效尝试

常见但无效的做法:

  1. 40% 失败

    Running 'docker system prune -a' without checking for running containers can remove essential images and containers, causing data loss.

  2. 60% 失败

    Increasing overlay2 size via daemon.json 'storage-opts' often fails because the underlying filesystem (e.g., ext4) does not support per-directory quotas.

  3. 70% 失败

    Rebooting the host only temporarily frees space if the root cause (e.g., log rotation) is not addressed.