Time Machine Shares / Avahi


Recommended Posts

I'm fairly new to UnRAID and attempting to setup a time machine share for backing up the various macOS systems in the house. I've followed the guide to configure a new share with all the appropriate settings. However, it's not being detected by any of the macOS machines as an available time machine share.

 

I noticed that UnRAID isn't creating an avahi service entry for the time machine shares in /etc/avahi/services. If I manually create the appropriate avahi configuration file the share is immediately detected by all macOS clients.

 

Is something wrong and UnRAID isn't creating that avahi configuration? I'm assuming that it should be, or does it not? Am I missing some step in the setup to have the shares detected properly?

Link to comment

I’m really not much of an expert on this and perhaps someone else may be able to provide a better answer but it’s my understanding that vfs_fruit (which unRAID uses) advertises the TM services via mDNS and is configured via smb extras.

 

Perhaps your network doesn’t support mDNS or its not enabled. I have also had a few Macs that didn’t detect the service for a few hours after it was started. I had to wait overnight for at least one machine.

Link to comment

mDNS works fine on the network. UnRAID uses avahi for it's mDNS system, the problem appears to be that UnRAID isn't creating the appropriate service configuration in avahi for it to advertise the time machine share via mDNS.

 

As soon as I *manually* create the appropriate avahi service configuration file on the UnRAID server in /etc/avahi/services, the share is instantly available as a time machine target on all macOS systems on the network. So it's one of three scenarios occurring.

  1. UnRAID isn't creating the appropriate service configuration files in /etc/avahi/services for Time Machine
  2. UnRAID isn't supposed to create the appropriate service configuration files and it's supposed to be manually done, but not covered in the guide.
  3. UnRAID handles the mDNS for Time Machine shares in some other way I've not figured out so I'm not troubleshooting properly.

I'd suspect it's the first scenario over the second/third scenario as it would make a lot more sense for UnRAID to create all of the appropriate configuration items to support time machine samba shares or maybe handle it in some other way.

 

Maybe when someone at @limetech has a few moments they can chime in and elaborate on how it's supposed to work.

 

 

Link to comment

It looks like @limetech is relying on Samba to auto-register the time machine service with Avahi's mDNS, but for some reason it's broken/not working. Even running avahi-browse locally on the unraid server doesn't show any _adisk._tcp entries being advertised over mDNS, but I do see the smb and ssh services that UnRAID's local mDNS service is advertising.

unraid-diagnostics-20200330-0845.zip

Link to comment
  • 1 month later...

I have also encountered my Mac Time Machine cannot find the Time Machine share I created based on the UnRAID wiki ( this ). 

 

I have done some googling on how others (ie. not UnRAID way) are setting up SMB Time Machine share.  I come across this article that uses Samba and Avahi to setup Time Machine share on Raspberry Pi.

 

I compare the UnRAID avahi configuration file for Samba (ie. /etc/avahi/services/smb.service) against that being suggested in the Raspberry Pi article.

 

I have tested adding the third <service></service>  of type "_adisk._tcp" as in the Raspberry article.  It works and my share can now be found by Time Machine

 

I am sharing my amended smb.service below.  My Time Machine share is called "TM-MacMini-Late2012".

 

FYI, I did not include "<txt-record>sys=adVF=0x100</txt-record>" in the third <service></service> as in the Raspberry article.    It is because my Time Machine share is "public" to start with.  Yet, when I ask Time Machine to use this share, it still ask for credential.  I guess there is global setting asking for credential anyway.

<!-- Generated settings: -->
<service-group>
 <name replace-wildcards='yes'>%h</name>
 <service>
  <type>_smb._tcp</type>
  <port>445</port>
 </service>
 <service>
  <type>_device-info._tcp</type>
  <port>0</port>
  <txt-record>model=Xserve</txt-record>
 </service>
 <service>
  <type>_adisk._tcp</type>
  <port>0</port>
  <txt-record>dk0=adVN=TM-MacMiniLate2012,adVF=0x82</txt-record>
 </service>
</service-group>

 

  • Thanks 1
Link to comment
On 5/15/2020 at 7:38 AM, dandus said:

I have also encountered my Mac Time Machine cannot find the Time Machine share I created based on the UnRAID wiki ( this ). 

 

I have done some googling on how others (ie. not UnRAID way) are setting up SMB Time Machine share.  I come across this article that uses Samba and Avahi to setup Time Machine share on Raspberry Pi.

 

I compare the UnRAID avahi configuration file for Samba (ie. /etc/avahi/services/smb.service) against that being suggested in the Raspberry Pi article.

 

I have tested adding the third <service></service>  of type "_adisk._tcp" as in the Raspberry article.  It works and my share can now be found by Time Machine

 

I am sharing my amended smb.service below.  My Time Machine share is called "TM-MacMini-Late2012".

 

FYI, I did not include "<txt-record>sys=adVF=0x100</txt-record>" in the third <service></service> as in the Raspberry article.    It is because my Time Machine share is "public" to start with.  Yet, when I ask Time Machine to use this share, it still ask for credential.  I guess there is global setting asking for credential anyway.


<!-- Generated settings: -->
<service-group>
 <name replace-wildcards='yes'>%h</name>
 <service>
  <type>_smb._tcp</type>
  <port>445</port>
 </service>
 <service>
  <type>_device-info._tcp</type>
  <port>0</port>
  <txt-record>model=Xserve</txt-record>
 </service>
 <service>
  <type>_adisk._tcp</type>
  <port>0</port>
  <txt-record>dk0=adVN=TM-MacMiniLate2012,adVF=0x82</txt-record>
 </service>
