Cannot move Docker from /var/lib/docker

  • I can't seem to move docker away from the OS drive /var/lib/docker


    I ran:

    docker kill $(docker ps -q)

    service docker stop

    cp -a /var/lib/docker/ /*path to ZFS pool/docker/

    logged into OMV gui > system > extra > docker and changed the location to the new path

    rebooted OMV

    OMV reports docker is installed but not running.


    I can't seem to get around it. I even tried using symbolic links and it still fails. Just don't get it. Anyone has any suggestions?

  • Check the logs to see why Docker is not running?

    Check the config file in /etc/docker to see that the new path took effect?

  • logged into OMV gui > system > extra > docker and changed the location to the new path

    Did you clicked "save" in the bottom right corner PRIOR to click "install" again?


    And, although I'm not 100% sure, you should use a full disk Path, and not a path to a pool (mergefs?!?).

    Or a symlink but pointing to a disk.


    As eg.

    My docker root lives in "/docker/" which is a symlink to "/srv/dev-disk-by-xxxxxx/docker"

  • Or a symlink but pointing to a disk.


    As eg.

    My docker root lives in "/docker/" which is a symlink to "/srv/dev-disk-by-xxxxxx/docker"


    That's just a path to a directory. There's no such thing as a symlink to a disk - disks are represented by devices in /dev, but only become useful once mounted into directories.

  • I did


    sudo systemctl stop docker.service

    sudo systemctl stop docker.socket



    1) Copy contents of var/lib/docker like you did
    2) sudo nano /etc/docker/daemon.json and add this to the file, then save it


    {

    "data-root": "/*path to ZFS pool/docker/"

    }


    sudo systemctl enable docker.socket

    sudo systemctl enable docker.service


    then go to GUI and change path there also and press restart docker... Then restart server to see if it worked as wanted.

    atleast this worked for me

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!