moby: Docker Install: Error running DeviceCreate (createPool) dm_task_run failed
I followed all steps given in the installation guide for 12.04
But, it fails when starting the docker daemon:
~ sudo docker -d
[sudo] password for prat0318:
2014/06/10 02:26:34 docker daemon: 1.0.0 63fe64c; execdriver: native; graphdriver:
[29daee74] +job initserver()
[29daee74.initserver()] Creating server
[29daee74] +job serveapi(unix:///var/run/docker.sock)
2014/06/10 02:26:34 Listening for HTTP on unix (/var/run/docker.sock)
Error running DeviceCreate (createPool) dm_task_run failed
[29daee74] -job initserver() = ERR (1)
2014/06/10 02:26:34 Error running DeviceCreate (createPool) dm_task_run failed
Ubuntu version:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise
Linux Header version:
apt-cache search linux-headers-$(uname -r)
linux-headers-3.8.0-38-generic - Linux kernel headers for version 3.8.0 on 64 bit x86 SMP
Could not find this error anywhere online. Any cues appreciated.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 5
- Comments: 66 (15 by maintainers)
Works for me.
TL;DR
I’m constantly corrupting my /var/lib/docker directory by running docker in loopback mode when I MEAN to run in devicemapper mode.
To fix without rebooting/deleting the ENTIRE /var/lib/docker dir (as root)
dmsetup ls
# list docker-* devicesdmsetup remove docker-*
#fill in the * yourself, unmaps loopback devicerm -rv /var/lib/docker/devicemapper/devicemapper
Explanation
I’m not sure if this is of any help, but I am CONTINUOUSLY having this problem too!
Now the reason I get this is VERY reproducible and fixable. (NO, NOT BY DELETING /var/lib/docker!!!)
In my case, I run docker via
Which I add to
/usr/lib/systemd/system/docker.service
, HOWEVER every time I upgrade, that file get reset, and I inevitable forget to change it (AGAIN!) before trying to start docker… And here’s the kick, when you startdocker daemon
without these options (in Centos 7), it will start in loopback mode or whatever. And when THAT happens,/var/lib/docker/devicemapper/devicemapper/
is populated. So when you DO run with the--storage-opt dm
option, NOW the directory is corrupted. However, what I just discovered is that by deleting the/var/lib/docker/devicemapper/devicemapper/
directory ONLY, the problem is fixed. I’m able to start docker with the dm storage and keep all my images and containers…Edit: However I have discovered that it is important to clean up the loop back devices properly BEFORE deleting /var/lib/docker/devicemapper/devicemapper/, or else you have stray loopbacks that need to be cleaned up (via rebooting?)
Recap
/usr/bin/docker daemon --storage-driver=devicemapper --storage-opt dm.datadev=/dev/vg-docker/data --storage-opt dm.metadatadev=/dev/vg-docker/metadata --exec-opt native.cgroupdriver=cgroupfs --storage-opt dm.basesize=100G
#works/usr/bin/docker daemon
#corrupts/usr/bin/docker daemon --storage-driver=devicemapper --storage-opt dm.datadev=/dev/vg-docker/data --storage-opt dm.metadatadev=/dev/vg-docker/metadata --exec-opt native.cgroupdriver=cgroupfs --storage-opt dm.basesize=100G
#brokendmsetup ls
to list the mapped docker devicesdmsetup remove docker-253:1-2152645735-pool
# This should remove the map on the loopback device AND remove the loopback devices, since autoclear is usually on, the vgs are something else, and belong therelosetup -a
#lists loopback devices (Should be empty of docker loopbacks)losetup -d /dev/loop0
# to unmount loopback device IF any are left. only unmount the ones you see inlosetup -a
, which might not be loop0rm -rv /var/lib/docker/devicemapper/devicemapper
#fixes everything/usr/bin/docker daemon --storage-driver=devicemapper --storage-opt dm.datadev=/dev/vg-docker/data --storage-opt dm.metadatadev=/dev/vg-docker/metadata --exec-opt native.cgroupdriver=cgroupfs --storage-opt dm.basesize=100G
#works againRunning CentOS 7.2.1511
docker version
uname -a
As a side note, the third time I tried this, I had to delete
deviceset-metadata
andtransaction-metadata
from the/var/lib/docker/devicemapper/metadata
directory. This may be unrelated, but the values got messed up, and deleting them lets them regenerate safely.this helped for me: (after switching to the latest kernel on DigitalOcean)
I had the same problem and was not able to fix it because I did’nt want to go for the full nuke: /var/lib/docker/ solution. I found something promising at: http://grokbase.com/t/gg/docker-user/1563fzdtm7/docker-docker-runs-out-of-space-when-trying-to-create-a-new-image 'The default docker storage driver allocates 10GB storage blocks for your images. Move to overlayfs and avoid this entirely. In the command that starts your docker daemon just add “-s overlay” ’
Are you using digital ocean?
I was once suffering from the same problem until I run
locate “.config”
and then switched my kernel to one shown at the last command.
This worked for me, please try if this works for you as well.
I received this error when docker used up all it’s disk space. I went and removed a bunch of images to free some space up, but any time I tried to start a container, it threw the
Error running DeviceCreate (createPool) dm_task_run failed
error. I tried stopping docker and starting it back up, and now it won’t even start.Going to have to wipe the docker partition and start over.
ah, need to include
--storage-opt="dm.blocksize=64k"
to the daemon flags for the time being