SOLVED ongoing battle with case sensitive dataset & SMB mount from OSX

jim1atl

Cadet
Joined
Sep 23, 2021
Messages
4
I've worked with the solaris ifs implementation a number of years ago, this was the deciding factor in choosing trueness as my second was enclosure.
I've spent most of today tinkering with the setup of the NAS..

However I am experiencing issues with case sensitive datasets being dual shared with smb/afp with TrueNAS-12.0-U5.1

Creating a case sensitive dataset is no problem. ( have tried case-sensitive, mixed and case-insensitive options with dataset creation.
Sharing the dataset via SMB and mounting it from OSX 10.16 as an SMB share. No problem.

Creating case sensitive files names such as JIM.txt. Jim.txt and jim.txt etc results in assorted failures with case sensitivity being ignored. The share behaves as if case sensitivity is being IGNORED. Have tried 'case sensitive and mixed' when creating the dataset. Both options ignore case sensitivity when copying files to the share.

I am migrating from an aging ReadyNAS where I've had no issues with share/filesystem case sensitivity. Given that files on the old NAS are case sensitive, this behavior I am seeing will result in loss of data unless it can be resolved.

What am I doing wrong?

Illustrating from shell for ease of this posting:

bellerophon:zjimstuff Jima$ mount
//jima@10.0.1.2/public on /Volumes/public (afpfs, nodev, nosuid, mounted by Jima). #READYNAS
//jima@10.0.1.5/zjimstuff on /Volumes/zjimstuff (smbfs, nodev, nosuid, mounted by Jima). ## TRUENAS

bellerophon:zjimstuff Jima$
bellerophon:zjimstuff Jima$ ls -al
## assorted attempts to create case sensitive file names
## note the timestamp updates but the filename remains the same

total 32
drwx------ 1 Jima staff 16384 Sep 23 16:43 .
drwxr-xr-x@ 8 root wheel 256 Sep 23 16:20 ..
bellerophon:zjimstuff Jima$ touch jim.txt
bellerophon:zjimstuff Jima$ ls -l
total 1
-rwx------ 1 Jima staff 0 Sep 23 16:43 jim.txt
bellerophon:zjimstuff Jima$ touch JIM.TXT
bellerophon:zjimstuff Jima$ ls -l
total 1
-rwx------ 1 Jima staff 0 Sep 23 16:43 jim.txt
bellerophon:zjimstuff Jima$ touch Jim.TXT
bellerophon:zjimstuff Jima$ ls -l
total 1
-rwx------ 1 Jima staff 0 Sep 23 16:44 jim.txt

bellerophon:zjimstuff Jima$
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
You're confusing case sensitivity of the underlying file system with case sensitivity of the share definition. For the Window share definition, case insensitivity is the default, regardless of the file system. To enable case sensitivity for the share, you'll need to add this to the Auxiliary parameters field in the share definition:

Code:
case sensitive = yes


After making the change, restart the SMB service.
 

jim1atl

Cadet
Joined
Sep 23, 2021
Messages
4
Thank you for the ip with case sensitive = yes,

I added these additional options also:
preserve case = yes
short preserve case = yes


and also
SMB Service Options
—————————
x Enable Apple SMB2/3 Protocol Extensions

(and a complete reboot)

The share is now behaving the way I desire.. I suspect the Apple extensions (not set previously) improved filename behavior also.

Thank you for the speedy response
 

jim1atl

Cadet
Joined
Sep 23, 2021
Messages
4
sorry forgot,

smb share filenames are now reported case sensitive and on the dataset also show case sensitive, thus this appears to have eliminated
filename collisions:

dataset filenames:
root@truenas[/mnt/datapool1/jimstuff]# ls -li
total 2
2 -rwxrwxrwx+ 1 jima wheel 0 Sep 24 10:34 BigLongFilenameTest.txt
128 -rwxrwxrwx+ 1 jima wheel 0 Sep 24 10:35 BIGLongFilenameTest.txt
131 -rwxrwxrwx+ 1 jima wheel 44 Sep 24 10:37 BIGLONGFILENAMETEST.txt
root@truenas[/mnt/datapool1/jimstuff]#


finder filenames:
BigLongFilenameTest.txt
BIGLongFilenameTest.txt
BIGLONGFILENAMETEST.txt
root@truenas[/mnt/datapool1/jimstuff]#











SMB Share filenames from finder:
 

jim1atl

Cadet
Joined
Sep 23, 2021
Messages
4
Final update on this thread, I am posting my successful instructions for enforcing case sensitivity on SMB shared ifs datasets.

** SMB Eliminate case insensitive filename collisions **

(AKA case sensitive filenames are treated as unique like *nix systems)
(On windoze filenames: fred.txt = Fred.TXT = FRED.txt = fReD.tXT )
(On *nix systems, all filenames above are considered unique)
(These configuration instructions enforce the *nix behaviour)
(Use at your own risk!)

=============================== START ====================


Dataset Creation
---------------------------------------------
Dataset option (case-sensitive) when creating
Share type: *Generic*.
(!!Must use generic, if SMB chosen, case-sensitive option is locked out)

SMB Sharing configuration non-obvious switch settings
---------------------------------------------
Purpose: Multi-protocol (AFP/SMB) shares

List of SMB share Auxilary Options for case sensitivity
&
Auxiliary options with apple SMB2/3 Extensions

(First 8 — Apple SMB2/3 Extensions options - best OSX compatibility options for SMB)
(Last 3 SMB filename case options)

----------
fruit:locking=netatalk
fruit:metadata=netatalk
fruit:resource=file
streams_xattr:prefix=user.
streams_xattr:store_stream_type=no
oplocks=no
level2 oplocks=no
strict locking=auto

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


SMB Service Options (if not enabled)
---------------------------------------------

[x] Enable Apple SMB2/3 Protocol Extensions

(First group of options above are added to shares by this option, if not manually added prior)

---------------------------------------------
Restart SMB Service
---------------------------------------------

=============================== END ====================
 

JBK

Dabbler
Joined
Oct 30, 2021
Messages
46
You're confusing case sensitivity of the underlying file system with case sensitivity of the share definition. For the Window share definition, case insensitivity is the default, regardless of the file system. To enable case sensitivity for the share, you'll need to add this to the Auxiliary parameters field in the share definition:

Code:
case sensitive = yes


After making the change, restart the SMB service.
@Samuel Tai , I know this thread is about 6 months old but could you expand on what you say here?

If I create my dataset as generic and leave it case sensitive, then add an ACL and share it though a Windows share - are you saying that samba will handle the case sensitivity? i.e. ignore case?

Thank you
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
If I create my dataset as generic and leave it case sensitive, then add an ACL and share it though a Windows share - are you saying that samba will handle the case sensitivity? i.e. ignore case?

Samba by default ignores case, but tries to preserve case. So if you create a file Foo.txt, and then try to create foo.txt, it will complain the file already exists, even if the underlying file system is case sensitive, and would support creating foo.txt alongside Foo.txt.
 
  • Like
Reactions: JBK

JBK

Dabbler
Joined
Oct 30, 2021
Messages
46
Samba by default ignores case, but tries to preserve case. So if you create a file Foo.txt, and then try to create foo.txt, it will complain the file already exists, even if the underlying file system is case sensitive, and would support creating foo.txt alongside Foo.txt.
Thank you. Testing now.
 
Top