Search code examples
dockerdevice-mapper

Extend docker devicemapper loop-lvm sparse file


We are using Docker as part of our build pipeline. As we're using CentOS, the default Docker installation has set up devicemapper with a loop-lvm sparse file. Now that sparse file has reached it's size limit of 100G and we're not able to build any new images or containers. Due to the issues mentioned in Clean docker environment: devicemapper we cannot free any space by removing unused containers or images.

As I've learnt in the meantime, using loop-lvm is not a very good idea (http://www.projectatomic.io/blog/2015/06/notes-on-fedora-centos-and-docker-storage-drivers/) and we're planning the migration to direct-lvm. However, this will take some time to plan. Therefore I'm looking into possibilites to extend the currently used sparse file without loosing all data.

The current Docker docs have some instructions on how to extend the sparse file (https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#/for-a-loop-lvm-configuration). However, we are currently running Docker version 1.9 and the docs for this version do not contain these instructions. Any chance that they are still applicable for Docker 1.9?


Solution

  • Answering my own question: I was able to extend the loop-lvm file using the method described in the docs and did not encounter any issue so far.