Published on January 11, 2010.
TweetWarning: This post is outdated! Here is a newer version.
Okay, I just had set up a backup system from a MacBookPro (let's say, the client) to a FreeBSD-powered server (quite boringly, the server). I chose Time Machine because of it's nice and polished interface and its deep integration with OSX. After a lot of (too much?) tries and spent time, I chose the AFP for the protocol between the two machines. I decided to write this post because there are plenty of outdated posts on the web concerning this setup, and I didn't manage to hit my goal with them. So my post relates a way which works for me.
The AFP protocol is provided by NetATalk, a free AFP implementation. Let's install it with the ports tree:
cd /usr/ports/net/netatalk/ && make install clean
Add it to your configuration: add the following to /etc/rc.conf:
netatalk_enable="YES"
afpd_enable="YES"
Define an obscure setting in /usr/local/etc/afpd.conf:
"Time Machine" -uamlist uams_dhx2.so
Add your Time Machine share into /usr/local/etc/AppleVolumes.default (edit to
make it fits your needs):
/storage/timemachine/ "Time Machine" allow:thomas
Finally start the service:
/usr/local/etc/rc.d/netatalk start
Howl is a free implementation of the Apple's Bonjour protocol. It is used to spread hostnames and shares on your network. You don't really need it, but I think it's smarter to use it.
Install by the ports tree:
cd /usr/ports/net/howl/ && make install clean
Add to the configuration (/etc/rc.conf):
mdnsresponder_enable="YES"
mdnsresponder_flags="-f /usr/local/etc/mDNSResponder.conf"
Create the configuration file /usr/local/etc/mDNSResponder.conf and fill it:
"Home Time Machine Server" _afpovertcp._tcp local. 548
Start the service:
/usr/local/etc/rc.d/mdnsresponder start
By default, Time Machine only allows you to use an AirPort-based system if you want to backup your data throught your network. So we need to ask it politely to enable the support for every network drive. Grab your terminal and type:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Since filesystem provided by FreeBSD is not quite compatible with Time Machine, you have to create your own file system image. Use Disk Utility to create image:
ifconfig en0 result in ethernet line - without
colons. For example: jf010203040506. Always use ethernet interface.
Wireless interface won't work.)Resulting file should have .sparsebundle extension. Copy it to your remote FreeBSD drive and you're done.