Iâve setup a nexlcoud server under ubuntu 20.04 on an old computer. My main use is to access my files from everywhere and sync some folder (eg on my phone). I donât want to sync all automaticaly all my folders but i wanât to sync them manually with a chek of modifications on each sides with syncback.
I wanted to access my nextcloud folder (located in my home) with samba server i installed but it is impossible since the owner is www-data. I can access the folder only with nautilus.
I have tried to mount my nextcloud as an external drive but it is very slow even in LAN especially with littles files. Is there a way change permissions in order to access my nexcloud data folders from windows using samba server ? Can I put add data a standard samba user into the group www-data ?I am afraid of damaging the nextcloud configuration
If Iâve got your idea right, you want to share your Nextcloud data directory using a Samba server. Or, in other words, use âSamba on the top of Nextcloudâ option.
Donât you think âSamba side by side with Nextcloudâ option is more suitable for you?
Iâm not very fluent in English so itâs a bit difficult to explain in english
I have set my nextcloud data folder is under my home directory. I need to enter my password to browse in wit nautilus because the owner is www-data
I have already samba installed and can access to my home folder but not the nextcloud folder.
I wanted to use syncback to backup some folder time to time in nextcloud directory with a check of differences. After i can run /occ files:scan --all to update nextcloud database . I donât want to synck these folder with the nexcloud client.
I donât kno why but when i access no nextcloud through netdav (eg with netdrive) it i very slow, slower than with the web interface.
Nextcloud uses a SQL database for some functions related to file operations. Using Samba means your Nextcloud may be out of sync and may break things. (even with the filescan).
I would advise against this. Either use Samba OR Nextcloud.
@jhjacobs81 I agree, that it doesnât make sense to share the Nextcloud data folder via SMB, for various reasons, and I also advise against it. However you absolutely can copy files directly to the Data Folder, if you get the permissions right and perform an occ files-scan afterwards.
@corias To be clear, the method I posted should only be used for occasional large file uploads, not to actually âworkâ with the files in the Data Folder on a daily basis. Use the Nextcloud Desktop Client or WebDAV for daily usage. If that doesnât fit your needs for a specifc usecase, @jhjacobs81 is right, and you probably should use SAMBA instead of Nextcloud for these files.
Depending on the use case you could also mount a folder outside of your Nextcloud Data Folder and connect it to Nextcloud via external storage app. That way you donât need to execute occ files:scan, but you still need to get permissions and file ownerships right, otherwise you will likely run into issues further down the roadâŚ
Or you could use a separate NAS, create a SAMBA share on that, and then add it to Nextcloud via External Storage App and also mount it on your PC as a network drive. But honestly, I would avoid that too, if not absolutely necessary.
In theory you could also share a folder from your PC via SAMBA and then add it to your Nextcloud via External Storage App directly⌠Seriously! Donât do that!
The best way would be to address the performance issues of WebDAV, and then use that exclusively.
Thanks for all the replies. I will avoid access my NC datafolder through samba. I just donât want to sync automatically all my datas with th NC client.
I find the possibility of loosing data in my source too risky when many files are sync. Thatâs why I use syncback ton compare changes on both sides (source/destination).
Mounting nexcloud as a network drive using WebDAV will be enough but it took me more than 1 hour to transfer 150MBâŚtransferring big files are ok but many small file is too slow and is much more speed through samba
You can use WebDAV you posted below. Also you can use Virtual files
This is exactly where you have a thinking error. Nextcloud is not a backup and does not want to be a backup. You should better think about a backup concept than restricting the functions of Nextcloud.
Why do you not use normal Nextcloud functions e.g. Nextcloud clients? And maybe you use Nextcloud for the wrong thing. Hopefully the 150 MB with small files are not client files you want to backup to a backup server. Nextcloud is not a backup solution. But Samba is also no backup software.
Finally i moved the files under my nc data folder and run âsudo -u www-data php /path/to/nextcloud/occ files:scan --allââŚ
I get an error msg and the PC freezeâŚ
Know when I try to open a photo through nc web I get a blank picture with âError loadingâŚjpgâ
It seems the database is corrupt ?
Yea this is easy and no problem if you layer it all correctly.
Assume, samba server, and nextcloud are same server, where the data resides. Just use default nextcloud data folder during nextcloud installation.
Then create your user data structure on the linux file system, just normal linux folders:
/opt/userfolders/Bob
Login to nextcloud as an administrator, create user âBobâ
Install âexternal storageâ app.
Configure a new external storage for Bob in nextcloud settings:
Choose âlocalâ as the backend
Set folder to /
Set configuration to: /opt/userfolders/Bob
Give access to: choose âBobâ from the list
Now you can configure samba to create a smb share âbobdataâ or whatever to share /opt/userfolders/Bob
So the same physical linux folder is now shared via smb, and accessible via nextcloud user bob.
No occ-scan stuff needed since weâre using the external storage mechanism instead of the actual âdataâ directory that has those restrictions.
Just watch out for file versioning. Versioned files go into the nextcloud data dir, not the user dir.
And permissions will need to be set appropriately for bob/samba/www-data on the physical folder for all the users and services to be able to read write on /opt/userfolders/Bob