In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
I inadvertently felt that there was not enough disk space, so I used the df-a command to check it. The result was surprising. It was all done by docker, which generated a pile of garbage in / var/lib/docker/aufs:
Davidhopper@davidhopper-ThinkPad-P50s:~$ df-a file system 1K-block used used% mount point sysfs 0 8112832-/ sysproc 0 0-/ procudev 0 0 8112832 / devdevpts 0 0-/ dev/ptstmpfs 1627828 9580 1618248 1% / run/dev/sda6 84293120 77948404 2039772 98% / securityfs 0 0 0-/ sys/kernel/securitytmpfs 8139124 18040 1% / dev/shmtmpfs 5120 4 5116 1% / run/locktmpfs 8139124 081391240% / sys/fs/cgroupcgroup 8121084-/ sys/fs/cgroup/systemdpstore 8121084-/ sys/fs/pstoreefivarfs 2000-/ sys/firmware/efi/efivarscgroup 5116-/ sys/fs/cgroup/net_cls Net_priocgroup 0 0-/ sys/fs/cgroup/perf_eventcgroup 0 0-/ sys/fs/cgroup/cpu Cpuacctcgroup 000-/ sys/fs/cgroup/pidscgroup 000-/ sys/fs/cgroup/devicescgroup 000-/ sys/fs/cgroup/cpusetcgroup 000-/ sys/fs/cgroup/rdmacgroup 000-/ sys/fs/cgroup/blkiocgroup 000-/ sys/fs/cgroup/hugetlbcgroup 0 0-/ sys/fs/cgroup/freezercgroup 000-/ sys/fs/cgroup/memorysystemd-1-- / proc/sys/fs/binfmt_miscdebugfs 000-/ sys/kernel/debugmqueue 000-/ dev/mqueuehugetlbfs 000-/ dev/hugepagesfusectl 000-/ sys/ Fs/fuse/connectionsconfigfs 262144-/ sys/kernel/config/dev/sda1 262144 33084 229060 13% / boot/efibinfmt_misc 1627828 56 1627772 1% / run/user/1000gvfsd-fuse 1627772-/ run/user/1000/gvfs/dev/sda6 84293120 77948404 2039772 98% / var/lib/docker/aufs
First, clean up all Docker containers that are not currently running using the easiest method:
Docker system prune
The running results are as follows:
Davidhopper@davidhopper-ThinkPad-P50s:~/code/apollo$ docker system pruneWARNING! This will remove:-all stopped containers-all volumes not used by at least one container-all networks not used by at least one container-all dangling imagesAre you sure you want to continue [y/N] yDeleted Volumes:333739e346364a7d515cdfc585f5231dd7f74a9e71431d152f6efc4da3bcb303419184335b3c6130cb47b98c672e9666479ef0ff27cd2d20e173b5580050705294165565a1f9d0553d18de62f86264596747f1b38c651b5e4f68391607e8453d08d67461fa141609d0905f1209526131ce60864d1bf27650511a6bcc881971073aeb8f32513a1813f6b50726a233f16b20bb896b5cf3e51197c86e2cc10be3743af830103bdedc7f035be9d2bdbd1104733c274f3ce629784cdf9daee8ac070e78e7ab8000386d61050034a64eee041a2743b60c466598286f276534529db551155c34c18faf8d234412a999b28d1d6de8517b68eac5dc47e58964a0efb24a06200d23a03f40cb1b8af8e5368805370d45195448fbad0944bcb9730f2140d46251b2e0825e25de4c42475245a83b2119ce45e75da811ad6df1525f7ff2888a36559532c3877cf5641e21c15fca6d923266b6548a4aef834667b0c66ca78cde38a05cf184006b1301eb91e2ebcb9cca6d5868265f56bdac0aefd5228979fd8c74c21d336b8205ea12e27414c3a00eef6a329222ea7552b825d3889ef0427838203e573f8d84fd7923415b46a90017ff5cfeb2bd2931e4ec54c45c4bd62664042d3ee39b3a5e49b605d4069e99c4c1d01db6a210d28cbdc350672b33accd2b0f3ba0fe3e6d80b6fb4dc6ca2159789e512912fb4ffccd0df1183bafc55c4e8045633e062023110a4c13e7915da03ffaad3dbaa558c590a6b2274c2fb09ad54abd6c69276b6274956a28abfe50fdf459a0042ecba6978e379e035399c9272c930b57de1a0669765d765699b47999c59ed74f93fc0545fe8d280cefdd2cf9e2b3137933766d8c693b826d9da48d419c15b90fcfbac26eb9939749aef94218a31a767b45a2047d0581ad07ebd0164e69897f5ae99144a4f0422b72f184281ae47e0b4d7191a9c6cea03c4aa1aac1c742228c46e3d7e2577645a037d62600be7249a6497b45e555bca1d941af284743396753199f7bea33e7bf3f3362f385ec074b445008cb6f6b2c1d83796e9bcdd6eb6d2930ba80f98721ed1215d9bd6c75148a26080a786b212dc4e76225ae3e90dfd92c6eba5a4f60f465d86e62990fe22311ba1c2a50f3203d93d60e115ec3b3ba643b3213f98d3c793730332de0178a9f7b5c453b50fae52487f178325d0347f75eb2502195daf5e39ba156a37752d3d62cd9159067fa92cee1da6d1044ce51d616dc0cad67ac31e16f4f208ba840599dcb0b21cb07e29eabcbb62bbcbe13443267a96599747ca52b685a71b7233cf94d876d3867c55c6079ff257be64a59ee83d08c463591aebd5496dd1f134c33205d9f5c120a994bec4d112f6b012b7be4f5b7ad25c557c01f4392cf02546eceb69791324090d85444a338c247414adc209e42a46c89d30cc9c1c52d29c0d63a5e35b5d70cec2bb3abb42e7450005e9c9b30305a5763e44dc03a70f313062d57ef8062b10a09d99b0fd826d7463c1816228953c0492107916283de2b1ccb7fa8e22c2de3241ad2def94eaa92707b9cf3b7ef288b57c64cff0094103f776657aaeacae8c93992f633c27c6796091311e83617d4fb3b1526689b5b6ada33f58214ffa80c1f5e053bacc4b3bf55149f918368238ffe50c1ed777558092b7b883b2cda2b7a031315118045d54acb0e63c0ebd4460a1a1666b3c930b95d351a1b831419eb3f22262852c53d5b177522c67ffd9d916d66328ede26275c27a80745812b1c28b8d47fabe49f612dc9e8250f464772c726850415a051562ffcd922dc796a71bb94d0616927af521e03ec75a09dbfe0a86bbf69928773841c538a2fc094bc4368bd31386d97a92956067706ba5d8ac9d01e99294d8ca28e4182a81c0662f77faf8e372b8496afb1946e3f5863a23c8394f4065293e26dbc2555bf474d0328f56a613331829e41a7d593b75633868c72bb81123d32f2a14b656f1409c57da6bc984fa2339205da799d47bc613bf7b1955ea78712f16b4edf2a79b450f55ffb6111dee609923a72e6bde7fb13fae29995611f9d28b0bdd4cf6a53250c45006edbe795d120e31e6d693398b033843b0ad9cfceec09b9e1b47f7a9f4b2bec275e5e6a23fa3b0163e1b3e1d90e20410e33b5d95eec75b55819c1117fdd57c655c31ed589f524479c0acef02c7b1ddcb5863198868f71b6b2f3275146de73f9c884a9f50dd32e7a231567bbc73d11621d34cdacc45061cfe060e78210782e18fec100578fe56aTotal reclaimed space: 26.96GB
If there is enough free space, find a way to delete the / var/lib/docker/aufs folder. The simplest idea is to delete it directly:
Sudo rm-rf / var/lib/docker/aufs
The results are disappointing and the message is as follows:
Davidhopper@davidhopper-ThinkPad-P50s:~$ sudo rm-rf / var/lib/docker/aufs [sudo] davidhopper password: rm: unable to delete'/ var/lib/docker/aufs': device or resource busy
Use the command cat / proc/mounts | grep "docker" to find the device load, and sure enough, there is aufs:
Davidhopper@davidhopper-ThinkPad-P50s:~$ cat / proc/mounts | grep "docker" / dev/sda6 / var/lib/docker/aufs ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
No way, force me to use a trick, first unload the equipment, and then delete it:
Sudo umount / var/lib/docker/aufssudo rm-rf / var/lib/docker/aufs
Using the df-a command again, the results are refreshing:
Davidhopper@davidhopper-ThinkPad-P50s:~$ df-a file system 1K-block used used% mount point sysfs 0 8112832-/ sysproc 0 0-/ procudev 0 0 8112832 / devdevpts 0 0-/ dev/ptstmpfs 1627828 9584 1618244 1% / run/dev/sda6 84293120 65296764 1469141282% / securityfs 0 0-/ sys/kernel/securitytmpfs 8139124 18256 1% / dev/shmtmpfs 5120 4 5116 1% / run/locktmpfs 8139124 081391240% / sys/fs/cgroupcgroup 8120868-/ sys/fs/cgroup/systemdpstore 8120868-/ sys/fs/pstoreefivarfs 2000-/ sys/firmware/efi/efivarscgroup 5116-/ sys/fs/cgroup/net_cls Net_priocgroup 0 0-/ sys/fs/cgroup/perf_eventcgroup 0 0-/ sys/fs/cgroup/cpu Cpuacctcgroup 000-/ sys/fs/cgroup/pidscgroup 000-/ sys/fs/cgroup/devicescgroup 000-/ sys/fs/cgroup/cpusetcgroup 000-/ sys/fs/cgroup/rdmacgroup 000-/ sys/fs/cgroup/blkiocgroup 000-/ sys/fs/cgroup/hugetlbcgroup 0 0-/ sys/fs/cgroup/freezercgroup 000-/ sys/fs/cgroup/memorysystemd-1-- / proc/sys/fs/binfmt_miscdebugfs 000-/ sys/kernel/debugmqueue 000-/ dev/mqueuehugetlbfs 000-/ dev/hugepagesfusectl 000-/ sys/ Fs/fuse/connectionsconfigfs 262144-/ sys/kernel/config/dev/sda1 262144 33084 229060 13% / boot/efibinfmt_misc 1627828 52 1627776 1% / run/user/1000gvfsd-fuse 1627776-/ run/user/1000/gvfs
To make sure that docker does not take up any more space in the future, we specify the maximum space of the docker directory as follows:
Mkdir-p / var/lib/docker/devicemapper/devicemapper dd if=/dev/zero of=/var/lib/docker/devicemapper/devicemapper/data bs=1M count=0 seek=1024
The maximum size of the established file is 1MB * 1024 = 10 GB
Note:
If you delete junk files so that Docker cannot be used, you can delete all related files using the following method, and then reinstall Docker. The methods to delete related files are as follows:
1. Find the Docker cache file location
Sudo find /-name "docker"
On my machine, the results are as follows:
/ sys/fs/cgroup/memory/docker/sys/fs/cgroup/blkio/docker/sys/fs/cgroup/hugetlb/docker/sys/fs/cgroup/pids/docker/sys/fs/cgroup/cpuset/docker/sys/fs/cgroup/perf_event/docker/sys/fs/cgroup/devices/docker/sys/fs/cgroup/net_cls,net_prio/docker/sys/fs/cgroup/freezer/docker/sys/fs/cgroup/cpu Cpuacct/docker/sys/fs/cgroup/systemd/docker/etc/default/docker/etc/docker/etc/init.d/docker/var/lib/docker/run/dockerfind: `/ run/user/1000/gvfs': permissions are not enough / usr/lib/docker/usr/share/code/resources/app/extensions/docker/usr/share/bash-completion/completions/docker/usr/bin/docker/home/davidhopper/Qt5.10.0/5.10.0/Src/qtwebengine/src/3rdparty / chromium/third_party/protobuf/jenkins/docker/home/davidhopper/.cache/bazel/_bazel_davidhopper/install/5b1e8be5d1d6766f635a7db5967707e9/_embedded_binaries/embedded_tools/tools/build_defs/docker/home/davidhopper/.vscode/extensions/njpwerner.autodocstring-0.2.0/.vscode-test/Visual Studio Code.app/Contents/Resources/app/extensions/docker/home/davidhopper/code/apollo/docker/home/davidhopper/code/protobuf-master/jenkins/docker/home/davidhopper/code/apollo1215/apollo/docker
two。 Delete Docker cach
The copy code is as follows: sudo rm-rf / home/davidhopper/.cache/bazel/_bazel_davidhopper/install/5b1e8be5d1d6766f635a7db5967707e9/_embedded_binaries/embedded_tools/tools/build_defs/docker
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.