What is the official way of modifying auxsmbconf field of smb share now?

Auxiliary Parameters field has been remove from SMB share of WebUI since 23.10.

That left iX cli shell and mdiclt command as the only ways to access auxsmbconf field of smb share.

iX cli shell was not recommended from 24.04 and name space was removed from the document.

The whole section of iX cli shell was removed on 24.10 document.

What is the official way to modify auxsmbconf field now?

There’s no official way. There were too many problems with ppl borking their smb with aux parameters.

Without auxiliary parameters customization, TrueNAS is not even a viable solution for many if not most NAS usages.

1 Like

Here’s a satirical take on it.

Here’s me being serious about it.

2 Likes

It is ironic that even a consumer oriented NAS product, the Apple of NAS, provides more user accessibility options than iX does.

The following solution still works from the CLI: https://www.truenas.com/community/threads/auxiliary-parameters-missed.113938/page-3

Thanks for your reply.

Yes, I learnt cli shell and mdiclt from that forums.

However, the document has been removed now. How do I know which parameters are available now? Especially for mdiclt command.

Great question, maybe someone from the TrueNAS team can chime in?

The document is still available at its URL or via the forum archive - “Browse Forum Archive” on the masthead.

I mean the official document was removed.
The SMB section in Scale 23.10 - CLI Reference Guide 8.3 - Sharing was simply a place holder but it has mentioned that

The SCALE CLI guide is a work in progress! New namespace and command documentation is continually added and maintained, so check back here often to see what is new!

However, the whole SCALE 24.04 CLI Reference was rewritten. Details were removed and it left the following warning

The experimental TrueNAS CLI is not recommended for general use and is not receiving further updates in 24.04. As such, the CLI Reference Guide for 24.04 is deprecated and removed.

Please continue to refer to web interface Tutorials for guidance. Thank you!

Additionally, you have to be aware, that auxilliary parameters are not displayed in the configuration GUI. So if several administrators work with a NAS, one might not even realise, that one smb configuration is changed through the cli…

For anyone who wants/needs to set somethin in smbauxconf like e.g.

veto files

# What to we wanna set
AUXSMBCONF='veto files = /._Thumbs.db/Thumbs.db/Temporary Items/.DS_Store/.AppleDB/.TemporaryItems/.AppleDouble/.bin/.AppleDesktop/Network Trash Folder/.Spotlight/.Trashes/.fseventd/'
# create dict
DICT="$(jq --null-input --arg auxsmbconf "$AUXSMBCONF" '{"auxsmbconf": $auxsmbconf}')"
# BULKRUN ( remove the echo to really run it )
midclt call sharing.smb.query |  jq -r ' .[] | .id ' | 
  while read -r ID ; do 
     echo midclt call sharing.smb.update "$ID" "$DICT" ;
done

For values with newlines just add \n wherever needed in the string.

Is it me, or auxsmbconf isn’t preserved in cli edit anymore?

I get error in 25.10.0.1:

# midclt call sharing.smb.update 13 "$DICT"
[EINVAL] data.auxsmbconf: Extra inputs are not permitted

There were quite a lot of changes in the api. I currently don’t have any 25.10* (test) system here but only a 26.04* but it seems this is still the same.

25.04 OLD

# midclt callsharing.smb.query | jq
...
  {
    "id": 13,
    "purpose": "DEFAULT_SHARE",
    "path": "/mnt/p0-25-8z2/....Scan",
    "path_suffix": "",
    "home": false,
    "name": "Scan",
    "comment": "",
    "ro": false,
    "browsable": true,
    "recyclebin": false,
    "guestok": false,
    "hostsallow": [],
    "hostsdeny": [],
    "auxsmbconf": "shadow:snapdir = .zfs/snapshot\nshadow:sort = desc\nshadow:format = auto-%Y-%m-%d_%H-%M-1D-6W\nshadow:localtime = no\n",
    "aapl_name_mangling": false,
    "abe": false,
    "acl": true,
    "durablehandle": true,
    "streams": true,
    "timemachine": false,
    "timemachine_quota": 0,
    "vuid": "",
    "shadowcopy": true,
    "fsrvp": false,
    "enabled": true,
    "afp": false,
    "audit": {
      "enable": false,
      "watch_list": [],
      "ignore_list": []
    },
    "path_local": "/mnt/p0-25-8z2/.../Scan",
    "locked": false
  },

