Samba Share - Please add Case Sensitivity Settings or allow Additional Parameters String for users to edit

Problem/Justification

Samba Shares cannot serve files with the current config, which only differ in file name case, only one file shows up then. Also the creation of the files does not work. They are case insensitive, event if the zfs datasets are case sensitive. If the following file are present in the truenas zfs filesystem

  • textfile.txt
  • Textfile.txt

Only Textfile.txt shown.

Impact
Users can finally access all their files and create files, that simply differ in case.
This is the default in *nix environments.

Windows clients need to be aware of the downsides / informed about the impact of this setting, as Windows is case insensitive by default

User Story
Simply set a checkbox in the share edit menu, with the appropriate help text.
I would propose the section: ‘Other Options‘

Alternatively enable `Additional Parameters String` and make it user editable, that one can set it themselves.

After setting the checkbox, samba service is reloaded and the user can create multiple files with the same name, just with different case:

  • textfile.txt
  • Textfile.txt

The checkbox should toggle:

case sensitive=yes  
preserve case=yes  
short preserve case=yes

for the share

Case sensitivity can be set on the dataset properties

Yes and they are set on my datasets.
Clients still cannot create files/folder that simply differ in case.

Case sensitive depends on how client negotiates connection / file open. This stuff should work without hacks if you have dataset and clients configured correctly.

Please define “correctly”…
In this case, I suppose it involve treating Windows clients as dumb and set a case INsensitive dataset for SMB sharing. But when there already are case sensitive files in the share, what’s the clean way out (no data loss, no ambiguity for insensitive clients)?

I wouldn’t call it a hack, it’s an official config setting.

It helps me to enforce a case sensitive share, even to windows clients, as windows explorer even partially supports case sensitivity. When accessing those shares via WSL, proper case handling is supported Microsoft Docs.

In case there exist client mount/access options to have this working correctly in linux, with case support, I’m happy to set those options.

My current mount entries look like this, to enforce transport encryption:

//truenas/share /mount-point cifs vers=3.0,seal,iocharset=utf8,rw,credentials=/etc/samba/private/nas.credentials,uid=1000,gid=1000,file_mode=0660,dir_mode=0770,x-systemd.device-timeout=10 0 0

Just a personal observation, I have seen this recommended in several places as part of performance optimizations for directory listing performance.

e.g. the Samba Wiki.

Just FYI we had something similar in earlier versions of TrueNAS but had to roll back because breaks certain types of workflows / clients. I reintroduced optimizations for case insensitive datasets in 25.10, but those specific case sensitivity hacks are unsupported. I have not validated how they interplay with our internal VFS changes and probably will not do so because ENOTIME / juice not worth the squeeze.