21

I have quite a few file servers at work that serve up files over SMB/CIFS.

How can I tell what version is negotiated when someone says that I need to be sure I'm connecting over SMB version 3 to get best performance?

3 Answers 3

29

The smbutil command can dump the attributes for all shares or you can target one particular share and parse out the version string:

smbutil statshares -a

In the case of the listing below:

site-test-mbp01:~ me$ df
Filesystem                                           512-blocks       Used  Available Capacity  iused               ifree %iused  Mounted on
/dev/disk1s1                                          975210568  368841648  602865928    38%  1808606 9223372036852967201    0%   /
devfs                                                       706        706          0   100%     1222                   0  100%   /dev
/dev/disk1s4                                          975210568    2097200  602865928     1%        2 9223372036854775805    0%   /private/var/vm
map -hosts                                                    0          0          0   100%        0                   0  100%   /net
map auto_home                                                 0          0          0   100%        0                   0  100%   /home
/dev/disk3s1                                         7813365344 1387760392 6424657392    18%    28307 9223372036854747500    0%   /Volumes/apfs
com.apple.TimeMachine.2018-03-29-120539@/dev/disk1s1  975210568  367917520  602865928    38%  1809465 9223372036852966342    0%   /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/site-test-mbp01/2018-03-29-120539/Macintosh HD
com.apple.TimeMachine.2018-03-23-083810@/dev/disk1s1  975210568  348612592  602865928    37%  1755978 9223372036853019829    0%   /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/site-test-mbp01/2018-03-23-083810/Macintosh HD
//me@file-nasuni/abc                              2147409920     227552 2147182368     1%   113774          1073591184    0%   /Volumes/abc

To target the Nasuni share "abc"

smbutil statshares -m /Volumes/abc/ | awk '/SMB_VERSION/{print $2}'

The command shows I'm negotiated a SMB_3.02 connection to that storage appliance share.

3
  • @colin I rolled back your edit. Just tried on 13.4.1, worked without sudo (from a non-admin account).
    – nohillside
    Jun 30, 2023 at 7:06
  • @nohillside, the command runs, but it gives an error, as stated in my edit comments.
    – Colin
    Jun 30, 2023 at 10:03
  • @colin I don't get the error at all, just the expected output?! Do you have volumes mounted by another user?
    – nohillside
    Jun 30, 2023 at 12:41
4

This is an example how smbutil statshares -a looks like on MacOS 10.15.4:

~ $ smbutil statshares -a

==================================================================================================
SHARE                         ATTRIBUTE TYPE                VALUE
==================================================================================================
SomeShareName
                              SERVER_NAME                   MYSERVER._smb._tcp.local
                              USER_ID                       502
                              SMB_NEGOTIATE                 SMBV_NEG_SMB1_ENABLED
                              SMB_NEGOTIATE                 SMBV_NEG_SMB2_ENABLED
                              SMB_NEGOTIATE                 SMBV_NEG_SMB3_ENABLED
                              SMB_VERSION                   SMB_3.02
                              SMB_SHARE_TYPE                DISK
                              SIGNING_SUPPORTED             TRUE
                              EXTENDED_SECURITY_SUPPORTED   TRUE
                              LARGE_FILE_SUPPORTED          TRUE
                              OS_X_SERVER                   TRUE
                              DFS_SUPPORTED                 TRUE
                              FILE_LEASING_SUPPORTED        TRUE
                              MULTI_CREDIT_SUPPORTED        TRUE
                              ENCRYPTION_SUPPORTED          TRUE
                              ENCRYPTION_REQUIRED           TRUE

--------------------------------------------------------------------------------------------------
0
1

You can just use a network sniffer like Wireshark, filter as smb||smb2 and see in the negotiate response the dialect that the server chosen.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .