Windows doesn't see pictures synced with syncthing (via SMB share)

Tenek

Explorer
Joined
Apr 14, 2014
Messages
97
Hi All,

I sync photos from my phone using syncthing into SMB share on my freenas (FreeNAS-11.2-U7). Syncthing is configured to use my SMB credentials (same as for my windows account). Some reason windows doesn't see sync-ed pictures, although they exists there. Total commander on the other hand sees them but displays them with exclamation mark (see first JPG in the list):
freenaspost1.png

The other JPGs are displayed just fine (they were not visible in windows explorer too before, but I created new folder and copied them using CP command from freenas console (with -irv flags) windows recognized them after that).
Folders setup with windows permissions, and looking on attributes I don't see any differences (the example problem file on is the last on the pic below), why new synced pics somehow not recognized by windows, any ideas?
freenaspost2.png


Thanks and Happy New Year everyone!
 

Tenek

Explorer
Joined
Apr 14, 2014
Messages
97
Folks, further investigation showed that files get synced with hidden and archive flags. In order to see them in windows explorer I needed to show hidden files and un-apply these flags, still digging more to understand why it happens...
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
Folks, further investigation showed that files get synced with hidden and archive flags. In order to see them in windows explorer I needed to show hidden files and un-apply these flags, still digging more to understand why it happens...
Did you turn off "store dos attributes" on the SMB share? When this is turned off those things may end up getting mapped to POSIX mode bits.
 

Tenek

Explorer
Joined
Apr 14, 2014
Messages
97
I don't remember changing that, I double checked Auxiliary Parameters for SMB share and it is empty. Also touched new file from syncthing Pod and new file got created without hidden flag (but with archive flag, wish I would care less). Maybe syncthing miss uses DOS attributes when creates new files...
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
I don't remember changing that, I double checked Auxiliary Parameters for SMB share and it is empty. Also touched new file from syncthing Pod and new file got created without hidden flag (but with archive flag, wish I would care less). Maybe syncthing miss uses DOS attributes when creates new files...
What is output of "testparm -s"?
 

Tenek

Explorer
Joined
Apr 14, 2014
Messages
97
Is it OK if I will install in on FreeNas shell?
I tried to install it but if failed tho:
Code:
root@freenas3:~ # pkg install testparam
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
Is it OK if I will install in on FreeNas shell?
I tried to install it but if failed tho:
Code:
root@freenas3:~ # pkg install testparam
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
No. You mis-spelled the application. It's already there "testparm".
 

Tenek

Explorer
Joined
Apr 14, 2014
Messages
97
Oh, I see (files in question located in users share, which is ZFS dataset in VolumeA pool).

Code:
root@freenas3:~ # testparm -s
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
Load smb config files from /usr/local/etc/smb4.conf
Processing section "[Media]"
Processing section "[SSD]"
Processing section "[VolumeA]"
Processing section "[users]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
        aio max threads = 2
        bind interfaces only = Yes
        deadtime = 15
        disable spoolss = Yes
        dns proxy = No
        dos charset = CP437
        hostname lookups = Yes
        interfaces = 127.0.0.1 192.168.1.250
        kernel change notify = No
        lm announce = Yes
        load printers = No
        logging = file
        max log size = 51200
        max open files = 7547573
        nsupdate command = /usr/local/bin/samba-nsupdate -g
        obey pam restrictions = Yes
        printcap name = /dev/null
        security = USER
        server min protocol = SMB2_02
        server role = standalone server
        server string = FreeNAS Server
        time server = Yes
        username map = /usr/local/etc/smbusers
        idmap config *: range = 90000001-100000000
        idmap config * : backend = tdb
        acl allow execute always = Yes
        create mask = 0666
        directory mask = 0777
        directory name cache size = 0
        dos filemode = Yes
        strict locking = No


