TimeMachine backups on FreeBSD-10

I usually work on a Macbook, and I use keyless ssh with a cron job to do nightly backups.  It works very well.  However, I decided to try backups with Time Machine, using my FreeBSD-10 server as the host.

The first step is to install netatalk3, and nss_mdns

pkg install netatalk3
pkg install nss_mdns

avahi needs mDNS, so that needs to be configured in /etc/nsswitch.conf.  Ensure that this line exists:

hosts: files dns mdns

Finally, configure netatalk.  My configuration in /usr/local/etc/afp.conf looks like

[Global]
vol preset = default_for_all_vol
log file = /var/log/netatalk.log
hosts allow = 192.168.77.0/24
mimic model = TimeCapsule6,116

[default_for_all_vol]
file perm = 0640
directory perm = 0750
cnid scheme = dbd

[Homes]
basedir regex = /storage/home
time machine = yes

You'll need to start dbus, avahi, and netatalk, like this:

/usr/local/etc/rc.d/dbus onestart
/usr/local/etc/rc.d/avahi-daemon onestart
/usr/local/etc/rc.d/netatalk onestart

The next step takes place on your OS X client machine.  On each host that will perform backups, enable Time Machine to see non-TM volumes:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Then, mount your user's share using afp://.  This will make the share visible to TimeMachine.

After this, you should be able to see your Netatalk shares in Time Machine, and perform backups

10 Responses to "TimeMachine backups on FreeBSD-10"

  • anon
    August 25, 2014 - 11:01 pm Reply

    defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1 is not needed for netatalk volumes. Only for SMB shares.

  • hilbert
    August 28, 2014 - 2:08 am Reply

    There is no mention that it is necessary to create something like a HFS+ formatted (growing) sparsebundle disk image to write the TimeMachine data to. Is this not necessary any more? I had to do that on my 10.7 machines.

    In fact i’m just testing this myself here with a Mavericks install.

    • tom@khubla.com
      August 28, 2014 - 8:57 am Reply

      I did’t need to do that. In my case I used a UFS disk. In this later article, I used ZFS.

  • Reverse Takeover | the BSD report
    September 15, 2014 - 5:42 am Reply

    […] in the roundup include a puppet master-agent installation on FreeBSD, some pfSense items, using ZFS with your Apple Time Machine backups and a Lumina Desktop […]

  • Preston Garrison
    February 6, 2015 - 8:07 pm Reply

    Don’t forget to add the following to /etc/rc.conf so it starts on reboot

    dbus_enable=”YES”
    vahi_daemon_enable=”YES”
    netatalk_enable=”YES”

  • AM
    April 21, 2021 - 7:56 pm Reply

    Still works on freebsd 13 in a jail!

Leave a Reply