• Search of SMB shares not working (MacOS client)


    CS01-HS
    • Minor

    I don't search often so I can't say for certain it's the beta but it used to work consistently and now it doesn't, even in safe mode. No results returned no matter how long I wait.

     

    I'm running the latest MacOS Catalina.

    I also tested in MacOS Mojave (unraid VM), same result.

     

    I have a Raspberry Pi shared over SMB where search from the same two clients works fine.

     

    Diagnostics from safe mode attached.

     

    nas-diagnostics-20201027-1319.zip

     

     

    EDIT: Hack "solution" from follow-up post below.

    Hopefully this helps with a fix.

     

    Test:

     

    Mount unraid share system on my mac and check its spotlight status:

    [macbook-pro]:~ $ mdutil -s /Volumes/system
    /System/Volumes/Data/Volumes/system:
    Server search enabled.
    [macbook-pro]:~ $

     

    But "server search" is not in fact enabled.

    Apparently samba 4.12.0 changed the default from Gnome tracker to noindex.

    Note that when upgrading existing installations that 
    are using the previous default Spotlight backend 
    Gnome Tracker must explicitly set "spotlight backend = tracker"
    as the new default is "noindex".

     

    To change it back (as it was in 6.8) I add the following to SMB extras:

    [global]
       spotlight backend = tracker

     

    and explicitly enable spotlight for each share:

    [system]
       path = /mnt/user/system
       spotlight = yes


    Now when I mount it and check spotlight status I get the following:

    [macbook-pro]:~ $ mdutil -s /Volumes/system
    /System/Volumes/Data/Volumes/system:
    Indexing disabled.
    [macbook-pro]:~ $

     

    And search works.

     

    EDIT: 5/18/2022

    I'm enjoying 6.10 improvements but it now marks two major versions and more than a year that basic functionality (search) isn't available to Mac users. Is a fix in the pipeline?

    • Like 2
    • Upvote 1



    User Feedback

    Recommended Comments



    Below I include my Unraid (Version: 6.10.0-rc1) "Samba extra configuration". This configuration is working  well for me accessing Unraid shares from macOS Monterey 12.0.1

     

    I expect these configuration parameters will work okay for Unraid 6.9.2. The "veto" commands speed-up performance to macOS by disabling Finder features (labels/tags, folder/directory views, custom icons etc.) so you might like to include or exclude these lines per your requirements.

     

    Note, there are problems with samba version 4.15.0 in Unraid 6.10.0-rc2 causing unexpected dropped SMB connections… (behavior like this should be anticipated in pre-release) but fixes expected in future releases.

     

    This configuration is based on a Samba configuration recommended for macOS users from 45Drives here: KB450114 – MacOS Samba Optimization.

     

    #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
    
    [data01]
       path = /mnt/user/data01
       veto files = /._*/.DS_Store/
       delete veto files = yes
       spotlight = yes

     

    My Unraid share is "data01". Give attention to modifying the configuration for your particular shares (and other requirements). I hope providing this might help others to troubleshoot and optimize SMB for macOS.

    • Like 5
    • Thanks 9
    Link to comment

    Thanks for the thanks.

     

    The Unraid "Samba extra configuration" change has been well worthwhile but the real "gold nugget" in the KB450114 – MacOS Samba Optimization article is the section "SMB Signing (MacOS 10.11.4 and Before)". I highlight it here because it has been just soooo good for me. This client-side (ie on macOS) configuration change is key for speeding up SMB operations on macOS Finder connecting to Unraid.

     

    EDIT. Probably disregard the suggestion in this post "Since the release of OS X 10.11.5, Apple’s SMB Signing has been enabled by default."

    Edited by Maxrad
    Note changed behaviour in newer macOS.
    • Like 1
    Link to comment
    On 1/7/2022 at 12:52 AM, Maxrad said:

    Thanks for the thanks.

     

    The Unraid "Samba extra configuration" change has been well worthwhile but the real "gold nugget" in the KB450114 – MacOS Samba Optimization article is the section "SMB Signing (MacOS 10.11.4 and Before)". I highlight it here because it has been just soooo good for me. This client-side (ie on macOS) configuration change is key for speeding up SMB operations on macOS Finder connecting to Unraid.

    I came across this thread because of issues with Timemachine (Catalina). The TM backup wasn't running since unRAID 6.10.0-rc2 was installed. I think that "Samba extra configuration" elements need to be included if “Enhanced macOS interoperability” is enabled!

    • Like 1
    Link to comment

    Thanks Maxrad your smb extras code worked on my unraid 6.9.2 and MacOS 12.2.1.

     

    Entered the coded into the smb extras turned the array back on and was able to search the SMB share straight away from my Mac


    😀

     

     

    On 11/22/2021 at 11:05 PM, Maxrad said:
    #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
    
    [data01]
       path = /mnt/user/data01
       veto files = /._*/.DS_Store/
       delete veto files = yes
       spotlight = yes

     

    • Like 1
    Link to comment

    Edit: reverted to 6.9.2 and same issues.  Does not happen with "backups" share, but does happen with "system" and user created "media" share.

     

    Im on RC2 and get this as well:

     

    Mar 3 09:33:34 Tower smbd[24416]: [2022/03/03 09:33:34.938119, 0] ../../source3/rpc_server/mdssvc/mdssvc.c:1638(mds_init_ctx)
    Mar 3 09:33:34 Tower smbd[24416]: mds_init_ctx: Unknown backend 1
    Mar 3 09:33:34 Tower smbd[24416]: [2022/03/03 09:33:34.938210, 0] ../../source3/rpc_server/mdssvc/srv_mdssvc_nt.c:153(_mdssvc_open)
    Mar 3 09:33:34 Tower smbd[24416]: _mdssvc_open: Couldn't create policy handle for media

     

    /mnt/user/media

     

    #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

    [media]
       path = /mnt/user/media
       veto files = /._*/.DS_Store/
       delete veto files = yes
       spotlight = yes
     

    is this something to be concerned about?

    Edited by Jclendineng
    Link to comment

    Tried this configuration on 6.10 RC-3. It worked great for about 30 hours but eventually the samba transfers started stalling, shares failed to mount or were dropped if already mounted.

    Link to comment
    On 3/16/2022 at 10:25 AM, wgstarks said:

    Tried this configuration on 6.10 RC-3. It worked great for about 30 hours but eventually the samba transfers started stalling, shares failed to mount or were dropped if already mounted.

    Issue is still present on the 6.10 RC-4 :(

    Link to comment
    On 3/25/2022 at 10:58 AM, wgstarks said:

    Did you add server multi channel support = no?

    Made no difference for me - using Catalina macOS - not sure if that matters.

     

    Edit: I had a typo in my smb-settings.conf file, after fixing it the shares seem to be working OK but the TimeMachine share is not working with macOS

    Edited by soana
    added more info
    Link to comment
    On 11/22/2021 at 11:05 PM, Maxrad said:

    Below I include my Unraid (Version: 6.10.0-rc1) "Samba extra configuration". This configuration is working  well for me accessing Unraid shares from macOS Monterey 12.0.1

     

    I expect these configuration parameters will work okay for Unraid 6.9.2. The "veto" commands speed-up performance to macOS by disabling Finder features (labels/tags, folder/directory views, custom icons etc.) so you might like to include or exclude these lines per your requirements.

     

    Note, there are problems with samba version 4.15.0 in Unraid 6.10.0-rc2 causing unexpected dropped SMB connections… (behavior like this should be anticipated in pre-release) but fixes expected in future releases.

     

    This configuration is based on a Samba configuration recommended for macOS users from 45Drives here: KB450114 – MacOS Samba Optimization.

     

    #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
    
    [data01]
       path = /mnt/user/data01
       veto files = /._*/.DS_Store/
       delete veto files = yes
       spotlight = yes

     

    My Unraid share is "data01". Give attention to modifying the configuration for your particular shares (and other requirements). I hope providing this might help others to troubleshoot and optimize SMB for macOS.

     

    You absolute legend! This solved my horrendous SMB performance on macOS 12.3.1 which would top out at around 20MB/s in short ~5 second bursts. Now I get sustained ~80-100MB/s+ and instant Finder navigation which is superb!

    Edited by unraidyn
    • Like 2
    Link to comment

    I continue to have extremely slow navigating and data transfers. I use the recyling bin plugin, does the following look correct? 

     

    #unassigned_devices_start
    #Unassigned devices share includes
       include = /tmp/unassigned.devices/smb-settings.conf
    #unassigned_devices_end
    #vfs_recycle_start
    #Recycle bin configuration
    [global]
       syslog only = No
       syslog = 0
       logging = 0
       log level = 0 vfs:0
       vfs objects = catia fruit streams_xattr
       fruit:nfs_aces = no
       fruit:zero_file_id = yes
       fruit:metadata = stream
       fruit:encoding = native
       spotlight backend = tracker
    #vfs_recycle_end
    [data]
       path = /mnt/user/data
       veto files = /._*/.DS_Store/
       delete veto files = yes
       spotlight = yes

     

    I have not done anything locally on my mac, since the 45drives link says you only need to make changes on older mac os x versions. My unraid data share is /mnt/user/data

     

    My mac is running 12.5.1

    Link to comment
    6 hours ago, kri kri said:

    I have not done anything locally on my mac, since the 45drives link says you only need to make changes on older mac os x versions. My unraid data share is /mnt/user/data

     

    My mac is running 12.5.1

     

    I'm on 12.5.1 as well and I have extremely slow performance in Finder just showing folder contents, especially in folders with more than a thousand objects.  When I first got my MacBook it was running Big Sur and I don't recall having any slowness issues at all, but I was also on a 6.9.x build of Unraid.  I've implemented https://support.apple.com/en-us/HT208209 and I deleted all of the .DS_Store files that had been previously created, I've also tried turning off caching per https://support.apple.com/en-us/HT207520, and I've tried setting multichannel to prefer wired connections and even turning off multichannel support per https://support.apple.com/en-us/HT212277.  If I use a Windows PC or a Windows VM running in Parallels on my MacBook the same folders on the share that are slow in Finder populate immediately.  And I've used iperf and confirmed that I get a full Gigabit between my MacBook and the Unraid server when docked.  I've tried a variety of Samba configurations including https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X and the behavior is the same.

     

    Edit - I wanted to mention that vetoing files in the config can cause slowness.  You might try doing 'find /mnt/user/data \( -name '.DS_Store' \) -delete' on Unraid to remove any existing files and run 'defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE' on your Mac to stop it from creating .DS_Store files.  Maybe that will help with performance for you?

    Edited by _whatever
    Link to comment
    18 hours ago, _whatever said:

    You might try doing 'find /mnt/user/data \( -name '.DS_Store' \) -delete' on Unraid to remove any existing files and run 'defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE' on your Mac to stop it from creating .DS_Store files.

     

    I use the Mover Tuning plugin to keep all my .DS_Store files on the (SSD) Cache.

    I don't know whether that's as fast as disabling them entirely.

    1928175769_ScreenShot2022-08-25at11_51_32AM.thumb.png.d2ca62b090d04288b6ab2fdee48822b2.png

     

    None of these tweaks have made SMB as fast and reliable as AFP unfortunately.

     

    On 8/24/2022 at 11:15 AM, kri kri said:

    I continue to have extremely slow navigating and data transfers.

     

    How slow is extremely slow?

    For reference I get about 25MB/s for large transfers over 802.11n.

     

    I'd really like to know whether these performance issues apply to SMB in general with mac clients or whether they're specific to unraid. Does anyone have another high-performance NAS to test against and compare?

    Link to comment
    12 minutes ago, CS01-HS said:

    How slow is extremely slow?

    For reference I get about 25MB/s for large transfers over 802.11n.

     

    I'd really like to know whether these performance issues apply to SMB in general with mac clients or whether they're specific to unraid. Does anyone have another high-performance NAS to test against and compare?

     

    I think there's three distinct problems that tend to get conflated.  One is the speed in which Finder will traverse and list folder contents on an SMB share.  The second is throughput when copying from the server.  The third is copying from the client to the server.  On average it takes anywhere from 2-10 minutes for Finder to populate the contents of a folder with 1-2 thousand files in it, and sometimes it goes completely unresponsive and I get beachballs.  Contrast this with a Windows endpoint which immediately shows the contents of folders with zero lag.  As far as transfer speeds from the server to the client, it really depends on the number of files and their sizes, but I can get about 130MBps if I copy a single, large file from the server to the client.  Copying many files of various sizes can be a mixed bag regardless of if the client endpoint is Mac, Windows or Linux and just par for the course in my experience.  Even in corporate environments when copying files from flash storage arrays over 10GbE or faster I see this.  The third issue is speed writing to the Unraid server over SMB where the speed suddenly plummets after writing at a reasonable speed.  This I think is more of an issue with SHFS and has been well documented elsewhere.

     

    To be clear, I think issues 1 and 2 combine to make the slowness worse when using Mac endpoints.  My particular issue is Finder being slow to list folder contents, but also if I copy a folder with many objects, especially with many nested folders.  When doing Wireshark captures I can see the Mac do a GetInfo Request to get the file size and file attributes for EVERY FILE!  Doing the same capture from a Windows endpoint while browsing a share does not do this.  It is unclear to me at this point if it is due to something stupid Apple is doing in their SMB implementation and/or something with how Samba is compiled on Unraid.  I'm still doing additional testing but haven't had a lot of time to dedicate to this.  At first blush I do think it's something to do with Samba since I don't have this experience when traversing the same folder when I copy it to a share on a Windows 10 PC and then browse the share from my Mac.  I need to do more Wireshark captures to see if I can find anything definitive.

     

    Apologies if this is scatter brained.  I'm sick with Covid and the cold/flu medicine I took makes me feel like I drank a pot of coffee.  🥴

    • Like 1
    Link to comment

    I have experienced both extreme slowness of finder navigation, and when copying files. I don't usually check the speed but between my windows machines and my mac is it night and day. NFS loads very quick for me, I might just switch to NFS fulltime, even though it is a bit more difficult to use.

     

    Would be interested to see if this is an apple thing or unraid, I suspect Apple. 

     

    Just tried to navigate a folder of 700 folders, and I got a spinny beachball for 20 seconds. 

    Edited by kri kri
    • Upvote 1
    Link to comment
    On 8/25/2022 at 3:27 PM, kri kri said:

    Would be interested to see if this is an apple thing or unraid, I suspect Apple. 

    As much as I'd like to blame Apple because of the dumb crap they do, I don't think it's on them.  I copied the same folder that takes minutes to load in Finder from a share on Unraid to a Windows 10 and Windows 11 machine and shared it there.  In both cases when hitting the shares on the Windows machines Finder doesn't have any lag, nor do I see the GetInfo Request for each file in the folder when doing a Wireshark capture.

     

    I suspect it's either in how Samba was compiled or one of the default config settings.  Unfortunately I think it's going to require a process of elimination by getting the Samba config using testparm -v, changing settings and testing.

    • Upvote 1
    Link to comment

    Adding the following does seem to help Finder show folder contents faster.  I'll play around with it more tomorrow, but I'm curious what others' experience would be adding this:

    [global]

    readdir_attr:aapl_max_access = no
    readdir_attr:aapl_finder_info = no
    readdir_attr:aapl_rsize = no

    Link to comment

    After more testing I was able to get some decent performance with a few changes.  It still isn't as fast as a Windows 10 or 11 client, or any of the Linux distros I've tested with (Ubuntu, Mint, Pop!_OS), but it's better than the default Samba config settings.  I know it has to do with Apple's implementation of SMB so I think this is likely as good as it gets.  I would recommend against vetoing files in your Samba config since that will cause slowness when using Finder to browse shares.  You're better off using find on Unraid to delete all .DS_Store and ._ files and run the command below to tell macOS to stop creating them on network shares.  

     

    To delete all .DS_Store and ._ files run the following as root from the terminal on Unraid:

    find /mnt/user \( -name “.DS_Store” -or -name “._*” \) -delete

     

    Run the following on my MacBook to stop .DS_Store and ._ files from being created:

    defaults write com.apple.desktopservices DSDontWriteNetworkStores true

     

    This is what I settled on in my smb-extra.conf:
    [global]

    fruit:metadata = stream
    fruit:posix_rename = yes
    readdir_attr:aapl_max_access = no
    readdir_attr:aapl_finder_info = no
    readdir_attr:aapl_rsize = no

     

    /etc/nsmb.conf on my MacBook (12.5.1):

    [default]

    mc_prefer_wired=yes

     

    Good luck!

    • Upvote 1
    Link to comment
    1 hour ago, _whatever said:

    You're better off using find on Unraid to delete all .DS_Store and ._ files

    What’s the purpose of deleting the .DS_Store files? I’ve never really understood the problem with them. Does it improve performance in some way?

    Just curious.

    Link to comment
    7 minutes ago, wgstarks said:

    What’s the purpose of deleting the .DS_Store files? I’ve never really understood the problem with them. Does it improve performance in some way?

    Just curious.

    Finder uses those files to remember sort order, view options, icon positions, etc., for each folder.  That may be desirable for some, but the problem is that on network shares it will add latency while it tries to parse the file contents and enumerate the settings, which on top of all of the other Apple file metadata and attibutes is just bloat on top of standard SMB.  In my testing it did help speed Finder up when traversing and showing the contents of a folder with a lot (500+) items.  It's hard to quantify exactly how much it helps, but it is especially noticeable in folders with thousands of objects in it.

     

    https://en.wikipedia.org/wiki/.DS_Store

    Link to comment



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.