[NCP 1.47.2][Odroid HC4] Samba share for USB/SATA storage

Hi all,

I run an Odroid HC4 SBC with NextCloudPi 1.47.2 (Debian Bullseye). I activated samba in NCP settings and the share for the users works as expected.
I tried to setup an additional share for my attached backup storage (SATA drive) to have it available as network share on my desktop computer so I can create backups of my backup ;-). I cloned the section that was attached by NCP to /etc/samba/smb.conf and only changed the “path” key to point to my backup drive (/media/Nextcloud_Backup in this case). But I can’t connect to the share.
Do I need to setup a new samba user for that? Anything else I need to change?

Here is the section NextcloudPi generates for the NC-User “Andy” in smb.conf:

# NextCloudPi automatically generated from here. Do not remove this comment

[ncp-Andy]
    path = /media/Nextcloud_Data/Data/Andy/files
    writeable = yes
;       browseable = yes
    valid users = Andy
    force user = www-data
    force group = www-data
    create mask = 0770
    directory mask = 0771
    force create mode = 0660
    force directory mode = 0770

My backup-folder is at “/media/Nextcloud_Backup” and is owned by the user “odroid”. Just changing the path and “force user = odroid” didn’t work.

Thanks!

Not sure if creating a new user is required, possibly safer to create one, so I probably would.
I think once the user/share is created in NC, turning off and (back) on SMB from ncp-config or ncp-web should enable the new share.

Hi Oliver,

I just updated my post, perhaps you can have a look at the smb.conf section there.
I will try to add a new user and test.

You need to run “sudo systemctl reload smbd.service” to make manual edits work.

smb.conf has very extensive options and documentation, if you want or need to: run “man samba”
I let the smb script created for ncp users do all the work :wink:

Where can I find this script you are talking about?

NCP users can access it thru ncp-config or ncp-web via >NETWORKING>SAMBA

The script can be viewed on github or on your NCP system @ /usr/local/bin/ncp/NETWORKING/samba.sh

So I created a new samba user to connect the share. The main problem was the “force user” key in the section for my share. The target path was owned by another user than I was trying to use. I changed it and it works now.

Thanks.