I think, This problem is very population, I find a lot of ways on internet, but I have tried all of them, nothing can work.
I want to move /var/lib/docker folder because my computer has low disk space.
I perform these steps:
1 Stop daemon
service docker stop
2 Add configuration file with location of new data directory
Create/Edit /etc/docker/daemon.json file:
{"data-root": "/path/to/new/docker/location","storage-driver": "overlay2"}
3 update config /lib/systemd/system/docker.service
xecStart=/usr/bin/dockerd --data-root /path/to/new/docker/location -H fd:// --containerd=/run/containerd/containerd.sock
I also try with -g replace to --data-root, both ways donot work.
4 Copy docker files to new location
rsync -aP /var/lib/docker/ /path/to/new/docker/location
5 Start daemon
service docker start
However, I have a error at step 5, actually I don't know how to fix that.
Anyone can help me?
Update:
Please link the similar question responsibly, it's not work for me, I also describe detail steps that I performed.