Time Machine over SMB (Mac OS Sierra)


Recommended Posts

On 10/1/2018 at 9:10 AM, gfjardim said:
On 9/29/2018 at 1:32 PM, driph said:
Welp, my old Time Capsule finally died, so I'm going to set up my Unraid box to serve as the Time Machine backup host.
 
What's the status of this? Should I wait for official support, or use one of the manual setup methods posted here and there?
 
Thanks all!

It's supported if used with AFP (Apple's own network filesystem). Since AFP will be deprecated, we are discussing the usage of SMB as successor of AFP.

Aye, it was via SMB that I was referring to. If support is a ways out, I'll go with AFP or hack up something in the meantime, but if it's around the corner I'll just be patient and back up the machines locally. :]

  • Like 1
Link to comment

So, I added 

[TimeMachine]
    path = /mnt/user/TimeMachine
    ea support = Yes
    vfs objects = catia fruit streams_xattr
    fruit:encoding = native
    fruit:locking = none
    fruit:metadata = netatalk
    fruit:resource = file
    fruit:time machine = yes
    fruit:time machine max size = 2.0 T

into my "Samba Extra Configuration" under SMB settings, and

cat /etc/avahi/services/smb.service
<?xml version='1.0' standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM 'avahi-service.dtd'>
<!-- 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>dk1=adVN=TimeMachine,adVF=0x82</txt-record>
 </service>
</service-group>

Except i have the following two issues:

 

When 


<service>
   <type>_adisk._tcp</type>
   <port>0</port>
   <txt-record>dk1=adVN=TimeMachine,adVF=0x82</txt-record>
 </service>

is added into that file, the other shares disappear via SMB, and I can no longer access them. The time machine share appears as an option for time machine, but when connecting to it, it fails to add it saying it doesn't support the right features. When this segment is removed, it doesn't show up in time machine, but everything else works fine. I'm perfectly fine writing a script to fix it if unraid overwrites the stuff that makes this work, can you guys tell me how you got it working? 

@limetech @gfjardim

Link to comment
  • 2 weeks later...

Anyone figure this out?  AFP is dreadfully slow to backup even over a 1 Gbps on Mac and 10.14 seems to have made it worse.  Over 24 hours to backup 2/3 of my 200 GB of data on the Mac.  Apple's documents says they only support SMB over the network for Time Machine.

https://support.apple.com/en-us/HT202784#nas

 

Would love to get rid of AFP once and for all... anyone know how to make this work?

 

***EDIT***

May have found a way to cheat:

https://www.makeuseof.com/tag/turn-nas-windows-share-time-machine-backup/

 

I created a sparsebundle image and put it up in the SMB share then mounted the disk in Mac and forced TimeMachine to use it with a simple sudo command.  Granted I have to make sure the share is mounted and the volume name doesn't change to get it to back up, I'll have to see if it's any faster.  Just started a fresh backup and off we go...

 

***UPDATE 2***

About 30 minutes in and already 21 GB backed up.  It's estimating 4 hours left... much MUCH less than the 24+ hours it would have taken using the AFP share.

 

***UPDATE 3***

This method may only be effective for a desktop that never sleeps.  My laptop as soon as I close the lid drops the connection to the remote disk which causes macOS to force an fsck on the sparsebundle image the next time it's mounted.  This isn't really feasible.  Hoping we get real support in unraid!

Edited by nickp85
  • Like 1
  • Upvote 1
Link to comment
  • 2 weeks later...
  • 2 weeks later...

Time Machine backups over AFP stopped working for me a while ago and I just now got around to moving it over to SMB.  Thought I'd share how I got it to work.

 

I created a share for the backup and enabled "Enhanced OS X Interoperability" along with Private security.

 

I added the following to SMB Extras (under Settings->SMB):

fruit:time machine = yes
fruit:time machine max size = 1T

The only way I could get Time Machine on High Sierra to use the share was via CLI:

$ sudo tmutil setdestination -a smb://<username>:<password>@<unraid-server>/<timemachine-share>

The share should then show up in the Time Machine UI.  I'm averaging about 50 MB/s from my MBP with a gigabit ethernet connection.

Link to comment
5 hours ago, ncandy said:

Time Machine backups over AFP stopped working for me a while ago and I just now got around to moving it over to SMB.  Thought I'd share how I got it to work.

 

I created a share for the backup and enabled "Enhanced OS X Interoperability" along with Private security.

 

I added the following to SMB Extras (under Settings->SMB):


fruit:time machine = yes
fruit:time machine max size = 1T

The only way I could get Time Machine on High Sierra to use the share was via CLI:


$ sudo tmutil setdestination -a smb://<username>:<password>@<unraid-server>/<timemachine-share>

The share should then show up in the Time Machine UI.  I'm averaging about 50 MB/s from my MBP with a gigabit ethernet connection.

