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): 
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"?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
  <name replace-wildcards="yes">%h</name>
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 TMShowUnsupportedNetworkVolumes 1
You should now be able to point Time Machine at your Linux share and backup your Mac over the network!