How to up Samba shares to be case sensitive and maintain Linux file permissions?

packoman

Cadet
Joined
Apr 23, 2022
Messages
6
I am currently testing FreeNAS on an HP Micorserver Gen 8 for personal usage. Setting up TrueNAS CORE was easy, but now I am struggling with the following and I believe it has to do with misconceptions/misunderstandings on my side.

I am a Linux user and until now I had my backups on an Ubuntu system to which I back up via `rsync`. I also use Samba shares on that machine for data that is only located on the Ubuntu backup server (i.e. not backed up from my Laptop).

In that usage file permissions remained unchanged when copying files to the server with either rsync or Samba (I mount the SMB shares with `mount -t cifs` or directly through Files from my Ubuntu laptop). So if I run `ls -al` on the server, it will show the same permissions as on my laptop.

Furthermore file- and folder-names are case-sensitive (because the server is a Linux machine).

I am now trying to set up a Samba share on TrueNAS and mounting it from my laptop to achieve similar behavior. And I ran into the following problems:

1. The files are not case-sensitive (which I want). I tried setting up multiple datasets with the `Case Sensitivity` set to `Sensitive`, but still it does not work. If I run `touch foo` and then do `touch FOO`, I end up having only `foo`. This is an example setting of my test datasets:

1650749445370.png


2. Linux file permissions are removed when copying files to the Samba share. I have tried using Linux and ACL based permissions for the dataset shared with Samba, but still this is the case. I have not been able to find a explanation on how to achieve this. I assume this must be possible?!

I am sorry, if I missed some obvious literature that I should have read. I would really appreciate, if someone could point me in the right direction and/or tell me that what I am trying to achieve is non-sense.

Thank you and best regards,
Michael
 

packoman

Cadet
Joined
Apr 23, 2022
Messages
6
I was able to solve the part regarding the case sensitivity following the instructions [here](https://www.truenas.com/community/threads/ongoing-battle-with-case-sensitive-dataset-smb-mount-from-osx.95515/post-660649) by adding the Samba parameters:
```
case sensitive=yes
preserve case=yes
short preserve case=yes
```
i.e.:
1650750785020.png
 
Top