45 Drives Knowledge Base
KB450114 - MacOS Samba Optimization
https://knowledgebase.45drives.com/kb/macos-samba-optimization/

KB450114 - MacOS Samba Optimization

Posted on November 19, 2018 by Rob MacQueen


MacOS Samba Optimization

Scope/Description:

This article will guide how to configure a samba share to optimize performance and compatibility with MacOS

The following performance tunes have been tested with MacOS Big Sur (11.2.3). Previous/Future versions will benefit as well but trial and error are recommended.

Steps:

Required steps:

These will always give benefit, they should always be configured.

  • Disabling SMB Signing on the MacOS clients
  • Using VFS_FRUIT in samba share

Additional Steps:

These may provide some benefit, but at the cost of possible functionality loss. Testing with end user workflow recommended.

  • Veto AppleDouble Files

 

SMB Signing

Since the release of OS X 10.11.5, Apple's SMB Signing has been enabled by default.

SMB Signing digitally signs at the packet level of the SMB communication. This enables the receiver of the packets to confirm the point of origin and it’s authenticity. This security mechanism helps avoid issues like tampering and “man in the middle” attacks - as long as you're on a secure network.  However, this causes poor performance -  to disable this option see below.

  1. On each Mac OSX client:
    • echo “” » /etc/nsmb.conf
    • echo “” » /etc/nsmb.conf
  2. Reboot client

To verify it worked run:

  • smbutil statshares -a
    • If “SIGNING_ON TRUE” is not present, then signing is disabled

VFS FRUIT

Use the vfs fruit object to enhance OS X performance. See vfs_fruit man page for reference.

Catia and Fruit in combination with streams_xattr significantly enhances performance/compatibility of samba network shares and OSX. This should always be used whenever the environment contains OSX clients. This is safe to use with mixed environment of windows and OSX clients.

  • Add to smb.conf definitions that will be used by macOS clients
vfs objects = catia fruit streams_xattr
fruit:encoding = native
fruit:metadata = stream
fruit:zero_file_id = yes

Additional Steps

Veto AppleDouble Files

Veto the creation of ._ and .DS_Store files on the network fileshare to increase directory performance.

NOTE that certain OSX applications require these files to function correctly.
Test workflow with these disabled to verify.

  • Add to smb.conf definitions that will be used by OSX clients
    • veto files = /._*/.DS_Store/
    • delete veto files = yes
  • Delete existing ._ and .DS_Store files on the share
    • cd /FILE/SHARE ; find \( -name “.DS_Store” -or -name “.Trashes” -or -name “._*” -or -name “.TemporaryItems” \) -delete
  • On each OSX client, disable the creation of .DS_Store and ._ on network shares
    • defaults write com.apple.desktopservices DSDontWriteNetworkStores true
KB450114 – MacOS Samba Optimization – 45 Drives Knowledge Base

KB450114 – MacOS Samba Optimization

Last modified: June 10, 2021
You are here:
Estimated reading time: 1 min

MacOS Samba Optimization

Scope/Description:

This article will guide how to configure a samba share to optimize performance and compatibility with MacOS

The following performance tunes have been tested with MacOS Big Sur (11.2.3). Previous/Future versions will benefit as well but trial and error are recommended.

Steps:

Required steps:

These will always give benefit, they should always be configured.

  • Disabling SMB Signing on the MacOS clients
  • Using VFS_FRUIT in samba share

Additional Steps:

These may provide some benefit, but at the cost of possible functionality loss. Testing with end user workflow recommended.

  • Veto AppleDouble Files

 

SMB Signing

Since the release of OS X 10.11.5, Apple’s SMB Signing has been enabled by default.

SMB Signing digitally signs at the packet level of the SMB communication. This enables the receiver of the packets to confirm the point of origin and it’s authenticity. This security mechanism helps avoid issues like tampering and “man in the middle” attacks – as long as you’re on a secure network.  However, this causes poor performance –  to disable this option see below.

  1. On each Mac OSX client:
    • echo “[default]” » /etc/nsmb.conf
    • echo “[default]” » /etc/nsmb.conf
  2. Reboot client

To verify it worked run:

  • smbutil statshares -a
    • If “SIGNING_ON TRUE” is not present, then signing is disabled

VFS FRUIT

Use the vfs fruit object to enhance OS X performance. See vfs_fruit man page for reference.

Catia and Fruit in combination with streams_xattr significantly enhances performance/compatibility of samba network shares and OSX. This should always be used whenever the environment contains OSX clients. This is safe to use with mixed environment of windows and OSX clients.

  • Add to smb.conf [SHARE] definitions that will be used by macOS clients
vfs objects = catia fruit streams_xattr
fruit:encoding = native
fruit:metadata = stream
fruit:zero_file_id = yes

Additional Steps

Veto AppleDouble Files

Veto the creation of ._ and .DS_Store files on the network fileshare to increase directory performance.

NOTE that certain OSX applications require these files to function correctly.
Test workflow with these disabled to verify.

  • Add to smb.conf [SHARE] definitions that will be used by OSX clients
    • veto files = /._*/.DS_Store/
    • delete veto files = yes
  • Delete existing ._ and .DS_Store files on the share
    • cd /FILE/SHARE ; find \( -name “.DS_Store” -or -name “.Trashes” -or -name “._*” -or -name “.TemporaryItems” \) -delete
  • On each OSX client, disable the creation of .DS_Store and ._ on network shares
    • defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Was this article helpful?
Dislike 0
Views: 3232
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access