{"action":"created","issue":{"url":"https://api.github.com/repos/moby/moby/issues/3182","repository_url":"https://api.github.com/repos/moby/moby","labels_url":"https://api.github.com/repos/moby/moby/issues/3182/labels{/name}","comments_url":"https://api.github.com/repos/moby/moby/issues/3182/comments","events_url":"https://api.github.com/repos/moby/moby/issues/3182/events","html_url":"https://github.com/moby/moby/issues/3182","id":24149472,"number":3182,"title":"Device-mapper does not release free space from removed images","user":{"login":"AaronFriel","id":788800,"avatar_url":"https://avatars0.githubusercontent.com/u/788800?v=4","gravatar_id":"","url":"https://api.github.com/users/AaronFriel","html_url":"https://github.com/AaronFriel","followers_url":"https://api.github.com/users/AaronFriel/followers","following_url":"https://api.github.com/users/AaronFriel/following{/other_user}","gists_url":"https://api.github.com/users/AaronFriel/gists{/gist_id}","starred_url":"https://api.github.com/users/AaronFriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AaronFriel/subscriptions","organizations_url":"https://api.github.com/users/AaronFriel/orgs","repos_url":"https://api.github.com/users/AaronFriel/repos","events_url":"https://api.github.com/users/AaronFriel/events{/privacy}","received_events_url":"https://api.github.com/users/AaronFriel/received_events","type":"User","site_admin":false},"labels":[{"id":77260064,"url":"https://api.github.com/repos/moby/moby/labels/area/storage/devicemapper","name":"area/storage/devicemapper","color":"FBCA04","default":false},{"id":179224743,"url":"https://api.github.com/repos/moby/moby/labels/exp/expert","name":"exp/expert","color":"3B8686","default":false},{"id":190258329,"url":"https://api.github.com/repos/moby/moby/labels/kind/bug","name":"kind/bug","color":"FF8C94","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":200,"created_at":"2013-12-12T00:29:04Z","updated_at":"2017-09-05T09:24:23Z","closed_at":"2015-06-16T19:04:09Z","author_association":"NONE","body":"Docker claims, via `docker info` to have freed space after an image is deleted, but the data file retains its former size and the sparse file allocated for the device-mapper storage backend file will continue to grow without bound as more extents are allocated.\n\nI am using lxc-docker on Ubuntu 13.10:\n\n```\nLinux ergodev-zed 3.11.0-14-generic #21-Ubuntu SMP Tue Nov 12 17:04:55 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux\n```\n\nThis sequence of commands reveals the problem:\n\nDoing a `docker pull stackbrew/ubuntu:13.10` increased space usage reported `docker info`, before:\n\n```\nContainers: 0\nImages: 0\nDriver: devicemapper\n Pool Name: docker-252:0-131308-pool\n Data file: /var/lib/docker/devicemapper/devicemapper/data\n Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata\n Data Space Used: 291.5 Mb\n Data Space Total: 102400.0 Mb\n Metadata Space Used: 0.7 Mb\n Metadata Space Total: 2048.0 Mb\nWARNING: No swap limit support\n```\n\nAnd after `docker pull stackbrew/ubuntu:13.10`:\n\n```\nContainers: 0\nImages: 3\nDriver: devicemapper\n Pool Name: docker-252:0-131308-pool\n Data file: /var/lib/docker/devicemapper/devicemapper/data\n Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata\n Data Space Used: 413.1 Mb\n Data Space Total: 102400.0 Mb\n Metadata Space Used: 0.8 Mb\n Metadata Space Total: 2048.0 Mb\nWARNING: No swap limit support\n```\n\nAnd after `docker rmi 8f71d74c8cfc`, it returns:\n\n```\nContainers: 0\nImages: 0\nDriver: devicemapper\n Pool Name: docker-252:0-131308-pool\n Data file: /var/lib/docker/devicemapper/devicemapper/data\n Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata\n Data Space Used: 291.5 Mb\n Data Space Total: 102400.0 Mb\n Metadata Space Used: 0.7 Mb\n Metadata Space Total: 2048.0 Mb\nWARNING: No swap limit support\n```\n\nOnly problem is, the data file has expanded to 414MiB (849016 512-byte sector blocks) per `stat`. Some of that space is properly reused after an image has been deleted, but the data file never shrinks. And under some mysterious condition (not yet able to reproduce) I have 291.5 MiB allocated that can't even be reused.\n\nMy `dmsetup ls` looks like this when there are 0 images installed:\n\n```\n# dmsetup ls\ndocker-252:0-131308-pool        (252:2)\nergodev--zed--vg-root   (252:0)\ncryptswap       (252:1)\n```\n\nAnd a `du` of the data file shows this:\n\n```\n# du /var/lib/docker/devicemapper/devicemapper/data -h\n656M    /var/lib/docker/devicemapper/devicemapper/data\n```\n\nHow can I have docker reclaim space, and why doesn't docker automatically do this when images are removed?\n"},"comment":{"url":"https://api.github.com/repos/moby/moby/issues/comments/327121499","html_url":"https://github.com/moby/moby/issues/3182#issuecomment-327121499","issue_url":"https://api.github.com/repos/moby/moby/issues/3182","id":327121499,"user":{"login":"hatreddrivenengine","id":31649755,"avatar_url":"https://avatars1.githubusercontent.com/u/31649755?v=4","gravatar_id":"","url":"https://api.github.com/users/hatreddrivenengine","html_url":"https://github.com/hatreddrivenengine","followers_url":"https://api.github.com/users/hatreddrivenengine/followers","following_url":"https://api.github.com/users/hatreddrivenengine/following{/other_user}","gists_url":"https://api.github.com/users/hatreddrivenengine/gists{/gist_id}","starred_url":"https://api.github.com/users/hatreddrivenengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hatreddrivenengine/subscriptions","organizations_url":"https://api.github.com/users/hatreddrivenengine/orgs","repos_url":"https://api.github.com/users/hatreddrivenengine/repos","events_url":"https://api.github.com/users/hatreddrivenengine/events{/privacy}","received_events_url":"https://api.github.com/users/hatreddrivenengine/received_events","type":"User","site_admin":false},"created_at":"2017-09-05T09:24:23Z","updated_at":"2017-09-05T09:24:23Z","author_association":"NONE","body":"Hi guys, i'm a newbie and i'm pretty sure that i'm missing something... worst part is i'm new to linux aswell)\r\n\r\nfor those who like \"TL;DR\": \r\nwhat could be the cause of \"removing\" and \"init-removing\" tags at diff files? \r\n```\r\nroot@docker:/var/lib/docker/aufs/diff# du -h -d 1\r\n163M    ./a4bd161a8c2f706c204cf9e488c5d9337dba577ccd6bbfabb4de1eeec0a01a00-removing\r\n12K     ./46ef3cca013b9b1fb87a4aee5a4a5d4014fd8b8fcbc5c6860a020f5343ca1b8e-removing\r\n24K     ./70ae79a1137a4cc440c27afc020d52bc59ff19216d2a8a0f09c9370bcf363d0a-removing\r\n1,2G    ./3cbb0a650ba9fcf85383047ee5a47c85de3dd235a3b16c4c91178919e3eb2a5b-removing\r\n4,0K    ./089ec2260a4047dabaaf357f5d3c83648214d716db599443700a3e03a29d5dee-removing\r\n20K     ./e64c2c4fcdfa944829257b39b86a5a880f0de919dbdc8adacad0dcb5feafccba-init-removing\r\n52K     ./1cb17f48516508489261e959446af16dc547676b8499752c529c338a6da5093e-removing\r\n20K     ./8c381e86d51bfc20ddfb3c3b6795457993289f92a111460480005a9eb57845be-removing\r\n4,0K    ./03c16ec732c272188c9b12ff7ec0ea0fb3fa8384c395f90f03125139c368b9d9-removing\r\n128M    ./0960774ebb42d31cc7c278f83fbf6d2df668e2179370963a278d012219624a65-removing\r\n1,2G    ./893580bc85a7e8e667617b14734d9872cec25614dca95d0dc124260ebd53f55c-removing\r\n2,1M    ./b6dd12021ff0cf168e328eeb5b26e15ba1ad0554f58830881d59db08d6410500-removing\r\n20K     ./46ef3cca013b9b1fb87a4aee5a4a5d4014fd8b8fcbc5c6860a020f5343ca1b8e-init-removing\r\n16K     ./82c65c268841e6f6112702556057af83a6e05ba565c2782efc9a777f5f706e30-removing\r\n84K     ./c7c2dfbd9a8760b4141c4586dfdda4384134626d3c4995939fce7ec900570f07-removing\r\n20K     ./3cbb0a650ba9fcf85383047ee5a47c85de3dd235a3b16c4c91178919e3eb2a5b-init-removing\r\n4,0K    ./ddeab9b48cc75a17cee194cc26f4db794ce8f21c2c48d6d435a56769f9bda6c0-removing\r\n20K     ./93831a8230af888df9ffb1b9522e419fa15499301e3cf80a949a9dbb7b1765ce-init-removing\r\n12K     ./93831a8230af888df9ffb1b9522e419fa15499301e3cf80a949a9dbb7b1765ce-removing\r\n16K     ./33e3425f23336d19fc067db68932983515ef02593f539a9a93ca6bf788b80ddb-removing\r\n12K     ./e64c2c4fcdfa944829257b39b86a5a880f0de919dbdc8adacad0dcb5feafccba-removing\r\n16K     ./7407c3b7636dd7c11e632146822628594f216373048e6a1d478c5f25a6bfb8c0-removing\r\n20K     ./70ae79a1137a4cc440c27afc020d52bc59ff19216d2a8a0f09c9370bcf363d0a-init-removing\r\n2,6G    .\r\n```\r\n\r\nso, i've encountered this problem while trying to undetstand how does docker works. The strangest thing by far is that this problem sometimes (sadly, don't know when, why or how) disappears when i'm using other VM with exact same settings. \r\n\r\nwhat i have:\r\nDocker ver. 17.06.1-ce\r\nUbuntu 16.04.3 LTS \r\nfilesystem ext4\r\nwhat do i do:\r\n```\r\nsudo docker build .\r\nsudo docker system prune -a\r\n```\r\nit doesn't matter if i use prune or docker rm commands (for images, containers, volumes), if i run this image or not, it simply does not free disc space. The \"/docker/aufs/diff\" foulder only grows. \r\n\r\nTY for your time and greetings from Russia."}}
{"actor":{"display_login":"hatreddrivenengine"}}