{"action":"created","issue":{"url":"https://api.github.com/repos/google/cadvisor/issues/959","repository_url":"https://api.github.com/repos/google/cadvisor","labels_url":"https://api.github.com/repos/google/cadvisor/issues/959/labels{/name}","comments_url":"https://api.github.com/repos/google/cadvisor/issues/959/comments","events_url":"https://api.github.com/repos/google/cadvisor/issues/959/events","html_url":"https://github.com/google/cadvisor/issues/959","id":116404911,"number":959,"title":"Add devicemapper container fs usage","user":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jimmidyson","id":464659,"avatar_url":"https://avatars.githubusercontent.com/u/464659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmidyson","html_url":"https://github.com/jimmidyson","followers_url":"https://api.github.com/users/jimmidyson/followers","following_url":"https://api.github.com/users/jimmidyson/following{/other_user}","gists_url":"https://api.github.com/users/jimmidyson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmidyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmidyson/subscriptions","organizations_url":"https://api.github.com/users/jimmidyson/orgs","repos_url":"https://api.github.com/users/jimmidyson/repos","events_url":"https://api.github.com/users/jimmidyson/events{/privacy}","received_events_url":"https://api.github.com/users/jimmidyson/received_events","type":"User","site_admin":false},"milestone":null,"comments":38,"created_at":"2015-11-11T19:30:15Z","updated_at":"2016-03-02T17:02:27Z","closed_at":null,"body":"We need to add support for calculating the container's root filesystem usage, with devicemapper docker storage driver.\r\n\r\nOne way to achieve this will be to enter docker daemon's mount namespace and then run a `stat -f` on container's rootfs mount. \r\nFor example,\r\n\r\n```sh\r\nnsenter -m -t `pidof docker` stat -f /var/lib/docker/devicemapper/mnt/<containerID>/rootfs/\r\n```\r\n\r\nnsenter requires a fork+exec, which is a mild annoyance. We can either run the above mentioned command periodically for every container and parse the output, or busybox cadvisor to fork+exec itself to enter docker's mount ns and output the usage of all running container's via a pipe. \r\n\r\n@rhvgoyal @mrunalp: Are there any other options?\r\n"},"comment":{"url":"https://api.github.com/repos/google/cadvisor/issues/comments/191326562","html_url":"https://github.com/google/cadvisor/issues/959#issuecomment-191326562","issue_url":"https://api.github.com/repos/google/cadvisor/issues/959","id":191326562,"user":{"login":"sjenning","id":493891,"avatar_url":"https://avatars.githubusercontent.com/u/493891?v=3","gravatar_id":"","url":"https://api.github.com/users/sjenning","html_url":"https://github.com/sjenning","followers_url":"https://api.github.com/users/sjenning/followers","following_url":"https://api.github.com/users/sjenning/following{/other_user}","gists_url":"https://api.github.com/users/sjenning/gists{/gist_id}","starred_url":"https://api.github.com/users/sjenning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjenning/subscriptions","organizations_url":"https://api.github.com/users/sjenning/orgs","repos_url":"https://api.github.com/users/sjenning/repos","events_url":"https://api.github.com/users/sjenning/events{/privacy}","received_events_url":"https://api.github.com/users/sjenning/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T17:02:27Z","updated_at":"2016-03-02T17:02:27Z","body":"I can verify that thin_ls is a viable way to do this:\r\n\r\n```\r\n[root@cadvisor devicemapper]# docker run -d busybox sleep 1000\r\nfdd91d353daf764c9a9868faeca21a3d5baa12b928e5d16c9cda939d18d72ea5\r\n[root@cadvisor devicemapper]# docker exec -ti fdd91d353daf764c9a9868faeca21a3d5baa12b928e5d16c9cda939d18d72ea5 /bin/sh\r\n/ # dd if=/dev/zero of=/zeroes bs=1M count=10\r\n10+0 records in\r\n10+0 records out\r\n10485760 bytes (10.0MB) copied, 0.016788 seconds, 595.7MB/s\r\n/ # exit\r\n[root@cadvisor devicemapper]# docker inspect fdd91d353daf764c9a9868faeca21a3d5baa12b928e5d16c9cda939d18d72ea5\r\n...\r\n\"GraphDriver\": {\r\n        \"Name\": \"devicemapper\",\r\n        \"Data\": {\r\n            \"DeviceId\": \"768\",\r\n...\r\n[root@cadvisor devicemapper]# thin_ls -o DEV,EXCLUSIVE metadata | grep 768\r\n768     11MiB <-- this is the stat we are looking for\r\n```\r\n\r\nRHEL is at v0.5.5 for device-mapper-persistent-data so it needs an update to at least v0.6.0.\r\n\r\nNot sure about Alpine."}}