About mount a remote smb share for SyncThing

esingress

Cadet
Joined
Jun 18, 2021
Messages
3
Hi all,

I would like to mount a remote smb share in SyncThing (Jail), but it seems not work.

I have a remote smb share (Server01, 192.168.0.1) and a TrueNAS (Server02, 192.168.0.2)
And install a SyncThing in TrueNAS Jail (192.168.0.3)

Here what i done.

Since it cannot direct mount a smb in jails, so I make a directory in TrueNAS
- /mnt/Server01

Mount smb share (Server01) in TrueNAS, not in jails
- mount_smbfs -u 983 -g 983 -d 770 -f 770 -I 192.168.0.1 //user01@Server01/folder01 /mnt/Server01
which "983" is the UID and GID of syncthing.
and "user01" have full permission right to "folder01" and subfolder

and add a Mount point in Jails
- /mnt/Server01 to /mnt/iocage/jails/SyncThing/root/mnt/Server01

Restart SyncThing

Check the user right in SyncThing console, use ls -sl, it shows
-------
total 2
1 drwxrwx---+ 3 syncthing syncthing 3 Jun 15 15:29 TrueNASStorage
2 drwxrwx--- 1 syncthing syncthing 16384 Jun 17 15:18 Server01
-------

it seems same as the original folder right.

But Syncthing cannot sync the file to Server01, it said permission denied with "syncing: rename"
It can sync file to TrueNAS folder (i.e. TrueNASStorage).

And in console, as root@SyncThing, I can create file in /mnt/Server01, but cannot remove or rename the file.

And Hints? Thanks!
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hi all,

I would like to mount a remote smb share in SyncThing (Jail), but it seems not work.

I have a remote smb share (Server01, 192.168.0.1) and a TrueNAS (Server02, 192.168.0.2)
And install a SyncThing in TrueNAS Jail (192.168.0.3)

Here what i done.

Since it cannot direct mount a smb in jails, so I make a directory in TrueNAS
- /mnt/Server01

Mount smb share (Server01) in TrueNAS, not in jails
- mount_smbfs -u 983 -g 983 -d 770 -f 770 -I 192.168.0.1 //user01@Server01/folder01 /mnt/Server01
which "983" is the UID and GID of syncthing.
and "user01" have full permission right to "folder01" and subfolder

and add a Mount point in Jails
- /mnt/Server01 to /mnt/iocage/jails/SyncThing/root/mnt/Server01

Restart SyncThing

Check the user right in SyncThing console, use ls -sl, it shows
-------
total 2
1 drwxrwx---+ 3 syncthing syncthing 3 Jun 15 15:29 TrueNASStorage
2 drwxrwx--- 1 syncthing syncthing 16384 Jun 17 15:18 Server01
-------

it seems same as the original folder right.

But Syncthing cannot sync the file to Server01, it said permission denied with "syncing: rename"
It can sync file to TrueNAS folder (i.e. TrueNASStorage).

And in console, as root@SyncThing, I can create file in /mnt/Server01, but cannot remove or rename the file.

And Hints? Thanks!
What TrueNAS version? What is output of testparm -s?
 

esingress

Cadet
Joined
Jun 18, 2021
Messages
3
What TrueNAS version? What is output of testparm -s?

Thanks reply,

TrueNAS version: TrueNAS-12.0-U3.1

here is the output of testparm -s on TrueNAS (Server02, 192.168.0.2)

-------
Load smb config files from /usr/local/etc/smb4.conf
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
aio max threads = 2
bind interfaces only = Yes
disable spoolss = Yes
dns proxy = No
enable web service discovery = Yes
kernel change notify = No
load printers = No
logging = file
max log size = 5120
nsupdate command = /usr/local/bin/samba-nsupdate -g
registry shares = Yes
restrict anonymous = 2
server min protocol = NT1
server role = standalone server
server string = TrueNAS Server
workgroup = Test
idmap config *: range = 90000001-100000000
idmap config * : backend = tdb
directory name cache size = 0
dos filemode = Yes

[SyncThing]
ea support = No
kernel share modes = No
path = /mnt/Disk2/SyncThing
posix locking = No
read only = No
vfs objects = streams_xattr shadow_copy_zfs ixnas aio_fbsd
nfs4:chown = true

-------

The problem is I cannot get the permission right in Jails of remote smb share (Server01) not TrueNAS (Server02).

Let me explain more detail...

Server01 - 192.168.0.1
TrueNAS - 192.168.0.2
Syncthing (TrueNAS Jail) - 192.168.0.3

Server01 is a smb server not a TrueNAS server.

Mount smb share (Server01) in TrueNAS (Server02), not in jails
- mount_smbfs -u 983 -g 983 -d 770 -f 770 -I 192.168.0.1 //user01@Server01/folder01 /mnt/Server01

I try login TrueNAS (Server02) ssh with 'user01". (i.e. the user mount the remote smb server on Server01 & have the full permission right to "folder01" on Server01 and subfolder)
and test the mount point (i.e. /mnt/Server01),
I can 'touch', 'rm' and 'mv' the file.

But when I enter the console of Syncthing in TrueNAS (Server02) Jail, (root@Syncthi
I can 'touch' a file but cannot 'rm' and 'mv' the file.

And here is theoutput of iocage fstab -e Syncthing

-------
/mnt/Disk2/Syncthing /mnt/Disk1/iocage/jails/Syncthing/root/mnt/Syncthing nullfs rw 0 0
/mnt/Server01 /mnt/Disk1/iocage/jails/SyncThing/root/mnt/Server01 nullfs rw 0 0
-------

I set a password of 'syncthing' in TrueNAS (Server02) ,
And test the mount point outside the jails,
it also can 'touch', 'rm' and 'mv' the file.
 
Last edited:

esingress

Cadet
Joined
Jun 18, 2021
Messages
3
OK. Maybe I found the problem.

On the Server01 smb,
I add a line in smb.conf
share modes = no


I don't know It is the problem cause the Syncthing not work or it make the TrueNAS / Syncthing jail cannot mount the remote smb Server properly.
But at least, the problem seems to be solved now.

Thanks again.
 
Top