Docker Community Forums

Share and learn in the Docker community.

Lvm (device mapper) on docker


(Mattmurdocker78) #1

Hello everyone,

OS: ubuntu 14.04
lvm package: lvm2

I followed this procedure: https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/ (from the title: direct-lvm Configure fashion for production)

which lets you configure the LVM on a hard drive

I partition my drive sdb and then I followed step by step, I block out the following command:

lvconvert --zero n -y -c 512K --thinpool docker / thinpool --poolmetadata docker / thinpoolmeta

Here is the error message I: “Can not use thin logical volume docker / thinpool for thin pool data.”

Do you have an idea ?


(Chemical) #2

I have tried using LVM myself and it didn’t work when following the guide.

But if you follow the manual configuration from the guide and use the following content for /etc/docker/daemon.json then it will work:

{
    "storage-driver": "devicemapper",
    "storage-opts": [
    "dm.thinpooldev=/dev/mapper/docker-thinpool-tpool",
    "dm.use_deferred_removal=true",
    "dm.use_deferred_deletion=true"
    ]
}

The difference is adding “-tpool”.

See https://github.com/docker/docker.github.io/pull/386 which should have fixed the issue.