在使用DOCKER_OPTIONS更改Docker的存储基目录后,“设备上没有剩余空间”

我通过更改/etc/default/docker DOCKER_OPTIONS中的DOCKER_OPTIONS将Docker的存储基目录从/var/lib/docker DOCKER_OPTIONS更改为/home/docker DOCKER_OPTIONS ,如其他问题所述 。 之后,我将旧的/var/lib/docker docker rsynce到新的地方。

这是我的Dockerconfiguration文件:

 # Docker Upstart and SysVinit configuration file # .... # Customize location of Docker binary (especially for development testing). #DOCKER="/usr/local/bin/docker" # Use DOCKER_OPTS to modify the daemon startup options. DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -g /home/docker" # If you need Docker to use an HTTP proxy, it can also be specified here. #export http_proxy="http://127.0.0.1:3128/" # This is also a handy place to tweak where Docker's temporary files go. #export TMPDIR="/mnt/bigdrive/docker-tmp" 

重新启动后,一切正常。 然而,我不时在容器中开始“在设备上留下空间”。 当这个错误发生时,如果我的容器已经启动了,我甚至不能做一个mkdir 。 如果容器closures,我尝试启动它,我得到以下内容:

来自守护进程的错误响应:rpc error:code = 2 desc =“oci运行时错误:无法与容器进程同步:无法创buildpivot_root目录,错误mkdir .pivot_root:设备上没有剩余空间”

不过,我有空间:

 Filesystem Size Used Avail Use% Mounted on udev 32G 4,0K 32G 1% /dev tmpfs 6,3G 1,6M 6,3G 1% /run /dev/sda1 92G 56G 32G 64% / none 4,0K 0 4,0K 0% /sys/fs/cgroup none 5,0M 0 5,0M 0% /run/lock none 32G 472K 32G 1% /run/shm none 100M 0 100M 0% /run/user /dev/sda5 1,6T 790G 762G 51% /home 

我怀疑,也许我没有正确地进行存储迁移。 有人知道可能会发生什么吗?

磁盘空间不足也可能包含inode限制。 你可以用df -i来检查。 Unix.SE上的这篇文章将引导您完成增加inode数量所需的步骤。 简而言之,您可以删除文件以释放inode。