Nextcloud and SMB Share doesn't work together

Hello, I will first explain the system.

The system runs as a VM on a Windows hypervisor (Windows 10 Pro with Hyper-V).
Nextcloud was installed as a snap package.
Nextcloud’s data directory has been changed to “/mnt/Storage” as this is where the RAID is mounted.

5x 4TB HDD
ZFS file system
RAIDZ (equivalent to RAID5)
OS: Ubuntu 18.04.4

I also installed a Samba server. I created a share for a Nextcloud user’s file path.

Users and rights:

  1. root
    (runs Nextcloud and the Samba server)
  2. administrator

I would like to set it up so that, for example, I add a user to the “Family Photos” group and they then have access to the “Family Photos” folder. It works via Nextcloud, but I want to set up the Samba server in the same way (I’ll get that done).

However, I have the problem that if Nextcloud is the owner of the “/mnt/Storage” folder, the SMB share will no longer work because Nextcloud will overwrite the rights again and again.
I then made the “Administrator” user the owner of the folder. After that I got the following error message from Nextcloud:
Nextcloud
ENG:

error
Your data directory can be read by other users

Please change the permissions to 0770 so that the directory cannot be viewed by other users.

The bigger problem, however, is that when I copy files to the user directory via the Samba share, they do not appear on the Nextcloud-Web-Interface. How can I solve this?

Thanks in advance.

Use: occ files:scan to show the files and change the files to something like www-data:www-data

And welcome to the forum!

It is absolutely not a good idea to share nextclouds user file path via samba.
Any changes on the share made from the users will not be detected by nextcloud.
You better mount the smb share using external storage app.

Ich schreib einfach mal auf deutsch.

Du meinst ich installiere Nextcloud nochmal von vorne auf dem Boot Drive sozusagen und binde dann den RAID als External Storage ein? Dann habe ich aber ein anderes Problem. Kann ich es denn so einstellen, das NUR der Externe Speicher benutzt wird?

Hallo, ich wollte Dir nur sagen, dass es absolut keine gute Idee ist, dass andere Programme (hier Samba) in das “data”-Verzeichnis von Nextcloud eingreifen.

Alle Zugriffe sollten über die webdav-Schnittstelle erfolgen, somit ist die Datenbank immer aktuell. Es gibt die von mir genannte “External Storage” app zum Einbinden von Samba-Freigaben.

Hoffe das hilft zum Verständnis.

Das habe ich bereits verstanden, mir ging es nur um die weiteren Schritte.
Ich nehme an ich installiere Nextcloud jetzt von vorne, installiere die External Storage App und wähle da den RAID aus. Dann kann ich noch eine SMB Freigabe für den RAID einrichten. Tauchen die Dateien dann in Nextcloud auf?

Die Reihenfolge verstehe ich nicht ganz, bin aber auch kein ITler und habe wenig mit RAID zu tun.

Ja, wenn Dateien auf einem Share geändert werden und dieses via External-Storage eingebunden ist, so tauchen die Dateien/Ordner dann in der NC auf.