ZFS, ls -la local output vs SMB share

I’m trying to identify files in a remote directory that are / are not hardlinked to at least one other location. Between running ls -la locally and remotely (through an SMB share mounted in a remote system), the number of reported links to a file are different. Base filesystem is ZFS on Truenas Core.

ls -la run locally:

-rwxrwxrwx+ 2 1001 awells 123456 Jun 22 20:05 'myfile.ogg'

ls -la run remotely through SMB share:

-rwxr-xr-x 1 wizard docker 123456 Jun 22 22:05 'myfile.ogg'

I’m able to read and write to the directory just fine (both at the original file locations and where any hardlinks would be present) , but the wizard user has a UID of 1000 vs the 1001 reported locally. Could that be causing the difference in reported links somehow?

Is this a limitation of SMB maybe?

The view of UIDs, GIDs, ACLs and stuff like that (security attrs) on a client depends on used mount options.

The number of hardlinks… maybe it can be pushed to the client with “unix extensions” of samba, but I’m not sure - never needed it.

2 Likes

Looks like it’s a Samba limitation after all. The surprising part to me is I have created hardlinks within the same SMB share on a windows machine plenty of times, but I guess creating the links and being able to tell that a file has been hardlinked don’t necessarily go hand in hand.

I wonder if NFS has any different capabilities here.

1 Like

Interesting, I was not aware that samba supports NTFS hardlinks.
Some years ago I tried to use “Link Shell Extension” on samba share mounted on win10 and it did not work. Good to hear it works now.

1 Like

the ZFS/kernelbased SMB server in Solaris or OmniOS/OpenIndiana have a better SMB implementation than SAMBA, at least in terms of ACLs and windows compatibility, but I don’t know if this applies specifically to your case.

If you’d like to try it out, I recommend napp-it

1 Like

Looks like that project has been around since 2009, so the style of the website makes sense in that context. But without any context I would say that website is a virus lol

Until right now I would have said that SMB was an abbreviation for samba. Don’t tell anyone.

Napp-it looks pretty interesting, and considering how much of my server use is just sharing files with SMB, seems worth understanding.

Link Shell extension is what I use as well, it’s fantastic.

Looks like NFS doesn’t suffer the same limitation. I love easy solutions.

I used it from 2012 to about 2015, solaris 11.1-11.3, back then because of fc target support (ComStar), it worked well.