[英]Docker Error creating metadata file: no space left on device
I have the following disk space utilization:我有以下磁盘空间利用率:
Filesystem Size Used Avail Use% Mounted on
tmpfs 32G 2.7M 32G 1% /run
tmpfs 1.0M 0 1.0M 0% /union
tmpfs 1.0G 5.7M 1019M 1% /union/rw
/dev/ram0 227M 227M 0 100% /union/image
unionfs 1.0G 5.7M 1019M 1% /
devtmpfs 32G 0 32G 0% /dev
/dev/mapper/vgroot-var 12G 11G 1.4G 89% /union/var
/dev/mapper/vgroot-local 708G 457G 252G 65% /SYS/localstorage
/dev/mapper/vgroot-scratch 165G 1.3G 164G 1% /tmp
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 32G 0 32G 0% /sys/fs/cgroup
192.168.52.254:/srv/ql-common 14G 4.9G 8.2G 38% /etc/qlustar/common
192.168.52.254:/srv/apps/chroots/focal-base-gpu-gsc3 79G 47G 29G 63% /union/nfs
tmpfs 6.3G 0 6.3G 0% /run/user/0
My problem is: sometimes, when I want to run a new docker image, I receive the following error:我的问题是:有时,当我想运行一个新的 docker 映像时,我收到以下错误:
Docker Error creating metadata file: no space left on device
The only way that I could solve the error is by doing the following procedure:我可以解决错误的唯一方法是执行以下过程:
1- Stop docker service
2- empty /var/lib/docker directory
3- reboot machine
However, the same error would come back later.但是,同样的错误稍后会再次出现。 I tried all the other solutions such as docker prune, docker rm, docker stop, docker rmi that are discussed here and here but the abovementioned error keeps showing.
I tried all the other solutions such as docker prune, docker rm, docker stop, docker rmi that are discussed here and here but the abovementioned error keeps showing.
Is there any way to redirect /var/lib/docker to use another directory with more free space?有没有办法重定向 /var/lib/docker 以使用另一个具有更多可用空间的目录? or is there any other workaround to this problem?
或者这个问题还有其他解决方法吗?
One work around can be check disk utilisation by docker images by running docker images
.一种解决方法是通过运行
docker images
来检查 docker 图像的磁盘利用率。
Identify unwanted images and perform cleanup - this way you can reclaim certain disk space.识别不需要的图像并执行清理 - 这样您可以回收某些磁盘空间。
If you need more space then you can add separate disk or partition existing disk and then mount it to /var/lib/docker
如果您需要更多空间,则可以添加单独的磁盘或对现有磁盘进行分区,然后将其挂载到
/var/lib/docker
Note: What ever changes that are being suggested for extending disk partition for /var/lib/docker
are purely experimental, make sure that you are not performing these steps directly on production environment - You can take this to production only when you had done all necessary testing and confident enough to go ahead with production environment.注意:为
/var/lib/docker
扩展磁盘分区所建议的任何更改纯粹是实验性的,请确保您没有直接在生产环境中执行这些步骤 - 只有在完成所有操作后才能将其用于生产go 进行必要的测试并有足够的信心在生产环境中领先。
If you are planning to mount /var/lib/docker
on separate disk or partition then you need to perform below steps:如果您打算将
/var/lib/docker
挂载到单独的磁盘或分区上,则需要执行以下步骤:
/var/lib/docker
along with file permission preserved and store it in different location wherever you have enough space (for example /opt/)/var/lib/docker
以及保留的文件权限,并将其存储在任何有足够空间的不同位置(例如 /opt/)/var/lib/docker
/var/lib/docker
Now, /var/lib/docker
is mounted on separate disk现在,
/var/lib/docker
安装在单独的磁盘上
sudo systemctl stop docker
sudo mv /var/lib/docker/ /SYS/localstorage/docker/
sudo ln -s /SYS/localstorage/docker/ /var/lib/docker
sudo systemctl start docker
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.