On Ubuntu 16.04 Docker fails to start on system startup if Docker was configured to use devicemapper as storage driver with direct-lvm as storage-pool. The following errors occur

#$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Di 2016-07-12 16:22:33 CEST; 1min 30s ago
     Docs: https://docs.docker.com
  Process: 1880 ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 1880 (code=exited, status=1/FAILURE)

Jul 12 16:22:33 docker-lvm systemd[1]: Starting Docker Application Container Engine...  
Jul 12 16:22:33 docker-lvm docker[1880]: time="2016-07-12T16:22:33.304838820+02:00" level=fatal msg="Error starting daemon: error initializing graphdriver: devicemapper: Non existing device ubuntu--vg-thinpool"  
Jul 12 16:22:33 docker-lvm systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE  
Jul 12 16:22:33 docker-lvm systemd[1]: Failed to start Docker Application Container Engine.  
Jul 12 16:22:33 docker-lvm systemd[1]: docker.service: Unit entered failed state.  
Jul 12 16:22:33 docker-lvm systemd[1]: docker.service: Failed with result 'exit-code'.  
Jul 12 16:22:33 docker-lvm systemd[1]: docker.service: Start request repeated too quickly.  
Jul 12 16:22:33 docker-lvm systemd[1]: Failed to start Docker Application Container Engine. 

The status messages indicated that my thinpool was not available. lvdisplay said the same:

#$ sudo lvdisplay ubuntu-vg/thinpool
  --- Logical volume ---
  LV Name                thinpool
  VG Name                ubuntu-vg
  LV UUID                Or2cLx-ENFq-sZqh-kxUw-0FEQ-rEzi-vXCi3C
  LV Write Access        read/write
  LV Creation host, time docker-lvm, 2016-07-12 15:57:06 +0200
  LV Pool metadata       thinpool_tmeta
  LV Pool data           thinpool_tdata
  LV Status              NOT available
  LV Size                14,07 GiB
  Current LE             3601
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

Note: LV Status NOT available

Trying to activate it said:

#$ sudo lvchange -ay ubuntu-vg/thinpool
  /usr/sbin/thin_check: execvp failed: No such file or directory
  Check of pool ubuntu-vg/thinpool failed (status:2). Manual repair required!

The tools for thinpools are configured in /etc/lvm/lvm.conf and there i found the following paragraph:

    # Configuration option global/thin_check_executable.
    # The full path to the thin_check command.
    # LVM uses this command to check that a thin metadata device is in a
    # usable state. When a thin pool is activated and after it is
    # deactivated, this command is run. Activation will only proceed if
    # the command has an exit status of 0. Set to "" to skip this check.
    # (Not recommended.) Also see thin_check_options.
    # (See package device-mapper-persistent-data or thin-provisioning-tools)
    # This configuration option has an automatic default value.
    # thin_check_executable = "/usr/sbin/thin_check"

I looked up the packages mentioned there and i found that the package thin-provisioning-tools is available but not installed.

#$ sudo apt-cache policy thin-provisioning-tools
  Installed: (none)
  Candidate: 0.5.6-1ubuntu1
  Version table:
     0.5.6-1ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

After installation the package the utils for thinpools were available. Manual Activation of the docker-thinpool succeeded and also on system startup the volume was activated and docker starts successfully.

  • Having this startup problem myself... for CentOS 7 users, that executable is in the device-mapper-persistent-data RPM. – Aaron D. Marasco Feb 3 '17 at 13:23

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.