25.10 / 26.04

root@truenas ~ # midclt call sharing.smb.query | jq
[
  {
    "id": 1,
    "purpose": "LEGACY_SHARE",
    "name": "home",
    "path": "/mnt/virt/home",
    "enabled": true,
    "comment": "",
    "readonly": false,
    "browsable": true,
    "access_based_share_enumeration": false,
    "locked": false,
    "audit": {
      "enable": true,
      "watch_list": [
        "grp_user"
      ],
      "ignore_list": []
    },
    "options": {
      "recyclebin": false,
      "path_suffix": null,
      "hostsallow": [],
      "hostsdeny": [],
      "guestok": false,
      "streams": true,
      "durablehandle": true,
      "shadowcopy": true,
      "fsrvp": false,
      "home": true,
      "acl": true,
      "afp": false,
      "timemachine": false,
      "timemachine_quota": 0,
      "aapl_name_mangling": false,
      "vuid": "dd313232-465b-4231-b72c-2462198a28cf",
      "auxsmbconf": ""
    }
  },
  {
    "id": 2,
    "purpose": "DEFAULT_SHARE",
    "name": "acl1",
    "path": "/mnt/virt/acl1",
    "enabled": true,
    "comment": "",
    "readonly": false,
    "browsable": true,
    "access_based_share_enumeration": false,
    "locked": false,
    "audit": {
      "enable": false,
      "watch_list": [],
      "ignore_list": []
    },
    "options": {
      "aapl_name_mangling": false
    }
  }
]

As you might already see the “auxparams” are only listed with Leagacy Shares and they are now in an sub array (e.g. .options.auxsmbconf )

Now this will be a bit more hassle as we need a PURPOSE for the SHARE (Click on "Call Parameters → Purpose)

API 26 and maybe 25 version

# What to we wanna set
AUXSMBCONF='veto files = /._Thumbs.db/Thumbs.db/Temporary Items/.DS_Store/.AppleDB/.TemporaryItems/.AppleDouble/.bin/.AppleDesktop/Network Trash Folder/.Spotlight/.Trashes/.fseventd/'
# create dict - we need a "PURPOSE"
DICT="$(jq --null-input --arg auxsmbconf "$AUXSMBCONF" '
     {"purpose": "LEGACY_SHARE", "options": {"auxsmbconf": $auxsmbconf}}')" 
# BULKRUN ( remove the echo to really run it )
# NONSENSE
#midclt call sharing.smb.query | 
#   jq ' .[] |  
#        select ( .options | to_entries | 
#              select ( .[].key == "auxsmbconf" ) ) | .id ' | while read -r ID; do
#   echo midclt call sharing.smb.update "$ID" "$DICT"; 
#done
# Easier bulkrun
midclt call sharing.smb.query |
    jq ' .[] | select ( .purpose == "LEGACY_SHARE" ) | .id ' | while read -r ID; do
      echo midclt call sharing.smb.update "$ID" "$DICT"; 
done

This would do the same as above for any legacy share. or at least one where i could find the key auxparams as i just looked for that instead of checking if “purpose” is already “LEAGACY_SHARE” (which would have been way easier now that i even looked in the documentation :slight_smile: )

It turns out that only LEGACY_SHARES do support the auxparams so we should just use the shorter variant. I left the long one in just to show how it could be done.

API sharing.smb.update

And you can even see a better description about it when you open that and click on

  • Call Parameters → Parameter 2: data → options - One of → Legacy opt

where you can see the different schemas/purposes.

:see_no_evil_monkey: :speak_no_evil_monkey: :hear_no_evil_monkey:

1 Like

Thank you for the detailed answer, I think I need to try to grok it in the morning :slight_smile:

Not sure what is legacy shares, but one of my shares where I added `auxsmbconf: inherit owner = yes` 6 months ago, and it was working, and now (after update) it’s gone.

But I’ll read up and experiment in the following days, or will wait till 26 is more mainstream.

Thank you.

you don’t have to. The 25.10 api is the same as 26.04 or at least it is the same in this context.