2

I am trying to start any of my saved containers in docker but am unable to do it. I have started getting the Error response from daemon:

Error running DeviceCreate (createSnapDevice) dm_task_run failed

This started happening after committing a relatively big docker image and it seemed to have filled up all available docker data space, even though I had lots of space on the host machine. Now I am unable to free up the docker data space anymore, even after deleting the big image. Docker is unable to reclaim the space. I also tried the fix mentioned below so that I can start the docker container but was not successful. Is there anything I can do to fix existing Docker to run images again?

Related question: Can't run Docker container due device mapper error


Here is my host configuration. Data Space used and total has reached max and free is in 0.

# docker info
=========================================================
Containers: 49
Images: 23
Storage Driver: devicemapper
 Pool Name: docker-8:3-4998488-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 107.4 GB
 Data Space Total: 107.4 GB
 Data Space Available: 0 B
 Metadata Space Used: 60.36 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.087 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.93-RHEL7 (2015-01-28)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.10.0-229.el7.x86_64
Operating System: Red Hat Enterprise Linux
CPUs: 4
Total Memory: 7.64 GiB

docker version
=========================================================

Client:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Thu Sep 10 19:08:45 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Thu Sep 10 19:08:45 UTC 2015
 OS/Arch:      linux/amd64
kenorb
  • 155,785
  • 88
  • 678
  • 743
user46743
  • 89
  • 1
  • 10
  • my `docker info` does not look at all like yours, what is your `docker version`? mine `docker info | grep Version Server Version: 1.9.0-rc2` – user2915097 Oct 23 '15 at 07:48
  • anyway, try to remove some images (so you get some disk space), and see if you can then start some containers – user2915097 Oct 23 '15 at 07:49
  • Already removed the big images but the data space used appears to not shrink or change. Is the "max data space" a user configurable setting? I have a ton of space on the docker host. How can docker's "data space" leverage or be limited w.r.t the space available on the host? – user46743 Oct 23 '15 at 14:45
  • Possible duplicate of [Can't run Docker container due device mapper error](https://stackoverflow.com/questions/24709741/cant-run-docker-container-due-device-mapper-error) – kenorb Jul 14 '18 at 00:38

2 Answers2

1

running

docker system df

will tell you disk usage and reclaimable space.

To free up space and keep your images:

Remove Volumes:

docker volume rm $(docker volume ls --format {{.ID}})

Remove Stopped Containers:

docker rm $(docker ps -aq)

To Just clean everything optional: Deletes All images/containers/volumes/networks

docker system prune -af
D. Vinson
  • 1,090
  • 6
  • 8
0

On the RHEL docker host, The only way I could reclaim the space and start a docker image was to actually remove the devicemapper/data. No other docker command to remove containers/images/volumes seems to work. I backed up the image I wanted to a tar ball and did the removal to have it working again.

user46743
  • 89
  • 1
  • 10