</service-group>

 

Unfortunately this does not work for me adding the "_adisk._tcp" service

Link to comment
2 hours ago, cinereus said:

Unfortunately this does not work for me adding the "_adisk._tcp" service

 

I just created a new service file timemachine.service with the following,

 

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
  <type>_adisk._tcp</type>
  <txt-record>sys=waMa=0,adVF=0x100</txt-record>
  <txt-record>dk0=adVN=macos_backups,adVF=0x82</txt-record>
 </service>
</service-group>

Replacing "macos_backups" with the exact name of your TM share. Works fine, problem is that it's not persistent across reboots, etc. So I created it as a file and used the go script to copy it to the /etc/avahi directory at every reboot. Haven't had any issues yet.

  • Like 1
Link to comment
15 hours ago, amiskell said:

 

I just created a new service file timemachine.service with the following,

 


<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
  <type>_adisk._tcp</type>
  <txt-record>sys=waMa=0,adVF=0x100</txt-record>
  <txt-record>dk0=adVN=macos_backups,adVF=0x82</txt-record>
 </service>
</service-group>

Replacing "macos_backups" with the exact name of your TM share. Works fine, problem is that it's not persistent across reboots, etc. So I created it as a file and used the go script to copy it to the /etc/avahi directory at every reboot. Haven't had any issues yet.

Sorry. To be clear does this file "timemachine.service" go in  /etc/avahi or  /etc/avahi/services?

And is the filename always timemachine.service regardless of what the share name is (I will change the txt-record)?

Link to comment
  • 5 months later...
  • 4 months later...
  • 2 months later...
On 5/19/2020 at 8:52 PM, cinereus said:

Sorry. To be clear does this file "timemachine.service" go in  /etc/avahi or  /etc/avahi/services?

Thanks to whomever found this "work-around"! I found this worked for me when I placed the timemachine.service file into the /etc/avahi/services directory. I hope this helps someone as it definitely helped me out.

 

P.S. It would be great if this was fixed at some point. 

Link to comment
  • 1 month later...
5 hours ago, AleM said:

Hi,

 

where i can put the file to be copied, nt on the array cause is not available at reboot.

 

There is not a way to have it on the USB or part of a plugin?


the normal way to make files persist across a reboot is to put them on the USB drive, and then add entries to the config/go file on the flash to copy them to the runtime position and if necessary set any permissions required.

Link to comment
  • 3 months later...
46 minutes ago, PicPoc said:

There is another problem :

When you set "Enhanced macOS interoperability:" to "Yes", we can't write on Flash.

Mount Flash on the desk, try to copy a txt file : error.

 

May be "vfs objects = catia fruit streams_xattr" cause this trouble in "/etc/samba/smb-shares.conf" ?

I’m seeing this if I try to copy a txt file to flash from my Mac but not when saving a txt to flash or editing a file already on flash.

Link to comment

I can edit and save the text if I want.

But, try this :
Select a txt file in the flash folder on the finder and use "CMD + C" to copy and "CMD +V" to Paste.
You'l see an error on OSX v10.6.8 and v10.11.6 : "(Error code -36)"
The copied file is 0kb.

If I set "Enhanced macOS interoperability:" to "No", no problem.

Edited by PicPoc
Link to comment
  • 1 month later...

Sounds kind of familiar. Hope this helps:

 

I've had my old mac mini stored for a while. Finally had a chance to get it setup and updated (to Catalina), and... Time Machine didn't work.

There have been two things that changed - MacOS and a few updates to Unraid.

 

After working on this for a couple of days, I found that creating a new share and sharing it as yes/Time Machine worked great. I want to use my unassigned device,

so that solution didn't work too well (if Santa is nice I might get another 8TB drive and be able to setup a real share).

 

I got to thinking that this had to be something samba related. I read far too much regarding Samba and followed a few too many threads.

The path I followed is that netatalk is bad (remember Apple's announcement of deprecating AFP?). I decided to leverage Samba defaults as much as possible and it worked.

 

My Samba extras are below. Changes/new stuff is shown in red.

If this is erroneous or requires changes, PLEASE say something :)

 

I hope this helps whomever!

GL:HF!

 

#disable SMB1 for security reasons

[global]
   min protocol = SMB2

 

[TimeMachine]
ea support = Yes
path = /mnt/disks/TimeMachine
vfs objects = acl_xattr catia fruit streams_xattr
valid users = joeuser
write list = joeuser
guest ok = no
#new stuff
fruit:nfs_aces=no
inherit_permissions = yes
#
fruit:aapl = yes

fruit:encoding = native
fruit:time machine max size = 2 T
#doing two things - ignoring anything with netatalk
#also relying on samba defaults (might be a problem)
#fruit:locking = netatalk
#changed from netatalk

fruit:metadata = stream
#default value is file
#fruit:resource = file

fruit:time machine = yes
fruit:advertise_fullsync = true
durable handles = yes
kernel oplocks = no
kernel share modes = no
posix locking = no
inherit acls = yes

 

 

Link to comment

I'm running Unraid 6.9.2. Except for a rebuild (a new case), Unraid has been running for years now. I can't tell you what version I started at without

digging for the printed email from my license purchase.

 

As to my version of MacOS? Well... the mini has been powered down for a while. I think it was running either 10.11 or 10.12. It is now running 10.15.

Edited by dingy
coffee needed.
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
Reply to this topic...

×   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.