Time Machine Backup to Linux via Netatalk

An early attempt to make Leopard's Time Machine back up to a Linux server using Netatalk and Avahi.

From the archivesWriting from an earlier age of the Internet, recovered from holyarmy.org.
Editor's note, 2026: These instructions target Mac OS X Leopard, Ubuntu 7.10, and an unsupported Time Machine configuration. The follow-up article records that this backup later failed.

So, when I got the upgrade from Tiger to Leopard on my MacBook Pro, I was looking for a good backup solution. I’ve used rsync in the past, but when I saw that Apple had a new Time Machine backup tool, I was curious to give it a shot. The catch is you basically needed an external USB or Firewire drive, until they recently came out with the Time Capsule. Anyway, tonight I got the itch to really see if I could make Time Machine work without buying extra hardware. I mean, seriously, I’ve got a good hunk of mirrored disk sitting on my home server; that seems like a good place to do backups.

Some googling found me a blogger who’d done it!

I’ll make my own version of this post, since I had a few differences from the original where I found the info.

First, netatalk is the Apple File Protocol server for Linux. My home server is running Ubuntu Linux 7.10 Gutsy Gibbon release. The default Debian/Ubuntu netatalk package doesn’t cut it, though, as it isn’t compiled against SSL, and Leopard has more stringent security requirements than its predecessors, so we have to custom compile a more secure version of netatalk. (Yes, you could reduce the security requirements, but I’d rather not.)

  1. Follow the instructions in this Ubuntu forum post to compile and install netatalk. After, run echo "netatalk hold" | sudo dpkg --set-selections to ensure that your package is not auto-upgraded (thus breaking your install).
  2. Edit the netatalk configuration to include your backup storage location. The file /etc/netatalk/AppleVolumes.default is where the file server paths are configured. The last line of the default config grants access to home directories and looks like ~/ "Home Directory". You’ll need to add a line specifying where you are storing your backups; mine looks like /backup/time_machine/ "Time Machine". Note: I removed the “Home Directory” line, as in general I’m happier using CIFS (Samba) to access my network shares.
  3. Modify Avahi/Zeroconf to advertise AFP so that Mac Bonjour will see the file server. I followed these directions exactly.
  4. Each Mac user needing access to the server has to have a corresponding user on the server, and each user needs a .passwd file in their home directory. Follow these instructions for Ubuntu only as it explains the creation of the .passwd file. Note: This is not needed, as far as I can tell, so I wouldn’t do it. I don’t like the idea of having my password in plaintext on my server.
  5. Create a file named .com.apple.timemachine.supported at the root of the intended shared backup volume. (Discussed here in more detail.)
  6. On your Mac, open a Terminal window and type: defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

I rebooted, but it might not be necessary. After a bit of time, my server showed up under the “Shared” section in Finder’s left column navigation window. I did have to type in my username and password to get it to work, which can be saved in the keychain.

I added my other common shared folders (which I’d previously been accessing via Samba/CIFS). Now I’m backing up with Time Machine AND using my shared files via AFP. My Mac is happy, and I am too.

(See the next post for explanation of strikeouts, but note, I don’t recommend you do the struck-out actions.)