SMB Client on macOS
Settings for the macOS smb client
- Create the file
/etc/nsmb.conffile with the following content
[default]
streams=yes
notify_off=yes
soft=yes
port445=no_netbios
protocol_vers_map=6
mc_on=yes
mc_prefer_wired=yes
dir_cache_max_cnt=0
- In a terminal, execute
sudo defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE. This disables the creation of .DS_Store files on network shares - Restart the machine
- Reconnect all smb shares afterwards.
Details of the /etc/nsmb.conf settings
| Setting | Value | Description |
|---|---|---|
streams |
yes |
Enables support for NTFS alternate data streams, allowing macOS to read and write metadata and resource forks on SMB shares that support this feature [^1]. |
notify_off |
yes |
Disables file and directory change notifications from the server, which can reduce network traffic and prevent unnecessary refreshes in Finder [^4]. |
soft |
yes |
Configures soft mounts, meaning that if the server becomes unresponsive, operations will fail quickly instead of hanging indefinitely, improving user experience during network issues [^1]. |
port445 |
no_netbios |
Specifies that connections should use direct TCP on port 445 without falling back to NetBIOS over port 139, streamlining the connection process [^2]. |
protocol_vers_map |
6 |
Sets the SMB protocol version compatibility bitmap; 6 to force SMB 2 or 3 only [^3]. |
mc_on |
yes |
Enables SMB Multichannel, allowing multiple connections between client and server to increase transfer speeds and provide redundancy [^7]. |
mc_prefer_wired |
yes |
When SMB Multichannel is enabled, this setting prioritizes wired network interfaces over Wi-Fi for better performance and stability [^5]. |
dir_cache_max_cnt |
0 |
Disables local caching of directory listings, ensuring that you always see the most current files and folders on an SMB share [^6]. |
After modifying /etc/nsmb.conf, disconnect and reconnect any mounted SMB shares for the changes to take effect [^8].
[^1]: MacOS und SMB nerven | Das deutsche Synology Support Forum
[^2]: nsmb.conf(5) man page
[^3]: How to disable SMB 1 or NetBIOS in macOS
[^4]: DSM 7.2 - Dateien erscheinen nach dem Löschen wieder und lassen...
[^5]: Das Verhalten von SMB Multichannel konfigurieren - Apple Support (LI)
[^6]: Disable local SMB directory enumeration caching
[^7]: Configure SMB Multichannel behavior
[^8]: Apple macOS smbx and /etc/nsmb.conf information - GitHub
No comments to display
No comments to display