Saturday 24 November 2007

Forward to the past

So, you've got Leopard. You've got Time Machine. But alas, no external drive.

Not to worry - here's how you can backup your Mac over the network to your existing Linux server without mucking about with HFS+ or any other filesystem.

First, install netatalk and avahi on the Linux box.

Once you have those installed, configure netatalk using the following as a guide.

Turn off atalkd and papd in netatalk.conf:
# Set which daemons to run (papd is dependent upon atalkd): 
ATALKD_RUN=no 
PAPD_RUN=no 
CNID_METAD_RUN=yes 
AFPD_RUN=yes 
TIMELORD_RUN=no 
A2BOOT_RUN=no
Then, get atalk to use TCP only by editing afpd.conf:
- -noddp -advertise_ssh
Cool. Now, edit AppleVolumes.default and add the path to where you'd like to store the Time Machine backup(s):
/path/to/backup/dir "NAME OF VOLUME"
Restart atalk using something like:
# /etc/init.d/atalk restart
Great, that's atalk taken care of.

Configure avahi so that the Mac will automatically pickup the atalk share.

You only need to add an XML config file, netatalk.xml, in the avahi/services directory:
<?xml version="1.0" standalone="no"?>
<!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_afpovertcp._tcp</type>
    <port>548</port>
  </service>
</service-group>
Restart avahi using something like:
# /etc/init.d/avahi-daemon restart
Nearly there!!

Now your server is ready to go, we just need the Mac to connect up.

On your Mac, using Finder, click Go -> Connect to Server and put in the IP address of your server.

Click Connect.

This should prompt you for a username and password.

Once authenticated the Mac should now have this share mounted. ... and, finally, to allow Time Machine to recognise the network share: (thanks, Mike!)
$ defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
You should now be able to point Time Machine at your Linux share and backup your Mac over the network!