In the first article I’ll show you some small optimizations for the SMB shares for working with macOS. For more information about this series about openmediavault and an overview of all articles, please see here.

So let’s get started. The above mentioned optimizations for SMB are the settings vfs objects = catia fruit streams_xattr and fruit:metadata = stream

As you probably know, openmediavault already allows a lot of settings for shared folders and SMB shares in its GUI and also allows you to specify advanced options, both in the settings for SMB/CIFS as a whole, as well as for the respective individual shares.

In addition, openmediavault offers, with the help of environment variables, to specify default values for certain settings, which is especially helpful for several shares, as you no longer have to adjust each individual share. From the developers’ point of view, this is also preferable to manual input in the advanced options.

Unfortunately, openmediavault is not entirely consistent when using TimeMachine and users’ home sharing, and we have to use both ways to properly set this up.

GUI settings

Go to Settings under SMB/CIFS, scroll down there and enter the following in the Advanced Options field:

fruit:metadata = stream

You’ll get this:

Setting the environment variables

Log in via ssh to your openmediavault Raspberry Pi and set the environment variables by typing:

sudo omv-env set OMV_SAMBA_SHARE_VFSOBJECTS "catia fruit streams_xattr"
sudo omv-env set OMV_SAMBA_HOMES_VFSOBJECTS "catia fruit streams_xattr"
sudo omv-env set OMV_SAMBA_SHARE_FRUIT_METADATA stream 

The environment variables now must now be updated into openmediavault. This will updated the affected configuration files too. This is easy to do with the following commands. However, this will take a while. The whole thing takes almost 50 – 60 seconds on my overclocked Raspi 4. So please be patient.

sudo omv-salt stage run prepare
sudo omv-salt deploy run samba

Now all normal shares, TimeMachine and users Home shares are provided with these macOS-specific settings, both the already existing shares, as well as those that you create in the future.


2 Comments

Brandon · 3. June 2023 at 19:49

So why use omv-env to set the apple specific options? Does it do something different?
Most other guides suggests setting these in the global SMB/CIFS settings via the webui should suffice?

See: https://github.com/openmediavault/openmediavault/issues/727

    Simone · 8. June 2023 at 16:15

    it’s because any TimeMachine share uses the environment variables and therefor overwrites your global SMB settings. And since you can use a TimeMachine share for storing other files too, you will have different configurations, if you only use global settings. (BTW, there’s no risk in using TimeMachine shares for storage of other files, since you can set a quota for TimeMachine sparsebundles by creating a .com.apple.TimeMachine.quota.plist file)

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

Bitte löse die kleine Aufgabe, um den Kommentar abzuschicken. *