Entries Comments



Time Machine backup to Linux via Netatalk

24 January, 2008 (01:26) | Linux, Mac, Networks | By: benjamin

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 this link to a blogger who’d done it!
I’ll make my own version of this post, since I had a few differences from the original I 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 fileserver. 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 next post for explanation of strikeouts, but note, I don’t recommend you do the struck out actions.)

Comments

Pingback from Time Machine con netatalk | Jompeich d’er Bisente
Time: April 25, 2008, 1:44 pm

[...] por Google hay bastantes artículos con distintas soluciones que a unas personas les funcionan y a otras no. Finalmente la que a mi me ha funcionado [...]

Pingback from The Cult of Gary » Blog Archive » Time Machine, Netatalk and Error Code -6602
Time: January 8, 2009, 7:43 pm

[...] Over the Christmas break, I set time machine to backup my laptop to a USB drive attached to my Mythbuntu backend server. There are plenty of instructions out there on how to do this. I used this one. [...]

Comment from Doug
Time: November 20, 2009, 9:50 pm

Great write-up, thank you. Successfully set this up on my Debian box and Snow Leopard. No reboots were necessary.

Comment from Doug
Time: November 20, 2009, 11:07 pm

P.S. There’s some additional steps if you’re running Snow Leopard, which are outlined here: http://www.macosxhints.com/article.php?story=20090905212640957

Write a comment