0

Running an AWS ec2 with ECS AMI. I pulled an image from a private repository. The image got pulled and its size is 19.37GB. Storage driver is device mapper. Doing a docker system df -v shows:

docker system df -v
Images space usage:
REPOSITORY                TAG                 IMAGE ID            CREATED ago         SIZE                SHARED SIZE         UNIQUE SiZE         CONTAINERS
<none>                    <none>              3b0dc2504ca7        6 days ago ago      19.37GB             0B                  19.37GB             0
amazon/amazon-ecs-agent   latest              4f476fb2c2ad        2 weeks ago ago     30.01MB             0B                  30.01MB             0
amazon/amazon-ecs-pause   0.1.0               4ae0b20b511a        2 weeks ago ago     962.5kB             0B                  962.5kB             0


du -sh /var/lib/docker/*
20K     /var/lib/docker/builder
72K     /var/lib/docker/buildkit
132K    /var/lib/docker/containerd
4.0K    /var/lib/docker/containers
96K     /var/lib/docker/devicemapper
9.2M    /var/lib/docker/image
56K     /var/lib/docker/network
20K     /var/lib/docker/plugins
4.0K    /var/lib/docker/runtimes
4.0K    /var/lib/docker/swarm
4.0K    /var/lib/docker/tmp
4.0K    /var/lib/docker/trust
28K     /var/lib/docker/volumes

Where is the 19.37GB stored? Also, docker's documentation link says, layers are stored in /var/lib/docker/storage-driver/layers/, but I can't seem to find /var/lib/docker/devicemapper/layers. Also, here is the listing of devicemapper directory.

du -sh /var/lib/docker/devicemapper/*
88K     /var/lib/docker/devicemapper/metadata
29M     /var/lib/docker/devicemapper/mnt

docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 3
Server Version: 18.06.1-ce
Storage Driver: devicemapper
 Pool Name: docker-docker--pool
 Pool Blocksize: 524.3kB
 Base Device Size: 10.74GB
 Backing Filesystem: ext4
 Udev Sync Supported: true
 Data Space Used: 20.3GB
 Data Space Total: 318.3GB
 Data Space Available: 298GB
 Metadata Space Used: 1.815MB
 Metadata Space Total: 323MB
 Metadata Space Available: 321.1MB
 Thin Pool Minimum Free Space: 31.82GB
 Deferred Removal Enabled: true
 Deferred Deletion Enabled: true
 Deferred Deleted Device Count: 0
 Library Version: 1.02.135-RHEL7 (2016-11-16)
Vin Dat
  • 11
  • 3
  • 1
    Device mapper is block storage, the files from the layers aren't visible on the filesystem like overlay files are. – BMitch Oct 04 '18 at 16:41
  • and the docker info does not list Data file and Metadata file unlike [this](https://meta.discourse.org/t/why-is-docker-devicemapper-taking-so-much-hard-drive-space/34378). Why is that so? I have updated the question with docker info – Vin Dat Oct 04 '18 at 23:07
  • Loopback vs LVM: https://docs.docker.com/storage/storagedriver/device-mapper-driver/ – BMitch Oct 05 '18 at 01:10
  • thanks. so, i guess direct-lvm doesn't list Data file and Metadata file in docker info. If you look at docker info, the base device size is 10.74GB, whereas the image that I pulled is 19.37GB. So, I'm assuming I will have to increase the base device size to run a container using this image? – Vin Dat Oct 05 '18 at 13:01
  • I notice when I do lsblk or dmsetup ls --tree, thin volume name keeps changing. Why is that? Also, is it possible to see how much space/# of extents each thin volume is using? – Vin Dat Oct 07 '18 at 00:54

0 Answers0