Out of the box, my SMB performance on macOS 12.3.1 would top out at around 20MB/s in short ~5 second bursts, which was absolutely horrendous, slow to navigate in Finder and slugish to interact with.
Since making these changes, I now get sustained ~80-100MB/s+ and instant Finder navigation which is superb and how things should be out-of-the-box (OOTB)!
May 2023 update: As of Ventura, the SMB issues were just horribly inconsistent and hard to maintain. Something in the combination of Unraid, macOS and SMB just doesn't play nice. I ended up binning NFS/SMB all together and heading to a locally hosted Nextcloud instance for file syncing, then using SFTP/Ansible Git flow for editing files within appdata
.
- Apple - Disable local SMB directory enumeration caching
- Apple - Adjust SMB browsing behavior in macOS
- 45Drives - KB450114 – MacOS Samba Optimization
- Unraid Forum - Maxrad Post (the absolute legend)
- Prevent macOS writing
._DS_Store
files to SMB shares (Source #2), just enter the following into your mac's terminal:
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
- Configure macOS to disable directory caching (Source #1) and request signing/verification (Source #3), the following should be the contents of the existing
/etc/nsmb.conf
file if you have it, or create it if you don't (may require sudo):
[default]
dir_cache_max_cnt=0
signing_required=no
- After a reboot, run
$ smbutil statshares -a
in a terminal window in macOS whilst connected to your SMB shares. The commands output should NOT containSIGNING_ON TRUE
(Source #3).
-
On your Unraid box, login to the web GUI and stop your array.
-
Head to: Settings > SMB > SMB Extras > Samba Extra Configuration.
-
Paste the following into the text field (Source #4), making sure to edit "MY_SHARE" to be the name of your share and cloning that block for any more shares that you may have, in this case also renaming or removing "MY_OTHER_SHARE" to meet your needs.
#unassigned_devices_start
#Unassigned devices share includes
include = /tmp/unassigned.devices/smb-settings.conf
#unassigned_devices_end
[global]
vfs objects = catia fruit streams_xattr
fruit:nfs_aces = no
fruit:zero_file_id = yes
fruit:metadata = stream
fruit:encoding = native
spotlight backend = tracker
[MY_SHARE]
path = /mnt/user/MY_SHARE
veto files = /._*/.DS_Store/
delete veto files = yes
spotlight = yes
[MY_OTHER_SHARE]
path = /mnt/user/MY_OTHER_SHARE
veto files = /._*/.DS_Store/
delete veto files = yes
spotlight = yes
-
Hit Apply once done in which Unraid will then apply the SMB configuration.
-
Before starting the array again, run
$ testparm -s
in the Unraid web GUI terminal or via SSH'ing onto your Unraid box, this is to ensure that all is working and Samba has accepted the configuration. It should look something like the following, just with your share names instead of the example ones and should have no errors:
Load smb config files from /etc/samba/smb.conf
lpcfg_do_global_parameter: WARNING: The "null passwords" option is deprecated
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE
# Global parameters
[global]
disable netbios = Yes
disable spoolss = Yes
load printers = No
logging = syslog@0
map to guest = Bad User
multicast dns register = No
ntlm auth = ntlmv1-permitted
null passwords = Yes
passdb backend = smbpasswd
printcap name = /dev/null
security = USER
server min protocol = SMB2
server string = Network Attached Storage
show add printer wizard = No
unix extensions = No
fruit:zero_file_id = yes
fruit:nfs_aces = no
fruit:encoding = native
fruit:locking = none
fruit:metadata = stream
fruit:resource = file
fruit:aapl = yes
idmap config * : range = 3000-7999
idmap config * : backend = tdb
acl allow execute always = Yes
aio read size = 0
aio write size = 0
create mask = 0777
directory mask = 0777
hide dot files = No
include = /tmp/unassigned.devices/smb-settings.conf
invalid users = root
map archive = No
map readonly = yes
spotlight backend = tracker
use sendfile = Yes
vfs objects = catia fruit streams_xattr
wide links = Yes
[MY_SHARE]
delete veto files = Yes
path = /mnt/user/MY_SHARE
spotlight = Yes
veto files = /._*/.DS_Store/
[MY_OTHER_SHARE]
delete veto files = Yes
path = /mnt/user/MY_OTHER_SHARE
spotlight = Yes
veto files = /._*/.DS_Store/
-
Start the array and connect the macOS client to the SMB share and test that its working nicely, maybe do some test copies and check that the performance is what you expect.
-
Done!
Any ideas when it comes to macOS Ventura 13.3, combined with UnRAID 6.11.5? I haven't been able to get SMB shares to work well since UnRAID 6.10.x.