刚刚给openwrt扩容了overlay空间,装了几个docker应用,然后df -h
的时候,就发现刚刚才分配的5G空间,只剩下500M了,WTF?
于是又折腾了一下,权当学习Linux命令了
root@BleachWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 329.0M 329.0M 0 100% /rom
tmpfs 1.8G 25.1M 1.8G 1% /tmp
/dev/sda3 4.8G 3.7G 847.6M 82% /overlay
overlayfs:/overlay 4.8G 3.7G 847.6M 82% /
/dev/sda1 16.0M 5.8M 10.2M 36% /boot
/dev/sda1 16.0M 5.8M 10.2M 36% /boot
tmpfs 512.0K 0 512.0K 0% /dev
cgroup 1.8G 0 1.8G 0% /sys/fs/cgroup
overlayfs:/overlay 4.8G 3.7G 847.6M 82% /opt/docker
/dev/sda1 16.0M 5.8M 10.2M 36% /mnt/sda1
以上显示还剩余847.6M是因为卸载了一个应用,返还了一点点
先用docker system prune
命令,测试对于我这个问题无用,这个命令的作用是<code class="prettyprint" >清理磁盘,删除关闭的容器、无用的数据卷和网络,以及dangling镜像
通过du -sh /*
先看看根目录下哪个文件夹占用最多
root@BleachWrt:~# du -sh /*
1.8M /bin
5.2M /boot
0 /dev
46.5M /etc
8.0K /home
0 /htdocs
128.5M /lib
0 /lib64
640.0K /mnt
3.7G /opt #就是他了!
3.7G /overlay
0 /proc
1.1G /rom
332.0K /root
36.0K /run
1.5M /sbin
0 /srv
0 /sys
13.7M /tmp
945.2M /usr
0 /var
47.6M /www
一路追查。。。
然后du -sh /overlay/upper/opt/docker/vfs/*
到这里,基本就破案了
root@BleachWrt:/overlay/upper/opt/docker/vfs# du -sh /overlay/upper/opt/docker/vfs/*
0 /overlay/upper/opt/docker/vfs/backingFsBlockDev
3.7G /overlay/upper/opt/docker/vfs/dir
继续看看du -sh /overlay/upper/opt/docker/vfs/dir/*
root@BleachWrt:/overlay/upper/opt/docker/vfs# du -sh /overlay/upper/opt/docker/vfs/dir/*
19.4M /overlay/upper/opt/docker/vfs/dir/0a84c0875e30c410816178bd5dd77cef4a0ef2014e5d7b17891bb3db0e4ca3b9
89.1M /overlay/upper/opt/docker/vfs/dir/1eb55d6beeebb40d6f35578c48ff35a2610d3c28bafaf5906dcb3fbe1027056d
69.1M /overlay/upper/opt/docker/vfs/dir/1fb03ddf9eda6e632b6edf95b7b0e282c1a28663c8b23f83a8dfd82aa4ec6fc1
70.7M /overlay/upper/opt/docker/vfs/dir/2474f0572c14082fbc3226413fef1867a41aacf3f0fbde4ac05f217eb8ee752c
89.1M /overlay/upper/opt/docker/vfs/dir/26907ce345fb452dd920d0eb655b76fbb8da9bcfe2f9400ddf7484a7ec836b40
13.7M /overlay/upper/opt/docker/vfs/dir/30c488bad1ad220784429d599b46e551d4e7aa2dea19b18861fda6e506ae20e2
89.1M /overlay/upper/opt/docker/vfs/dir/32209e49c2565b26ed258be0f32536fb37014583b2bd6bea58824a862505b5fb
1.6M /overlay/upper/opt/docker/vfs/dir/41377346103c502b496d72302b811612ba4088d7b4775303bd09e51ab285d9e8
132.1M /overlay/upper/opt/docker/vfs/dir/41b76fc24686f0eac20c83daa3ddc256ffe8e11c695fb632bd5fd557778c16b5
594.4M /overlay/upper/opt/docker/vfs/dir/4538f1aabe7b8dcb7a8d05c4bddb69e7b8f7470e01cfddb36b294a7746d6432a
13.7M /overlay/upper/opt/docker/vfs/dir/4bfe7c56e029d9ef6095dd6ed1696745219feb6c4993da348d8c26bbf660216d
595.0M /overlay/upper/opt/docker/vfs/dir/62b3b917d961acfd9874558415f7a1ac61599068da77d3743f9f96efcd69715d
594.4M /overlay/upper/opt/docker/vfs/dir/62b3b917d961acfd9874558415f7a1ac61599068da77d3743f9f96efcd69715d-init
28.9M /overlay/upper/opt/docker/vfs/dir/8b2c532faa32d40878f84a4271e4d460b34854a001ac60a29ee3fadd165c12e4
131.9M /overlay/upper/opt/docker/vfs/dir/8b76db561b026d770907de9a7ac7731c641125bf164be82307a4a2b5857d9f91
80.8M /overlay/upper/opt/docker/vfs/dir/97291f57b2df86b6a9b55d0b6238fd8d677689d730592c33685064a671f3bc6d
594.4M /overlay/upper/opt/docker/vfs/dir/9a83bbbf157087ce012b9c9fd0b7c8a9e83444bb1bf80a25ab9eb6d2cda25272
26.5M /overlay/upper/opt/docker/vfs/dir/b9c585bbecacac603d41e733e9a4ea80b9ab8f0d06a9db416e67c0d794b57e04
162.2M /overlay/upper/opt/docker/vfs/dir/bff7e2d1b331b2c35f5bdb3ebe06eb912ed51bb512fb1f9fe3257328ef4ba521
1.7M /overlay/upper/opt/docker/vfs/dir/c93ddeaa16ee1e1a78eb8d4ad56e604d71e7fa5564f53305df604efcdd0d493c
3.3M /overlay/upper/opt/docker/vfs/dir/cd42daa993de00a4142679b566b833d01caf9ef889601ff7bace1c3228a8c4d3
13.7M /overlay/upper/opt/docker/vfs/dir/de33015df28b182908c68b2a7af4c0d0fa73a60beda822b4540f0508dcb88e3f
29.1M /overlay/upper/opt/docker/vfs/dir/e24b5c50e0fba095b6272f28ea6717a431fcda6a0db26c8af705be801f5766bb
89.1M /overlay/upper/opt/docker/vfs/dir/e5de8a3546795b3dc308d4e52e1a740ae2cc26184d5e691f2a4d32a54d492713
69.3M /overlay/upper/opt/docker/vfs/dir/eb2aa69d0a955987cf63f27da15bb855fdcfd12a6b372515ec45378ea4e69a92
162.1M /overlay/upper/opt/docker/vfs/dir/f124aae2b37082d1217b713152d9ddaec664716d45ae9480e0c08b61d213bee5
简单查了一下 如何清理/var/lib/docker/vfs目录 | docker,不知道是干什么的,反正大不了重新刷OP,果断RM
执行rm -r /overlay/upper/opt/docker/vfs/dir
然后df -h
验证一下
root@BleachWrt:/overlay/upper/opt/docker/vfs# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 329.0M 329.0M 0 100% /rom
tmpfs 1.8G 13.7M 1.8G 1% /tmp
/dev/sda3 4.8G 157.2M 4.4G 3% /overlay
overlayfs:/overlay 4.8G 157.2M 4.4G 3% /
/dev/sda1 16.0M 5.8M 10.2M 36% /boot
/dev/sda1 16.0M 5.8M 10.2M 36% /boot
tmpfs 512.0K 0 512.0K 0% /dev
cgroup 1.8G 0 1.8G 0% /sys/fs/cgroup
overlayfs:/overlay 4.8G 157.2M 4.4G 3% /opt/docker
/dev/sda1 16.0M 5.8M 10.2M 36% /mnt/sda1
哈哈,又舒服了!