[Media]
        aio write size = 0
        path = "/mnt/Media"
        read only = No
        veto files = /.snapshot/.windows/.mac/.zfs/
        vfs objects = zfs_space zfsacl streams_xattr
        zfsacl:acesort = dontcare
        nfs4:chown = true
        nfs4:acedup = merge
        nfs4:mode = special


[SSD]
        aio write size = 0
        path = "/mnt/SSD/windowset"
        read only = No
        veto files = /.snapshot/.windows/.mac/.zfs/
        vfs objects = zfs_space zfsacl streams_xattr
        zfsacl:acesort = dontcare
        nfs4:chown = true
        nfs4:acedup = merge
        nfs4:mode = special


[VolumeA]
        aio write size = 0
        path = "/mnt/VolumeA/windowset"
        read only = No
        veto files = /.snapshot/.windows/.mac/.zfs/
        vfs objects = zfs_space zfsacl streams_xattr
        zfsacl:acesort = dontcare
        nfs4:chown = true
        nfs4:acedup = merge
        nfs4:mode = special


[users]
        aio write size = 0
        path = "/mnt/VolumeA/users"
        read only = No
        veto files = /.snapshot/.windows/.mac/.zfs/
        vfs objects = zfs_space zfsacl streams_xattr
        zfsacl:acesort = dontcare
        nfs4:chown = true
        nfs4:acedup = merge
        nfs4:mode = special
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
How are you determining that DOS HIDDEN is set on the files? Can you try using smbclient locally on the FreeNAS server smbclient //127.0.0.1/users -U tenek%password

DOS modes should be visible in ls -l output inside smbclient.
 

Tenek

Explorer
Joined
Apr 14, 2014
Messages
97
I'm learning new tools with you ), smbclient shows these files with "AH" flag, for example there is one:
Code:
  20191230_192738.jpg                 N  2139559  Mon Jan  6 13:49:03 2020
  20200112_132428.jpg                 N  2015337  Sun Jan 12 16:01:16 2020
  20200114_170230.jpg                AH  2965043  Tue Jan 14 17:15:36 2020
  20191231_225744.jpg                 N  4716735  Mon Jan  6 14:17:08 2020


PS: Just in case, I'm using smb-flexvolume driver to access SMB share from Kubernetes.
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
The short answer is that those modes are getting set because one of your SMB clients is setting them. Your server is configured to store them in an xattr (user.DOSATTRIB), which isn't used by any other application. You can turn DOS modes into NOOP on your server by setting the share auxiliary parameters:
store dos attributes = no
map archive = no

Though that raises the issue that if your application / client is setting them, then they might need those for some reason.
 

Tenek

Explorer
Joined
Apr 14, 2014
Messages
97
Thank you for taking look into this! Just to confirm you think it happens on SMB client level i.e. smb-flexvolume introduces it, or it can happen on application level too, i.e. syncthing may introduce it too?
 

ukro

Dabbler
Joined
Mar 6, 2020
Messages
10
The short answer is that those modes are getting set because one of your SMB clients is setting them. Your server is configured to store them in an xattr (user.DOSATTRIB), which isn't used by any other application. You can turn DOS modes into NOOP on your server by setting the share auxiliary parameters:
store dos attributes = no
map archive = no

Though that raises the issue that if your application / client is setting them, then they might need those for some reason.

I just registered for the one purpose, to say thank you !!!!!!! thats worked for me. God bless you man. I was trying to setup resilio sync which didnt work and after that syncthing to backup my phone, but in Freenas with syncthing plugin it was a mess with the permission and i was not able to see data from my account on the sambashare. But finally in VM i was able to install syncthing and make it work. But the hidden and archive bits was tearing me appart. But with your help it is fixed !! one more time thank you !
 
Joined
May 2, 2017
Messages
5
I just installed syncthing on ubuntu 20.04 mapped to TrueNAS via CIFS/SMB and nothing worked for me except:
hide dot files = no
Just add it to "Auxiliary parameters" in the Advanced section of your SMB share.
 
Top