Hi all,
I'm running OMV on a raspberry pi2 using a 8GB microSD card.
root filesystem is running out of space.
/var/lib/docker folder uses 2,6GB of disk space.
Can I move this folder to an external storage?
Move docker /var/lib/docker folder on external drive
-
- OMV 4.x
- mcgyver83
-
-
In OMV go to Services | Docker | Settings. Make a change to the setting: The location of the Docker base path. This must be an OMV shared folder, so create one on the target drive beforehand if you have not already done so.
-
-
I don't think that changing the docker base path deletes the files from the old location.
-
Ok, so I can try to move the /var/lib/docker folder and see if something crash
-
I have very bad experience with changing this setting. During one of the updates of Docker addon i received bunch of folders (docker related) in /sharedfolders/
+ the setting was back to default which created a complete mess ....So my solution is :
1) don't touch the setting in Docker tab
2) Move /var/lib/docker to external drive (ex. /sharedfolders/data/docker)
3) sym-lync /sharedfolders/data/docker to /var/lib/dockerDone.
No problems so far....
-
-
I have very bad experience with changing this setting. During one of the updates of Docker addon i received bunch of folders (docker related) in /sharedfolders/
+ the setting was back to default which created a complete mess ....So my solution is :
1) don't touch the setting in Docker tab
2) Move /var/lib/docker to external drive (ex. /sharedfolders/data/docker)
3) sym-lync /sharedfolders/data/docker to /var/lib/dockerDone.
No problems so far....
I am very interested to move my dockers to my external drive just need to know the pros and cons for doing it, and above all, what is the way to create a symlink in order to achieve this.
-
-
Well I have to confess,i am not too good to navigate in cmd i did actually succeed but gave an existent link.So in order to create the link so I used win scp and cmd
but now my docker place is empty I renamed the link docker but nothing
I did try thisroot@rockpro64:/sharedfolders# ln -s /docker /var/lib/docker-link
but it is wrong what could be the exact cmd? -
I am replying to myself!
This time I stopped the plugin succeed to navigate to the appdata folder where I had copied the docker folder from var/lib and did the cmd ln -s /docker /var/lib/docker
so far it is working before deleting the original docker I renamed it old the only difference all my docker images is empty but not the docker container witch show only numeric ID maybe because of towerwatch or some error I produced a long the way.
I am unable to download the new images but I have connection to the repo! -
The main issue for me is to get a proper copy of my original docker in my appdata folder but I only get only a partial copy of the docker folder I am using
rsync -avr --progress /var/lib/docker /sharedfolders/AppData/data/docker
and after for the link ln -s /docker /var/lib/docker but probably this is not right
Should I put back the noexec I modified some time ago for plex problem?
Actually i corrected my link but it look like I am getting a virgin docker folder instead
ln -s /sharedfolders/AppData/data/docker /var/lib/docker/docker -
I continue my monologue this time I think it is working, the problem was too many docker nested into each other
so I had to change my link
ln -s /sharedfolders/AppData/data/docker/docker /var/lib/docker
Well at least I am learning CLI. -
I continue my monologue this time I think it is working, the problem was too many docker nested into each other
so I had to change my link
ln -s /sharedfolders/AppData/data/docker/docker /var/lib/docker
Well at least I am learning CLI.
Hi, I am trying to do the same as you. It would be handy for me to be able to remove the SD-card out of my RockPro so that I can put new images on it, without having to reinstall all the dockers.I did the following:
First I created a Shared Folder in webgui: DockerData
The I ran (as root)
mv /var/lib/docker /sharedfolders/DockerDataln -s /sharedfolders/DockerData/docker /var/lib/dockerBut when I tried to install a new Docker I get the following error message:
Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; docker run -d --restart=always -v /etc/localtime:/etc/localtime:ro --net=host -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --name="watchtower" --label omv_docker_extra_args="-v /var/run/docker.sock:/var/run/docker.sock" -v /var/run/docker.sock:/var/run/docker.sock "containrrr/watchtower:latest" 2>&1' with exit code '125': ce4b09904a5cc1ecee4bfe2a82261a3f852e8949b8a9a45768ba9f04ed032790docker: Error response from daemon: OCI runtime create failed: /var/lib/docker/overlay2/42adf7a818ee0fa1dc7ac7f1a5dd209f5669ab56be76ac5e3745375ef9ba7430/merged is not an absolute path or is a symlink: unknown.
CodeError #0: OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; docker run -d --restart=always -v /etc/localtime:/etc/localtime:ro --net=host -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --name="watchtower" --label omv_docker_extra_args="-v /var/run/docker.sock:/var/run/docker.sock" -v /var/run/docker.sock:/var/run/docker.sock "containrrr/watchtower:latest" 2>&1' with exit code '125': ce4b09904a5cc1ecee4bfe2a82261a3f852e8949b8a9a45768ba9f04ed032790 docker: Error response from daemon: OCI runtime create failed: /var/lib/docker/overlay2/42adf7a818ee0fa1dc7ac7f1a5dd209f5669ab56be76ac5e3745375ef9ba7430/merged is not an absolute path or is a symlink: unknown. in /usr/share/php/openmediavault/system/process.inc:182 Stack trace: #0 /usr/share/openmediavault/engined/rpc/docker.inc(607): OMV\System\Process->execute() #1 [internal function]: OMVRpcServiceDocker->runContainer(Array, Array) #2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array) #3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('runContainer', Array, Array) #4 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Docker', 'runContainer', Array, Array, 1) #5 {main}
So for some reason it finds it a problem that this is a symlink. How did you get around this? -
Hi, I am trying to do the same as you. It would be handy for me to be able to remove the SD-card out of my RockPro so that I can put new images on it, without having to reinstall all the dockers.
I did the following:
First I created a Shared Folder in webgui: DockerData
The I ran (as root)
mv /var/lib/docker /sharedfolders/DockerDataln -s /sharedfolders/DockerData/docker /var/lib/dockerBut when I tried to install a new Docker I get the following error message:
Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; docker run -d --restart=always -v /etc/localtime:/etc/localtime:ro --net=host -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --name="watchtower" --label omv_docker_extra_args="-v /var/run/docker.sock:/var/run/docker.sock" -v /var/run/docker.sock:/var/run/docker.sock "containrrr/watchtower:latest" 2>&1' with exit code '125': ce4b09904a5cc1ecee4bfe2a82261a3f852e8949b8a9a45768ba9f04ed032790docker: Error response from daemon: OCI runtime create failed: /var/lib/docker/overlay2/42adf7a818ee0fa1dc7ac7f1a5dd209f5669ab56be76ac5e3745375ef9ba7430/merged is not an absolute path or is a symlink: unknown.
CodeError #0: OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; docker run -d --restart=always -v /etc/localtime:/etc/localtime:ro --net=host -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --name="watchtower" --label omv_docker_extra_args="-v /var/run/docker.sock:/var/run/docker.sock" -v /var/run/docker.sock:/var/run/docker.sock "containrrr/watchtower:latest" 2>&1' with exit code '125': ce4b09904a5cc1ecee4bfe2a82261a3f852e8949b8a9a45768ba9f04ed032790 docker: Error response from daemon: OCI runtime create failed: /var/lib/docker/overlay2/42adf7a818ee0fa1dc7ac7f1a5dd209f5669ab56be76ac5e3745375ef9ba7430/merged is not an absolute path or is a symlink: unknown. in /usr/share/php/openmediavault/system/process.inc:182 Stack trace: #0 /usr/share/openmediavault/engined/rpc/docker.inc(607): OMV\System\Process->execute() #1 [internal function]: OMVRpcServiceDocker->runContainer(Array, Array) #2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array) #3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('runContainer', Array, Array) #4 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Docker', 'runContainer', Array, Array, 1) #5 {main}
So for some reason it finds it a problem that this is a symlink. How did you get around this?
I did this not avoid to recreate docker but to avoid the wear and tear of the SD with to many I/O rewrite card the MV command did not work for me maybe a permission issue
so I used
Rsync
rsync -avr --progress /var/lib/docker /sharedfolders/AppData/data/docker
and to create a link ln -s /sharedfolders/AppData/data/docker/docker /var/lib/dockeryou can click the symlink in winscp ifthe path oper to the docker
And when I was sure everything was working I deleted the original Docker folder. -
Thanks for answering. My solution was that I had to run
service docker stop
before I did the rest. This is also the case when I want to add or remove any shared folders. And then after you have to run
service docker start
of course.
My source: https://forums.docker.com/t/ho…stallation-directory/1169
I can really recommend doing this for people that flash their images on a sd-card!
-
How do you can (re)move docker folder? subfolder btrfs cannot be moved or deleted
-
How do you can (re)move docker folder? subfolder btrfs cannot be moved or deleted
Is the docker service stopped?
-
How do you can re(move) entair docker folder? subfolder btrfs can not be moved or deleted
Is the docker service stopped?
in UI and 'service docker stop' ? yes. how to check it further?
-
service docker status
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!