HugoMAC on Krausmueller.de2024-01-31T18:31:42+01:00https://www.krausmueller.de/en/tags/mac/Transfer rate when accessing Samba share from Mac OS Xhttps://www.krausmueller.de/en/2016/09/07/mac-transfer-rate-samba-share/2016-09-07T00:00:00+00:002016-09-07T00:00:00+00:00
<p>I use my <a
class="gblog-markdown__link"
href="/en/tags/cubietruck/"
title="articles concerning Cubietruck"
>Cubietruck</a> as a <a
class="gblog-markdown__link"
href="https://www.samba.org/"
title="Samba Webseite"
>Samba</a> server. Some day I noticed the transfer rate when copying files from my Mac with <a
class="gblog-markdown__link"
href="https://de.wikipedia.org/wiki/OS_X_El_Capitan"
title="Wikipedia article"
>OS X El Captian</a> was only around 10 MB/s. As the Cubietruck has a gigabit ethernet port the transfer rate should be much higher. I also remembered the transfer rate to be around 30 MB/s in the past. Not as fast as gigabit can deliver but I guess CPU load is a factor here.</p>
<p>After some research on the internet I found a <a
class="gblog-markdown__link"
href="https://dpron.com/os-x-10-11-5-slow-smb/"
title="How to Fix Slow SMB File Transfers on OS X 10.11.5"
>configuration</a> which got me back to ca. 30 MB/s. OS X uses <a
class="gblog-markdown__link"
href="https://blogs.technet.microsoft.com/josebda/2010/12/01/the-basics-of-smb-signing-covering-both-smb1-and-smb2/"
title="SMB Signing Overview"
>SMB Signing</a> since Mac OS X 10.11.5 by default. You can view the Samba version and options currently used for connected shares with the tool <em><strong>smbutil</strong></em>:</p>
<pre class="shell">
Mini:~ johannes$ <b>smbutil statshares -a</b>
==================================================================================================
SHARE ATTRIBUTE TYPE VALUE
==================================================================================================
media
SERVER_NAME cubie
USER_ID 502
SMB_NEGOTIATE AUTO_NEGOTIATE
SMB_VERSION SMB_3.0
SMB_SHARE_TYPE DISK
SIGNING_SUPPORTED TRUE
EXTENDED_SECURITY_SUPPORTED TRUE
LARGE_FILE_SUPPORTED TRUE
CLIENT_REQUIRES_SIGNING TRUE
FILE_IDS_SUPPORTED TRUE
DFS_SUPPORTED TRUE
MULTI_CREDIT_SUPPORTED TRUE
ENCRYPTION_SUPPORTED TRUE
SIGNING_ON TRUE
--------------------------------------------------------------------------------------------------
</pre>
<p>The line “SIGNING_ON TRUE” indicates that SMB Signing is used. You can change this setting in the file <em><strong>~/Library/Preferences/nsmb.conf</strong></em>:</p>
<pre class="shell">
Mini:~ johannes$ <b>echo "[default]" >> ~/Library/Preferences/nsmb.conf; echo "signing_required=no" >> ~/Library/Preferences/nsmb.conf</b>
Mini:~ johannes$ <b>cat ~/Library/Preferences/nsmb.conf</b>
[default]
signing_required=no
</pre>
<p>After restarting your Mac or disconnecting all shares and reconnecting afterwards SMB Signing should be deactivated (SIGNING_ON is no longer shown):</p>
<pre class="shell">
Mini:~ johannes$ <b>smbutil statshares -a</b>
==================================================================================================
SHARE ATTRIBUTE TYPE VALUE
==================================================================================================
media
SERVER_NAME cubie
USER_ID 502
SMB_NEGOTIATE AUTO_NEGOTIATE
SMB_VERSION SMB_3.0
SMB_SHARE_TYPE DISK
SIGNING_SUPPORTED TRUE
EXTENDED_SECURITY_SUPPORTED TRUE
LARGE_FILE_SUPPORTED TRUE
FILE_IDS_SUPPORTED TRUE
DFS_SUPPORTED TRUE
MULTI_CREDIT_SUPPORTED TRUE
ENCRYPTION_SUPPORTED TRUE
--------------------------------------------------------------------------------------------------
</pre>
<p>To get back to the original configuration you can just delete the file <em><strong>~/Library/Preferences/nsmb.conf</strong></em>.</p>
<p>As an alternative to deactivating SMB Signing globally in <em><strong>~/Library/Preferences/nsmb.conf</strong></em> you can also connect your share with <em><strong>cifs://hostname</strong></em> instead of <em><strong>smb://hostname</strong></em>. This way Samba version 1 without SMB Signing is used:</p>
<pre class="shell">
Mini:~ johannes$ <b>smbutil statshares -a</b>
==================================================================================================
SHARE ATTRIBUTE TYPE VALUE
==================================================================================================
pyload
SERVER_NAME cubie
USER_ID 502
SMB_NEGOTIATE SMBV_NEG_SMB1_ONLY
SMB_VERSION SMB_1
SMB_SHARE_TYPE UNKNOWN
EXTENDED_SECURITY_SUPPORTED TRUE
UNIX_SUPPORT TRUE
LARGE_FILE_SUPPORTED TRUE
CLIENT_REQUIRES_SIGNING TRUE
--------------------------------------------------------------------------------------------------
</pre>