![为什么docker(使用overlay2驱动存储)会改变挂载点的报告大小](https://linux22.com/image/721841/%E4%B8%BA%E4%BB%80%E4%B9%88docker%EF%BC%88%E4%BD%BF%E7%94%A8overlay2%E9%A9%B1%E5%8A%A8%E5%AD%98%E5%82%A8%EF%BC%89%E4%BC%9A%E6%94%B9%E5%8F%98%E6%8C%82%E8%BD%BD%E7%82%B9%E7%9A%84%E6%8A%A5%E5%91%8A%E5%A4%A7%E5%B0%8F.png)
我有这个/etc/sysconfig/docker-storage
DOCKER_STORAGE_OPTIONS="--storage-driver=overlay2"
然后我挂载/dev/xdvcz
到/var/lib/docker/overlay2
。然后我执行df -h
:
# df -h /dev/xvdcz
Filesystem Size Used Avail Use% Mounted on
/dev/nvme1n1 938G 72M 888G 1% /var/lib/docker/overlay2
没错,我有 1000G EBS 设备。现在我用 启动 docker service docker start
。
df -h
报告现在更改为:
# df -h /dev/xvdcz
Filesystem Size Used Avail Use% Mounted on
/dev/nvme1n1 7.8G 7.8G 0 100% /var/lib/docker/overlay2
好的,停止docker:service docker stop
df -h
报告现在改回:
# df -h /dev/xvdcz
Filesystem Size Used Avail Use% Mounted on
/dev/nvme1n1 938G 72M 888G 1% /var/lib/docker/overlay2
答案1
service docker start
正在再次安装/var/docker
,导致我最初放在那里的安装变得毫无用处。