Using second drive for Nextcloud

  • Hi all,


    I have Nextcloud set up as a docker image through Portainer. I'm using an old Mac Mini 2012 with a NVME boot drive and a 2TB SATA HDD.

    I only have one shared folder mounted in OMV which corresponds to the HDD and wanted to use this for my Nextcloud storage. When I initially ran the docker script in Portainer, I made sure to set my volumes for both the app and db to the shared folder. The script I used is as belos:



    However, Nextcloud is reporting 100GB of space which would likely be my NVME.


    Would someone be able to shed some light on this? I'd have thought that as long as you set the correct volume for the app and db on installation, the correct disk would be used?


    Thank you! :)

  • Your volume mappings are wrong.

    • left side of colon: path on the host (e.g. /srv/dev-disk-by-...)
    • right side of the colon: This is the place inside the container (check the docs of your container what should be there)


    You are using named volumes on the left side, which are managed by docker and are usually stored in the docker root (/var/lib/docker/volumes).

    The config will have to be redone, but you will loose everything if you do not export it from the volumes.


    Do you need more help?

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Yes please! We've not started using the new install at home just yet so I don't mind re-doing the install completely.


    So if I am understanding this correctly, as docker/portainer is installed on the boot drive, my Nextcloud install also went onto the boot drive so the path I gave just made extra folder in docker root instead of on the storage drive. A I right in saying that the volumes should be something like this instead:


    Code
    volumes:
    - /srv/MY-SHARED-FOLDER/Data:/var/www/html
  • Instead of using the official Nextcloud docker version, see the guides section on the forum: there's a well supported guide there for Nextcloud.

  • Yes please! We've not started using the new install at home just yet so I don't mind re-doing the install completely.


    So if I am understanding this correctly, as docker/portainer is installed on the boot drive, my Nextcloud install also went onto the boot drive so the path I gave just made extra folder in docker root instead of on the storage drive. A I right in saying that the volumes should be something like this instead:


    Code
    volumes:
    - /srv/MY-SHARED-FOLDER/Data:/var/www/html

    If you do not mind to loose the containers, it is advised to move the docker-root off the os disk as the docker data can get quite large.

    So the first steps to do would be (my oppinionated way of doing this):

    • create a directory on one of your data disks for storing the docker internal data (default is /var/lib/docker, but we do not want this directory). This is where docker will store its internal data. You must not work in this directory yourself
      sudo md /srv/dev-disk-by-uuid-<long number>/docker-root
      Do not set any permissions / ACLs for this directory.
    • create a directory on one of your data disks for storing all the configs of your future docker containers. This will help if you need to change the disk or move the data somewhere else
      sudo md /srv/dev-disk-by-uuid-<long number>/docker-apps
      Change the group of this directory the users (if you do not mind that all users can edit configs in there)
      sudo chgrp users  /srv/dev-disk-by-uuid-<long number>/docker-apps
      Allow anyone in users to work in this directory
      sudo chmod 2770  /srv/dev-disk-by-uuid-<long number>/docker-apps
    • create a symlink /srv/docker-root to some data disk e.g. /srv/dev-disk-by-uuid-<long number>/docker-root. This will help if you need to change the disk or move the data somewhere else too. In all the next steps we use only the symlink!
    • create a symlink /srv/docker-apps to some data disk e.g. /srv/dev-disk-by-uuid-<long number>/docker-apps
      This is where the config data of each stack can be found. In all the next steps we use only the symlink to define the volumes inside the stacks / docker-compose.yml
      /srv/docker-spps/nextcloud will keep all config data of the nextcloud stack.
    • create a normal user using the UI for running the containers e.g. docker-user
      • Do not call it docker as this is a reserved user for the docker distribution itself
      • Do not make this user part of the docker group as this would give the docker-user too much privileges (access to the docker socket)
    • From the UI, uninstall portainer and docker and apply
    • Enter the new path to the docker root into the UI (it was /srv/docker-root) hit Save
    • Install docker and optionally portainer

    Make up your mind, if you want to use portainer stacks or docker-compose.yml files to configure and deploy containers. Portainer will provide a Web-UI for editing the configuration but hide the config files inside a named volume, docker-compose.yml requires you to edit textfiles, but files are stored in a readable format on the disk.


    Next step is to find a docker-compose.yml file for nextcloud and discuss it here and then set it up.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Sorry for the long delay in coming back! All of your answers were very helpful and I was able to solve the issue without too much trouble.

    I ended up going with Portainer as I didn't feel the need to maintain access to the config files inside the volume.


    Thank you all for the assistance!

  • macom

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!