Where does it indicate in the SMB Extras what shares to enable time machine on?  Is that a global setting that now time machine is enabled on all?  I tried to mess with this a bit and couldn't get it to work.

 

Update: I got it to map to the smb so thank you!  Only thing I noticed is that the Time Machine window on Mac no longer shows a size xxx of xxx for example.  Also curious about my above question... does that enable time machine with a max size across all shares?

Edited by nickp85
Link to comment

Anything in SMB Extras applies to all shares (/etc/samba/smb.conf contains an include of /boot/confir/smb-extra.conf in the [global] section).  Ideally, these settings should be applied to the shares themselves, but this was the easiest way to add these options persistently.  You still need to enable "Enahanced OS X interoperability" in the SMB Security Settings for the share you want to use.  Hopefully, the next version of Unraid will include options to add these Time Machine options to the SMB shares themselves.

 

It's my understanding that setting a max size in the [global] section will apply the specified max size to each share, i.e., each share used for TM will be allowed 1TB in my example.

Link to comment

This applies "fruit:time machine max size" to all shares, but this setting is only meaningful to Time Machine:

 

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

fruit:time machine max size = SIZE [K|M|G|T|P]

	Useful for Time Machine: limits the reported disksize, thus preventing Time Machine from using the whole real disk space for backup. The option takes a number plus an optional unit.

	IMPORTANT: This is an approximated calculation that only takes into account the contents of Time Machine sparsebundle images. Therefor you MUST NOT use this volume to store other content when using this option, because it would NOT be accounted.

	The calculation works by reading the band size from the Info.plist XML file of the sparsebundle, reading the bands/ directory counting the number of band files, and then multiplying one with the other.

 

Link to comment

In my case, it's working using the smb-extra method.

 

1) Create a share (in this example, TimeMachine) and, in SMB Security Settings, set Export to No.

 

2) Go to Settings > SMB and, in SMB Extras, add the following content:

 

[TimeMachine]
	ea support = Yes
	path = /mnt/user/TimeMachine
	vfs objects = catia fruit streams_xattr
	valid users = user1,user2
	write list = user1,user2
	fruit:time machine max size = 2T
	fruit:encoding = native
	fruit:locking = netatalk
	fruit:metadata = netatalk
	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

 

3) Adjust path, valid users, write list and fruit:time machine max size accordingly.

 

You should be done. Apparently, SAMBA has it's own mDNS server to advertise the Time Machine share.

Link to comment
6 hours ago, gfjardim said:

You should be done. Apparently, SAMBA has it's own mDNS server to advertise the Time Machine share.

How did you set TM to use the unexported share? I don't see mine in the list of available destinations.

 

Edit: Is it possible this only works with macOS Mojave? I tested with Sierra and High Sierra with no luck.

Edited by wgstarks
Link to comment
7 hours ago, gfjardim said:

In my case, it's working using the smb-extra method.

 

1) Create a share (in this example, TimeMachine) and, in SMB Security Settings, set Export to No.

 

2) Go to Settings > SMB and, in SMB Extras, add the following content:

 


[TimeMachine]
	ea support = Yes
	path = /mnt/user/TimeMachine
	vfs objects = catia fruit streams_xattr
	valid users = user1,user2
	write list = user1,user2
	fruit:time machine max size = 2T
	fruit:encoding = native
	fruit:locking = netatalk
	fruit:metadata = netatalk
	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

 

3) Adjust path, valid users, write list and fruit:time machine max size accordingly.

 

You should be done. Apparently, SAMBA has it's own mDNS server to advertise the Time Machine share.

This didn't work for me.  TimeMachine cant find the backup disk anymore. Actually, none of my SMB shares are working anymore.  Can't even connect to the machine on SMB anymore.

Edited by nickp85
Link to comment
22 hours ago, wgstarks said:

How did you set TM to use the unexported share? I don't see mine in the list of available destinations.

 

Edit: Is it possible this only works with macOS Mojave? I tested with Sierra and High Sierra with no luck.

Got it to work. Even though the SMB share isn't being exported by the unraid server it can still be mounted on my mac by browsing to smb://<unraid IP>/<name of share>. Once it's mounted on the mac I can select it as a destination for backups.

 

EDIT: This resulted in my not being able to connect to any other SMB shares with a message that my server would not allow connections from any other users. I had to completely delete the Time Machine share and all changes to SMB settings to correct this.

Edited by wgstarks
Link to comment
  • 2 weeks later...
  • 4 weeks later...
  • 2 months later...
8 hours ago, daze said:

When is this feature going to git the 6.7-rc? I'm on -rc5, latest at time of writing. But can't mount a TM share for use with TimeMachine on macOS Mojave.

I have been testing and have no problem. Did you follow the directions to set it up or just make a share and try it that way?

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.