TimeMachine backup to a CIFS share on ZFS

I run a Mac as my desktop computer, as you might understand from the topic. Now, I’ve used TimeMachine for my backups before. It started with an external disk, then I moved on to doing backup to an AFP share using Netatalk. The problem with Netatalk is that it’s a bit of a pain to use on Solaris and the AVAHI/Bonjour daemon doesn’t work all that well. Plus the fact that I’m only using it for backups, all my normal file sharing in the local network is done via CIFS. Wouldn’t it be a great idea to use CIFS to take TimeMachine backups as well? This is how you do it.

We start with the Solaris server:

I assume you have CIFS configured already.

1. Create a new ZFS partition to use as backup destination.

zfs create storage/timemachine

2. Let’s share it with CIFS.

zfs set sharesmb=on storage/timemachine

3. And last, set a quota. We don’t want the backup to grow too much, even though we are using a sparsebundle later on, you can’t be too cautious.

zfs set quota=500G storage/timemachine

Then we move on to the Mac:

1. The first step is to make sure the Mac will do backups to our share. It normally only accepts external disks and Time Capsules, but we can force it to accept unsupported volumes.

sudo defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

2. Create a sparsebundle called “computername_[ethernet address without :].sparsebundle”,  for me that would be amalthea_0026b0ea7420.sparsebundle since my computer is called amalthea and my ethernet address is 00:26:b0:ea:74:20 on interface en0.

hdiutil create -size 500g -fs HFS+J -volname “Amalthea Backup” amalthea_0026b0ea7420.sparsebundle

3. Let’s rsync it over! Connect to the share you created via CIFS (should be mounted under /Volumes).

rsync -avE amalthea_0026b0ea7420.sparsebundle /Volumes/timemachine

That’s it. Just select the volume in TimeMachine preferences and start backing up your data.

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

2 thoughts on “TimeMachine backup to a CIFS share on ZFS

  1. Pingback: Restore a Time Machine backup from a Solaris server

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>