gpt4 book ai didi

linux - Docker devicemapper存储空间

转载 作者:太空宇宙 更新时间:2023-11-04 09:18:22 25 4
gpt4 key购买 nike

删除容器时出现“设备上没有剩余空间”错误。

# docker rm orientdb1
Error response from daemon: Driver devicemapper failed to remove root filesystem ba18ea8014b6024eb738502612130244ff363b433f146102c64eb2eb0f3a321c: devmapper: Error saving transaction metadata: devmapper: Error creating metadata file: open /var/lib/docker/devicemapper/metadata/.tmp636968871: no space left on device

这是“df -kh”输出的一个片段。

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root 3.8T 3.8T 20K 100% /

这是“du -ksh”输出的一个片段。这表明使用了 3.8TB。

3.8T    /var/lib/docker

这是“docker info”输出。

# docker info
Containers: 56
Running: 8
Paused: 0
Stopped: 48
Images: 18
Server Version: 1.12.0
Storage Driver: devicemapper
Pool Name: docker-253:0-1196768-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 24.51 GB
Data Space Total: 107.4 GB
Data Space Available: 20.48 kB
Metadata Space Used: 29.18 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 20.48 kB
Thin Pool Minimum Free Space: 10.74 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for
production use. Use `--storage-opt dm.thinpooldev` to specify a custom
block storage device.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.107-RHEL7 (2016-06-09)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host overlay null
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 3.10.0-327.22.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 251.7 GiB
Name: my-host1
ID: KTTY:PSTQ:YQSP:9KZJ:VSVU:DFUZ:CEMF:DYWQ:CA3I:6KUB:6J2J:D4NG
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:
127.0.0.0/8

想从以下内容中了解 3.8 TB 是如何计算的(来自“docker info”的片段)

 Data Space Used: 24.51 GB
Data Space Total: 107.4 GB
Data Space Available: 20.48 kB
Metadata Space Used: 29.18 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 20.48 kB
Thin Pool Minimum Free Space: 10.74 GB

另外,我怎样才能清理/var/lib/docker 以获得一些可用空间。

最佳答案

我相信磁盘空间数字是针对环回驱动程序和文件/var/lib/docker/devicemapper/devicemapper/data 的,该文件由 devicemapper 在环回模式下使用。

要清理 docker,您可以在较新版本上运行 docker system prune。旧版本可以使用如下命令:

docker ps -aqf status=exited | xargs docker rm
docker images -qf dangling=true | xargs docker rmi

除此之外,您还需要通过容器和镜像到 docker stop,容器上的 docker rm 和容器上的 docker rmi图片。

关于linux - Docker devicemapper存储空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44593646/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com