We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Juha Marila • 3 years ago

Thanks, this solved my problem!

Adriel • 3 years ago

No worries, great to hear it was helpful.

sanme98 • 2 years ago

Still valid :)

HapiDaze • 5 years ago

Thank you so much for this! One question though:
Initially I had "data-root": "/home/tom/docker"
I ran:
sudo docker run docker/whalesay cowsay Hello
and got the response:
Status: Downloaded newer image for docker/whalesay:latest
docker: Error response from daemon: error creating overlay mount to /home/ian/docker/overlay2/d946e337f381aea36cb5d7f007165a83a30107361f3a5f588ef3353343cff5b4-init/merged: invalid argument.

The fix was to change to "data-root": "/home/docker"

However, I'd love to know what step I would need to take in order for it to work against /home/tom/docker. I'm guessing it's some kind of linux permissions thing?

Adriel • 5 years ago

If you used the above `rsync` command to make the copy of the docker dir, it should have the same permissions as the source.
Maybe try again with `rsync`, e.g. `sudo rsync -axPS /home/docker /home/tom/docker` ?

Awes0meM4n • 5 years ago

I had a problem executing dpage/pgadmin4 image. gunicorn couldn't start because cannot take the port to deploy pgadmin in localhost. It was solved checking permissions for the new path and adding docker group with wrx. So check that in this case & thanks for the post.

Adriel • 5 years ago

Nice, thanks for leaving a comment to help others.

talker90 • 6 years ago

Hello! Thanks for the post. So to clarify, since the changes will be read from the .json file, you don't need to edit your /etc/default/docker file with the -g option: DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4 -g /new/path/to/docker-data" ?

Adriel • 6 years ago

That is correct.

talker90 • 6 years ago

Thanks for the guide! Does this work if moving to an external directory, I'm trying to move data to a USB drive to try to save space.

(I'm using Debian 9)

Adriel • 6 years ago

Can't think offhand why it shouldn't. Give it a try.

Corlos • 6 years ago

Docker can't start after adding /etc/docker/daemon.json.
Run systemctl status docker says:
unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives don't match any configuration option: data-root

After change data-root to graph, then systemctl start docker eveything is ok. I don't know why.

My os version is Fedora 29. And Docker version is:
# docker -v
Docker version 1.13.1, build 1185cfd/1.13.1

Adriel • 6 years ago

Hmm, interesting, Docker must be run under a different user or something. Thanks for sharing.

Dietrich Schulten • 6 years ago

Removing /var/lib/docker may fail with "operation not permitted" on btrfs subvolumes. They can be removed with btrfs:

/var/lib/docker # btrfs subvolume delete btrfs/subvolumes/*

Also there is a nuke-graph-directory.sh script which should make it more safe to delete the docker root dir.

See https://github.com/moby/mob...

Ivan Barjaktarov • 7 years ago

I am so happy when I eventually land on a great quality information on the internet. Thank you sir for sharing, this knowledge

Adriel • 7 years ago

Thank you for the great feedback!
I had the same issue when I first looked for this info, hence the post.

jimfrenette • 7 years ago

Great post. Worked for me on my fedora 29 desktop and I also had to redeploy pre-existing portainer due to this error after the move:
```
docker start sharp_engelbart
Error response from daemon: error evaluating symlinks from mount source "/var/lib/docker/volumes/portainer_data/_data": lstat /var/lib/docker: no such file or directory
Error: failed to start containers: sharp_engelbart
```
Docker CE 18.09.1

Adriel • 7 years ago

Interesting, Portainer must somehow cache or something the old location. Good to hear redeploying it fixes it though. Not a hard fix luckily.

Papasax • 7 years ago

Great solution. Worked perfectly on CentOS 7.

Adriel • 7 years ago

Great to hear it works in CentOS 7 too, thanks for letting us know.

Andreas Huber • 7 years ago

Great solution. Worked fine on 18.04 Ubuntu - had to do it twice, as there was an issue with in combination with portainer.io as this is my container cockpit.
Finally - i followed your steps again and made a new install of portainer.io interface, the same as their initial setup. The first startup of my "moved" containers start did not work, but stopping them once and restarting again made my "moved" containers working again!

Adriel • 7 years ago

Thanks for the feedback Andreas! I'm sure it'll help others who use Portainer too.