• MacOS Optimization


    limetech
    • Minor

    Starting with 6.11.0-rc5 we have added some features to help us figure out the proper mix of SMB settings which will achieve the best performance/functionality with MacOS.  This mainly involves tuning the so-called "fruit" SMB parameters.  Please refer to the Samba "vfs_fruit" doc:

    https://www.samba.org/samba/docs/current/man-html/vfs_fruit.8.html

     

    First you will notice there are Global options and Per-Share options.  The global options are set in /etc/samba/smb.conf file on your server.  All the options are listed near the bottom, and ones which vary from the default setting are uncommented.  I don't think we will need to change these options but if you want to experiment then add your changes to /boot/config/smb-extra.conf file.

     

    Next are the set of per-share options.  These are set in /etc/samba/smb-fruit.conf file on your server.  Again all options are listed there and only the ones which deviate from default are uncommented.

     

    In addition, you may create the file /boot/config/smb-fruit.conf on your flash device and when Samba starts or is restarted, those options will override the options in /etc/samba/smb-fruit.conf.  Thus a good staring point would be to:

    cp /etc/samba/smb-fruit.conf /boot/config

    and now you can make changes to /boot/config/smb-fruit.conf

    After making a change you can type this command to to restart Samba:

    samba restart

     

    For any of this to be applied, you first need to ensure that "Settings/SMB/Enhanced macOS interoperability" is set to Yes.  This will tell Unraid OS to include the contents of the smb-fruit.conf file in each share (except for the 'flash' share, see below).

     

    Note: we actually have per-share hidden settings for enabling 'fruit', however from the documentation we read:

    Quote

    Be careful when mixing shares with and without vfs_fruit. OS X clients negotiate SMB2 AAPL protocol extensions on the first tcon, so mixing shares with and without fruit will globally disable AAPL if the first tcon is without fruit.

     

    Thus there is no UI for these settings, instead either all shares or no shares have 'fruit' extensions.  As for the 'flash' share, again from the doc we read:

    Quote

    The module enables alternate data streams (ADS) support for a share, intercepts the OS X special streams "AFP_AfpInfo" and "AFP_Resource" and handles them in a special way. All other named streams are deferred to vfs_streams_xattr which must be loaded together with vfs_fruit.

    (emphasis mine).

     

    They say 'streams_xattr' must be loaded, but later in the doc they talk about options that are incompatible with this.  In addition certain file system types are inherently incompatible, notably FAT and exFAT because they don't support xattr at all...  Hence we can't (or shouldn't) include the 'flash' share in 'fruit' but then if the 'flash' share is first share to be accessed on a Mac client, APPL extensions will be disabled for the duration... Yes this is confusing, maybe best bet is to not export the 'flash' share in MacOS environment.  If it is exported, the 'testparm' command outputs this warning:

    WARNING: some services use vfs_fruit, others don't. Mounting them in conjunction on OS X clients results in undefined behaviour.

     

    Time machine - if enabled for a share these parameters are automatically added (independent of smb-fruit.conf):

    fruit:time machine = yes
    fruit:time machine max size = SIZE # if "vol size limit" specified

     

    Finally Spotlight - our build of Samba includes spotlight support but only for 'elasticsearch'.  But 'elasticsearch' is not installed in Unraid OS.  In other places on the forum people have expressed success by setting the spotlight backend to 'tracker' - but this requires "gnone tracker" which also is not installed in Unraid OS - so I'm not sure what's going on here.  Nevertheless, you can add 'spotlight = on' to the smb-fruit.conf file to play around with this.

     

    Please limit discussion in this topic to MacOS issues only.

     

    • Like 10
    • Thanks 1
    • Upvote 1



    User Feedback

    Recommended Comments



    I switched my TimeMachine to an old MacMini with an external drive.  After 6.11.1 upgrade my UnRaid TimeMachine setup went belly up   I am done trying 

    Link to comment
    1 hour ago, johnwhicker said:

    I switched my TimeMachine to an old MacMini with an external drive.  After 6.11.1 upgrade my UnRaid TimeMachine setup went belly up   I am done trying 

    That’s not the latest stable though. 6.11.5 is, and time machine has been great with the configs listed in the thread for what it’s worth 

    Link to comment
    2 hours ago, Jclendineng said:

    time machine has been great with the configs listed in the thread for what it’s worth 

    I stand by my decision to stick with 6.9.2 until the DEFAULT settings for Unraid's SMB configs work correctly for the BUILT-IN functionality of Time Machine. 6.9.2 did that just fine, and there's no valid excuse in my mind for 6.11 and onwards to not include it. Especially given people have been able to hack their way to something functional. 

    I still challenge Unraid to raise the bar and get Time Machine backups working by default on a fresh install of 6.11/6.12 with zero additional manual config necessary. AKA:

    - Install Unraid to a flash drive
    - Boot, create a one disk no-parity array
    - Create a Time Machine compatible share after enabling macOS optimization in the SMB settings
    - Perform a successful backup
    - Perform successful incremental backups (which is the part that I've not yet seen working correctly)

    Bonus points if Time Machine shares created on 6.9 and earlier can continue to work with 6.11 and onwards. 

    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.