Zyxel NAS542 - copied files from old NAS are inaccessible (open from NAS share)

adrian3k Posts: 16  Freshman Member
edited September 2019 in Personal Cloud Storage
I have a Zyxel NAS 542 (4 bay) with 2 HDD, I've created a share folder, created a user with all access and copied old NAS files (320gb, over 400000 files) to this new share. Now I have a problem with opening files directly from NAS shared folder, when copied to local drive - all works fine. I've checked the permissions on files and folders (ssh, ls -alh) and it was okay (USER everyone rwx), created a NEW file on the same folder and checked again (ssh, ls -alh). The copied files were unable to open (cad files, project files, archives), the new file was fine.
Anyone have an idea what can be wrong?

Shares are done by drive mapping with user/password - I even used "chown USER -R *" on the copied files, still the problem exists...


Best Answers

  • adrian3k
    adrian3k Posts: 16  Freshman Member
    Accepted Answer
    tried one more option:
    chown-nobody -hR USER:everyone * from main share/ folder

    have no more idea's on my own :neutral:
  • Mijzelf
    Mijzelf Posts: 1,717  Guru Member
    Accepted Answer
    Ah sorry, missed that post. Well, after looking at the files, the most probable difference I can find is oplocks. That's a Windows way to lock files, to prevent multiple edit sessions at a time. I can imagine some editors just refuse to work if they can't get exclusive access

    In old file we have
    <div>[global]</div><div><br></div><div>oplocks = yes</div>
    in new file it's
    <div>[global]</div><div><br></div><div><div>kernel oplocks = no</div><div><br></div>level2 oplocks = no</div>
    (I'm very happy that smb.conf always have simple, not confusing options)
    So try to edit the latter to 'yes', and restart samba.
    <div>/etc/init.d/samba.sh restart<br></div>


All Replies

  • adrian3k
    adrian3k Posts: 16  Freshman Member
    Firmware V5.21(ABAG.2)
  • Mijzelf
    Mijzelf Posts: 1,717  Guru Member
    What happens if you copy a file to local, rename it and copy it back? Is it accessible? And if yes, what is the difference in
    ls -la old_file new_file

  • adrian3k
    adrian3k Posts: 16  Freshman Member
    -rwxrwxrwx    1 USER      everyone  538.5K Feb  6  2019 File.dwg
    -rwxrwxrwx    1 USER      everyone  538.5K Feb  6  2019 File test.dwg

    File is still not accessible directly form NAS...

    btw. using Total Commander to copy files (copy NTFS permissions is UNCHECKED)
  • Mijzelf
    Mijzelf Posts: 1,717  Guru Member
    File is still not accessible directly form NAS...

    Was you able to access the file when it was on the old share? Was that on the same NAS, and does it still exist? If yes, have a look in /etc/samba/smb.conf to see what the difference is between the shares.

  • adrian3k
    adrian3k Posts: 16  Freshman Member
    Old NAS was on FreeNAS (old version like 9.1 or smth).
    The old server is not formatted yet, but I wasn't the person that configured it.
    Will try to take a look into the file. On Zyxel i should ssh to the server and change values there and it would work or do I have to edit it thru webpanel?
  • Mijzelf
    Mijzelf Posts: 1,717  Guru Member
    Unfortunately editing the smb.conf isn't straight forward. The file is dynamically generated by the backend, and not all settings have a counterpart in the webinterface.
    Yet if you manage to find the difference, the samba manual can tell if it makes sense, and it is possible to edit smb.conf and restart samba until the next reboot or webinterface action.
    Depending on the exact difference it might be possible to inject it @boot time.
  • adrian3k
    adrian3k Posts: 16  Freshman Member
    Mijzelf I have managed to get to old server - there is no /etc/samba/smb.conf file
    It was configured on CIFS (i think, not sure)
    options: Local master was checked, account for guest: nobody
    dont see any other things that should matter...
  • adrian3k
    adrian3k Posts: 16  Freshman Member
    OLD NAS usr/local/etc/smb.conf
        path = /mnt/volume1/share
        printable = no
        veto files = /.snap/.windows/.zfs/
        writeable = yes
        browseable = yes
        inherit owner = no
        inherit permissions = yes
        vfs objects =  zfsacl
        guest ok = yes
        inherit acls = Yes
        map archive = No
        map readonly = no
        nfs4:mode = special
        nfs4:acedup = merge
        nfs4:chown = yes

    zyxel /etc/samba/smb.conf
            path = /i-data/12344321/share
            follow symlinks = yes
            strict allocate = yes
            allocation roundup size = 0
            aio write size = 4096
            comment = "share"
            browseable = yes
            valid users = "admin" "pc-guest" "xxx1" "XXX" "+everyone" "+XXX"
            guest ok = yes
  • adrian3k
    adrian3k Posts: 16  Freshman Member
    Removed some lines that were the same on both files (or irrelevant)

        dns proxy = no
        strict locking = no
        read raw = yes
        write raw = yes
        oplocks = yes
        max xmit = 65535
        deadtime = 15
        display charset = LOCALE
        max log size = 10
        syslog only = yes
        syslog = 1
        load printers = no
        printing = bsd
        printcap name = /dev/null
        disable spoolss = yes
        private dir = /var/etc/private
        getwd cache = yes
        guest account = nobody
        map to guest = Bad Password
        obey pam restrictions = Yes
        # NOTE: read smb.conf.
        directory name cache size = 0
        store dos attributes = yes
        hostname lookups = yes
        time server = yes
        create mask = 0666
        directory mask = 0777
        client ntlmv2 auth = yes
        dos charset = CP437
        unix charset = UTF-8
        log level = 1

            unix charset = UTF8
            dos charset = ASCII
            guest account = pc-guest
            encrypt passwords = yes
            map to guest = Bad User
            write ok = yes
            force create mode = 777
            force directory mode = 777
            auth methods = guest sam_ignoredomain
            max log size = 50
            host msdfs = yes
            lanman auth = yes
            kernel oplocks = no
            socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=2048000 SO_RCVBUF=2048000
            max xmit = 131072
            level2 oplocks = no
            max smbd processes = 128
            printing = cups
            printcap = /etc/printcap
            load printers = yes
            use sendfile = yes
            passdb backend = smbpasswd
            unix extensions = no
            wide links = yes
            veto files = /.grive*/.dropbox*/.THIS_IS_RECYCLE_BIN/.RBM/
            min receivefile size = 8192
            store dos attributes = yes