Centos 7 Docker storage loopback warning

Posted July 25, 2015 21.1k views

I’m getting message:
“Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.” when I run container.

I wanted to create second partition for docker data but on digital ocean it’s not possible.
What is the other good option to fix it?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

This probably means you need more storage for your volume group.
If you have free space and you are using Logical Volume Management (LVM), you can allocate more space by creating data + metadata volume:

lvcreate -n docker-data -L 20G /dev/my-vg
lvcreate -n docker-metadata -L 2G /dev/my-vg

Unfortunately I don’t have any lv group. This is how my partitions looks like:

/dev/vda1 20G 2,2G 17G 12% /
devtmpfs 240M 0 240M 0% /dev
tmpfs 246M 0 246M 0% /dev/shm
tmpfs 246M 8,3M 237M 4% /run
tmpfs 246M 0 246M 0% /sys/fs/cgroup

I believe this is specific to RHEL variants of linux from what I understand. They’d prefer that you mount docker storage into the container outside the root volume. I don’t think this is possible though on digital ocean. If this was AWS for example you’d be able to mount a separate EBS volume specifically to be referenced for your containers. For digital ocean it’s probably best for you to just read the error message closely and add the flag to the docker daemon to hide the message.

No, nothing to do with resizing.

Actually, the message might have been added specificly only in the RedHat’s supported Docker binary (seem indeed to remember that was proposed but refused upstream), BUT it’s a real message you should pay attention in general.

The big issue here is actually that Docker is configured (as is the default) to use Devicemapper IN LOOPBACK MODE. This loopback mode is the thing that’s strongly discouraged to be used.

So, you should either use direct LVM storage (called “thin provisionning”, aka “thinp”), or switch to another storage driver.

Btw, shameless plug: (I stored a lot of links in that blog so I think that may be of interest here, not only trying to do advertising ;-)).