Persistent portainer Data on external drive

  • My docker are at /var/lib/docker witch is a link to /srv/dev-disk-by-label-WD_10TB_1/docker/docker, yes I am aware got an extra docker folder nested by the way not sure how to get rid of it without loosing my data! anyway to get back to my concern is how to get portainer survive a reboot I read the https://portainer.readthedocs.io/en/stable/deployment.html but I am not able to format this

    Code
    $ docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /path/on/host/data:/data portainer/portainer

    since I always get some type of errors

  • It will not be possible to help you when you don't post what you tried and you don't post what the errors were.


    Is there some reason you cannot install Portainer from within the OMV-Extras page?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

    Edited once, last by gderf ().

  • Not exactly portainer is running I just want a bind mount according to this:

    Persist Portainer data

    By default, Portainer store its data inside the container in the /data folder on Linux (C:\\data on Windows).

    You’ll need to persist Portainer data to keep your changes after restart/upgrade of the Portainer container. You can use a bind mount on Linux to persist the data on the Docker host folder:

    Code
    $ docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /path/on/host/data:/data portainer/portainer

    So what I did is below and of course is wrong but I am lost

    root@rockpro64:~# docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/dev-disk-by-label-WD_10TB_1/AppData/data:/data portainer/portainer

    docker: Error response from daemon: Conflict. The container name "/portainer" is already in use by container "29e05d3ce12720a9fc38bdbe9fe1fa4cee6484584c0bad94f0d31ad344188e07". You have to remove (or rename) that container to be able to reuse that name.

    See 'docker run --help'.



    root@rockpro64:~#

    root@rockpro64:~# docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/dev-disk-by-label-WD_10TB_1/AppData/data:/data portainer

    Unable to find image 'portainer:latest' locally

    docker: Error response from daemon: pull access denied for portainer, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.




  • The error message is clear. Conflict. You can't have two containers with the same name. If you are going to use the CLI to do this you will have to clean up problems the same way first.


    If you were to use the OMV-Extras Docker tab to install Portainer you wouldn't have this problem. The data will be written to the location given by whatever you have in the Docker Storage box and it will be persistent, so long as that location is a real location on a physical hard drive and not a RAM disk. This is the same location you should be using for all your containers.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • Sorry to reopen this but I was out of this game for some time, and I do not know how to make it work.


    So I use the direct location /srv/dev-disk-by-label-WD_10TB_1/docker/docker instead of the sim link var/ lib/docker after restart portainer wont start except If do: docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer


    and obviously docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/dev-disk-by-label-WD_10TB_1/AppData/data:/data portainer/portainer


    get me the same error message

    docker: Error response from daemon: Conflict. The container name "/portainer" is already in use by container "4227184e53abc5847b74959f8659c83722f47b6fa715049c55615669a78ddbec". You have to remove (or rename) that container to be able to reuse that name.


    I do not not know out to resolve this catch22 situation maybe somebody can give me some detailed instruction to achieve this


  • Anyway I removed portainer thru the web interface but did go too far, got port is already allocated in bind mode

  • Code
    root@rockpro64:~# docker run -d -p 9000:9000 -p 8844:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/dev-disk-by-label-WD_10TB_1/AppData/data:/data portainer/portainer
    Unable to find image 'portainer/portainer:latest' locally
    latest: Pulling from portainer/portainer
    d1e017099d17: Pull complete
    792234048c53: Pull complete
    Digest: sha256:4ae7f14330b56ffc8728e63d355bc4bc7381417fa45ba0597e5dd32682901080
    Status: Downloaded newer image for portainer/portainer:latest
    9b22fcfb7747f77afc21554ef602f5a01c46d5860dd58e1f150aa34247b8855f

    This time I guess it took it but when I restart I try to install portainer tru the web interface got

    dokcker storage :: /srv/dev-disk-by-label-WD_10TB_1/docker/docker

    Opt-out :: 1

    arch :: arm64

    option :: portainer

    state :: install

    extras :: 5.2.6

    DNS OK.

    Removing portainer ...

    portainer

    Removing portainer/portainer image ...

    Untagged: portainer/portainer:latest

    Untagged: portainer/portainer@sha256:4ae7f14330b56ffc8728e63d355bc4bc7381417fa45ba0597e5dd32682901080

    Deleted: sha256:4211f12ec84c848c898610bc136cf64d419df29bec920df77f17168f7be29096

    Deleted: sha256:d08fc03dca8d9b5aeb00d0eda5b8e2e82e131a93ab29281afa2c42d749e941cb

    Deleted: sha256:dd4969f97241b9aefe2a70f560ce399ee9fa0354301c9aef841082ad52161ec5

    Pulling and starting portainer ...

    a817ceeab49475d9fb38fa4a12afb6c4d9251e1ad21d2d038fa1472ccb5c7697

    Something went wrong trying to pull and start portainer ...

    Done.

    the only way I can get portainer running is by doing docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

    Witch defeat the purpose

    On top of it but I had this issue before but I think it is getting worse with omv 5 .0 getting a lot of "(5min) of 7.0 matches resource limit [loadavg (5min)"

    I think it come from Emby docker witch is very slow and sometime not even reachable on the network.

  • You don’t need to do it through the web interface if you use that command.


    You can have it start automatically by changing the command slightly to: Note that is a double dash before restart, it gets formatted weirdly on my phone.


    You can also change the restart policy if any container using portainer, including itself.


    Code
    docker run -d —restart always -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
  • Of course I did not realize portainer was a container, so just changing the restart policy did the trick antsh I thank you for your help.

    From that I am going to do a clean install because the upgrade got me to much issues with "resource limit" I will reattach those container and go from that.

  • I just did a clean install and wanted to connect again to my existing containers I put as before /srv/dev-disk-by-label-WD_10TB_1/docker/docker to the box in docker tab but the only container it connect is portainer itself when I look in /srv/dev-disk-by-label-WD_10TB_1/docker/docker/containers only one is listed so portainer all my other one look like they are missing but they are not, if i boot to my OMV 4 .11 backup they all there! and working not sure how to get back to them from the new install omv5?


    EDIT

    Never mind i forgot to mount the disk so I just to removed the previous container and reinstall them again LOL

  • Actually My main issue now

    is to reconnect emby/ jellyfin to the existing directory since they just want me to start from scratch how do that from the container no idea how the mountpoint got changed ?


    Edit

    I believe I go to fast as before I forgot to setup the existing sharefolder this is probably my issue LOL

  • Can you show your storage mappings for emby for both omv4 and omv5? One thing to note is that omv5 doesn't use /sharedfolders/ by default anymore, so you need to change that mapping. Also, specifically for your emby config files, you have it pointed to the same location in omv4 and omv5 and the same files exist in the same locations for both installs?

  • My latest clean install and latest upgrade from 4 to 5 both got major issues! went back to an ancient backup upgraded to 5 first I noticed I do not need to worry about persistence it is done automatically buy putting an absolute path in the docker tab this even survive reboot so this part is resolved.


    Regarding emby/ jelly I thought I would need also an absolute path according to [How-to] Emby on OMV5.x and Portainer but after the second reboot I got some connection to my existing data user and library, without changing the path but unfortunately I did this upgrade on a version of witch had issue of"(5min) of 7.0 matches resource limit [loadavg (5min)" this make the server kind of slow I do not know how to fix it I did try to upgrade a good version 0f omv 4 but like I said at the beginning got me a lot of error and could not deploy nginx, further more on this omv 5 running now airsonic give me This site can’t be reached althought the container is running.

Participate now!

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