Can I use an SMB mounted location for UserData

On my Raspberry, I have an permanent mount volume mounted on a synology nas using the SMB protocol. Is it possible toe set data data directory to that volume :
So ‘datadirectory’ => ‘/mnt/samba/nextcloud_data’,

As for now I was not able to use that volume. I’m I doing something wrong here ?

You might be able to, but I’d strongly advise against it. Set up SMB external storage instead.

@musicscore
It may be possible to use SMB as primary storage. But then you can not modify files from your old SMB-clients anymore. You can but Nextcloud can not see it. You must every time use occ rescan that Nextcloud knows it.

Basically SMB and Cloud are completely different things. Have a look at the Nextcloud clients, e.g. for Windows. This is the “SMB-feature” in the Cloud environment. And it is no more SMB than the Microsoft Drive application in Windows. Who wants SMB should keep SMB.

That is the best solution. SMB is SMB and also you can access it with Nextcloud. Normal data is managed from your Nextcloud and you decide how much data is managed from Nextcloud and how much data is managed from SMB.

It’s possible but as @devnull said it’s not a good solution for already existing files, which you also want to access in other ways. If you just doing it because you don’t have enough space on your Raspberry Pis SD-CARD, which is indeed not a good fit for your primary storage, there would probably still be better solutions. In that case I would probably prefer NFS over SMB.

You could even go further and present an iSCSI volume to the PI. And if you want to go really fancy you could even use that iSCSI Volume as the primary storage for your Pi and boot via Network from it. https://shawnwilsher.com/2020/05/network-booting-a-raspberry-pi-4-with-an-iscsi-root-via-freenas/ This would take the rather unreliable and slow SD card completely out of the equation.

Personally, though, I would recommand connecting a big enough SSD via USB to the PI and use that as the primary storage for the OS, the Nextcloud installation and the data. Local Storage is always gonna be faster and more reliable than a network share, unless you have a 10G or 40G network, which is of course not possible with a Pi. You could then still use your NAS as a backup target. This would also have the advantage that the data will be stored on two separate physical devices, because we all know that RAID is not a backup. :wink:

Thanks for the reply.
I will connect a USB SDD to my raspberry and use that drive as the primairy storage.

2 Likes

Good decission. :slight_smile:

And if you have additional data on your NAS e.g a Photo collection which you want to make available through your Nextcloud, either temporararly or permanent, you can still do that afterwards by using the External Storage app, like you would add a network share to your desktop PC. You can also add those shares in Read Only mode, so that no one can accidentally delete something.