[12.2-RELEASE-p6] - SMB Shares Configuration Files Location

bhavik

Dabbler
Joined
May 20, 2021
Messages
15
Hi,

Where do the SMB share configuration files reside for 12.2-RELEASE-p6 (this release info is from /etc/os-release)? This is to inspect the share configuration parameters.

I found:
  1. /etc/local/smb4.conf
  2. /etc/local/smb4_share.conf
But these files don't have the config params/blocks that have the SMB share I have set up using the TrueNAS web UI. Any info on this will be very helpful.


Thanks,
Bhavik

________________________________________________
Version (from WebUI): TrueNAS-12.0-U3.1
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Hi,

Where do the SMB share configuration files reside for 12.2-RELEASE-p6 (this release info is from /etc/os-release)? This is to inspect the share configuration parameters.

I found:
  1. /etc/local/smb4.conf
  2. /etc/local/smb4_share.conf
But these files don't have the config params/blocks that have the SMB share I have set up using the TrueNAS web UI. Any info on this will be very helpful.


Thanks,
Bhavik

________________________________________________
Version (from WebUI): TrueNAS-12.0-U3.1
share config is stored in registry.tdb. testparm -s is best way to view full config.
 

bhavik

Dabbler
Joined
May 20, 2021
Messages
15
Thank you anodos for your notes and this is surely helpful. Also, I will go over the SMB Permissions Overview for deeper understanding/info on the topic.

However, FYI, I while running the testparam for the '.db' files I am getting very minimal to no info as pasted below.

Instead what I was looking for is the specific share definitions such as man page supported configuration parameters, if those can be hand edited and re-export (or restart) the SMB shares for further testing/validation on the features I am trying to achieve per another thread I posted.

testparam output for reference,
Code:
testparm -s /var/db/system/samba4/registry.tdb
Load smb config files from /var/db/system/samba4/registry.tdb
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
        idmap config * : backend = tdb

Code:
testparm -s /var/db/system/samba4/share_info.tdb
Load smb config files from /var/db/system/samba4/share_info.tdb
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
        idmap config * : backend = tdb
 

bhavik

Dabbler
Joined
May 20, 2021
Messages
15
Right, that has helped anodos, thank you very much. So the "testparm -s" without any args, worked as expected and it is showing the info I was looking for, in my case it is "[jobs]" and "[PermTest]" share blocks. Attaching testparm_s_output_20210528__1241.txt for reference.

Also, the "testparm -s" outputs the info, that reads, it is from /usr/local/etc/smb4.conf (smb4.conf_20210528__1242.txt) - However, while opening that config file the "[jobs]" and "[PermTest]" share blocks and params are missing. Had those blocks been available in the smb4.conf I was hoping to hand-edit the config file and add some directives, such as the below for [jobs] share and see if that's working as expected for both Windows (SMB/CIFS) and Linux (NFS) clients.

force directory mode = 2770
force create mode = 0770
directory mode = 770
create mode = 770


And wanted to test if what I am trying to achieve per this post works for [jobs] Multi-protocol (NFSv3/SMB) share.

Any thoughts/inputs on this and the other related topic will be very helpful.

NOTE:
  1. /mnt/Pool1/jobs - this is a direct folder shared with the purpose "Multi-protocol (NFSv3/SMB) shares" and this is accessible over NFS & SMB but the NFS permissions for newly created files and folders are being set to 755 instead of 770 - which is our goal to have it set/inherit from the permissions from the parent folder

  2. /mnt/Pool1/PermTest - this is a dataset created with "Share Type -> Generic" and subsequently, exported as both SMB (Purpose -> Default share parameters) and NFS shares individually.
    1. The PermTest SMB share seems to be working as expected and for newly created files/folders it seems to inherit 770 permissions. I believe this is due to the ACLs enabled.

    2. As for the PermTest NFS share it is failing to mount on the client Linux machine with the error, per this post.
Also, we have checked if the PermTest NFS export is of version 3 or 4, and it seems it is v3, despite that it is resulting in the mounting error at the (Linux) client end.

fpfs001 server NFS Export version info:
Code:
rpcinfo -p fpfs001 | grep nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs


So the expected resolution would be either of these options, per our understanding,
  1. Either we get the [jobs] multi-protocol NFS & SMB share working with required permissions inheritance

  2. Or, we get the [PermTest] NFS share mounting issue resolved, where we are seeing the permissions seem to be holding up when testing from Windows/SMB access.
Any thoughts / suggestions on this will be greatly appreciated.


Thanks,
 

Attachments

  • testparm_s_output_20210528__1241.txt
    1.4 KB · Views: 452
  • smb4.conf_20210528__1242.txt
    1.1 KB · Views: 442

lacugo

Cadet
Joined
May 31, 2022
Messages
1
I had problems blocking certain file extensions in the configuration, but by doing some testing I found that it is possible to change the settings file without losing the parameters entered when restarting the service directly from the command line.

Example:
nano /usr/local/etc/smb4.conf

[ti]
path = /mnt/compartilhamento/ti
writable = yes
browseable = yes
map acl inherit = yes
veto files = /*.exe/*.msi/*.bat/*.bin/*.mp3/*.wmv/*.wav/*.flv/*.sh/*.mp4/*.avi/*.rmvb/*.mkv/*.m4v/*.mov/*.mpg/*> veto oplock files = /*.docx/*.doc/*.odt/*.ppt/*.pptx/*.xls/*.xlsx
delete veto files = yes

service smbd restart

You run the risk of restarting the samba service through the GUI and losing manually entered settings. Therefore, be careful when performing service maintenance through the GUI before saving the configuration file.

I hope i helped in some way.
Thanks
 
Top