# Samba-4.4 doesn't show all files and folders



## mariourk (Sep 12, 2016)

I just upgraded to Samba-4.4 and I noticed a weird problem. I opened a folder in one of the shares, only to notice a bunch of files and folders are missing. I SSH-ed to the server and looked. And sure enough, all the files and folders are there. Nothing is missing. For some reason, Samba isn't showing all of them.

The weird thing is, if I copy this folder (on the server, with the `cp -a` command) the copy works fine. All the files and folders are shown. And the permissions are exacly the same.

Does someone know why this is and how to fix it?


----------



## mariourk (Sep 15, 2016)

Today I encountered a slightly different, but possibly related problem. I mounted a share in Mint (Mint-18.0 x64 Cinnamon) and it showed only one folder. I checked the same share with Windows-10 and it showed all files and folders.

Something is not right. But I can't figure out what.


----------



## mariourk (Sep 15, 2016)

One of our Macs had the same issue as I had with Mint-18.0. It turned out, it had tweaked settings, to enforce the use of SMB1, instead of SMB2 or SMB3. After removing the tweak, everything worked fine and all the files were shown.

I'm not sure what Cinnamon uses to mount SMB-shares. But my guess is, it's not SMB3.

So, for some reason, clients that use an older version of SMB seem to be unable to see all the files in a share. Does someone know why that is and how to fix it?


----------



## von_Gaden (Sep 22, 2016)

What was the version of your Samba before the upgrade?


----------



## mariourk (Sep 23, 2016)

I upgraded from Samba-3.6.25_3 to Samba-4.4.5_1

The upgrade itself was pretty straightforward


```
# portmaster -o net/samba44 samba36-3.6.25_3
# mv /usr/local/etc/smb.conf /usr/local/etc/smb4.conf
# mv /usr/local/etc/samba/* /var/db/samba4/private/
# service samba_server start
```

I found those steps here and they seem to have worked well. Well, except for the problems I'm experiencing with older clients.


----------



## von_Gaden (Sep 24, 2016)

That's a good way to upgrade, but both servers differ in configuration and in some parameters defaults. Is it a domain controller? If not I guess this might help in /usr/local/etc/smb4.conf:

```
server min protocol = NT1
```
I hope you haven't blocked IP port 139 which is used in NT - type connections.
One more thing: if your files are on ZFS volume you should use zfsacl vfs module.
AIO might be related to some file disappearing too.


----------



## mariourk (Sep 27, 2016)

Port 139 is open. And I am using the zfsacl module, like this:

```
vfs objects = zfsacl catia fruit streams_xattr
```

I concidered trying to set an older protocol on the server. But this feels like a cheap workaround, without addressing the real issue. Why are some files shown, while other aren't? As far as I can see, permissions aren't the issue. Maybe SMB3 uses some database or index, that needs to be properly (re)build?


----------

