Warning: the following will delete all your containers and all your images. Make sure that you backup any precious data!
Remember what we said above: Docker will create the data and metadata files if they don’t exist. So the solution is pretty simple: just create the files for Docker, before starting it!
- Stop the Docker daemon, because we are going to reset the storage plugin, and if we remove files while it is running, Bad Things Will Happen©.
- Wipe out
/var/lib/docker. Warning: as mentioned above, this will delete all your containers all all your images.
- Create the storage directory:
mkdir -p /var/lib/docker/devicemapper/devicemapper.
- Create your pool:
dd if=/dev/zero of=/var/lib/docker/devicemapper/devicemapper/data bs=1G count=0 seek=250will create a sparse file of 250G. If you specify
bs=1G count=250(without the seek option) then it will create a normal file (instead of a sparse file).