Setting up Time Machine to back up over the network to a linux server is now fairly straightforward, since release 2.0.5 of netatalk, the FOSS implementation of Apple’s AFP network file protocol supports time machine volumes out of the box. For this to work, you’ll need a linux computer that’s connected to the same network as your Mac, the latest (2.0.5 at the time of this writing) version of netatalk, which is probably available in your distrobution’s repositories, and the latest avahi.
First, obviously, install netatalk and avahi. You’ll need to set both up so that you announce the share over avahi for your Mac to easily pick it up. Configuring afp is fairly straightforward. Open /etc/netatalk/AppleVolumes.default, and scroll to the bottom. Comment out the ~ line and add the following:
where /path/to/folder is the path to the folder you want to store the TM backup in and share_name is how the Mac will identify the mount. It can be at most 27 characters and must be enclosed in double quotes if you want spaces in the name, apparently. The options:tm bit tells afpd that you’re going to be using the mount for time machine backups.
Now you need to set up avahi as well. In most modern distros this is straightforward, just install it and start the avahi-daemon daemon. You’ll need add a service description for the AFP share; This is an XML file containing information about the AFP share that avahi will publish to any computers on the network. The service files are usually located in /etc/avahi/services. Here’s the one I use. Change name and host-name as necessary; if you’re not using zeroconf on your network use the ip address of your linux box instead.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
The model=Xserve gives the share an Xserve raid icon in Finder; presumably you could also use model=MacPro or the like if you want something different.
Now then, restart avahi-daemon and afpd, and see if you can at least access the share in finder. You’ll need to log in with your unix username and password, so before we proceed make sure the folder you’re using for backups is writable by the user you’ll log in as. If you don’t see it in finder, try going to connect to server and use afp://ip.of.server to see if it will connect that way; sometimes OSX is a little slow to see new servers on the network.
Once you’ve gotten the AFP server set up you’re almost there. To actually allow Time Machine to use the network share you need to do one final thing. By default Time Machine will ignore network volumes that aren’t time capsules, so open a terminal window on your man and run the following command:
Now make sure the AFP volume is mounted, and go to set up Time Machine as normal. You should be able to select the network share and start backing up. Now go grab some food or a nap, this will take awhile. Even over a gigabit ethernet connection it took about 4 hours for a 180GB backup.