Skip to content

Instantly share code, notes, and snippets.

@hb3p8
Last active August 24, 2016 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hb3p8/1b97599634cc82b2771ed28d4ff19168 to your computer and use it in GitHub Desktop.
Save hb3p8/1b97599634cc82b2771ed28d4ff19168 to your computer and use it in GitHub Desktop.

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=250 will 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).
  • Restart the Docker daemon. Note: by default, if you have AUFS support, Docker will use it; so if you want to enforce the use of the Device Mapper plugin, you should add -s devicemapper to the command-line flags of the daemon.
  • Check with docker info that Data Space Total reflects the correct amount.
@hb3p8
Copy link
Author

hb3p8 commented Aug 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment