I recently upgraded my Mac to OS 10.7, at which point my Time Machine backups stopped working because Apple made some changes to the AFP client in 10.7. I did some research and figured out how to make it work. The information out there is a patchwork, so I decided to put this all in one place. If there are any errors or omissions, please let me know and I'll try to fix it!
Quick instructions first, then some detailed notes below.
- You'll need a newer version of netatalk. To install version the latest (2.2beta4, as of this writing):
- Edit /etc/netatalk/afpd.conf to allow guest login. This configuration line is the same as the default, with only uams_guest.so added.
sudo add-apt-repository ppa:stefanor/ppa
sudo apt-get update
sudo apt-get install netatalk
- Edit /etc/netatalk/AppleVolumes.default so it contains the following lines. Change "/mnt/TimeMachine" to a directory of your choice. Also, "username" should be replaced with username that you want to access the Time Machine volume.
- -tcp -noddp -uamlist uams_guest.so,uams_dhx.so,uams_dhx2.so -nosavepassword
- Create the TimeMachine directory, then set ownership and permissions so the user can back up.
~/ "Home Directory" options:usedots,upriv ea:ad
/mnt/TimeMachine "TimeMachine" options:usedots,upriv,tm ea:ad allow:username
- Add an entry to broadcast the shares with Avahi (Bonjour), so that the shares just show up for OS X clients. Create a file named /etc/avahi/services/afpd.service, with the following contents:
sudo chown username:username /mnt/TimeMachine
chmod 600 /mnt/TimeMachine
- Restart the services.
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
At this point, the shares should be visible from the Finder on the client computers. You should be able use the TimeMachine volume as a backup disk at this point. I don't remember the details here since I didn't need to redo this part, but it should be straightforward. If you need more information on how to do it, you should search for the terms "Time Machine sparsebundle".
sudo /etc/init.d/netatalk restart
sudo /etc/init.d/avahi-daemon restart
Unlike with previous versions of netatalk, you no longer need run this command on your Mac:
If you had set it to 1 in the past, I think you can set it back to 0 now.
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
In the AppleVolumes.default file, I added the "ea:ad" option. This tells it to use .AppleDouble directories instead of native extended attributes (xattrs). Version 2.1 added support for native xattrs if the host filesystem supports them (this is possible with ext3 and ext4), and even defaults to this. It may sound like a cleaner solution than using .AppleDouble directories for xattrs, but those directores apparently will still exist, for resource forks. Also, it seems to me that a lot of Linux tools don't really handle xattrs very well, so it's probably more reliable to stick with .AppleDouble directories. See this thread for more information.
The "cbd" database backend doesn't seem to be supported anymore, so the shares now use "dbd".
If you want more than one user to be able to access the Time Machine volume, the easiest way is to just use one account (on the server) for backups. If this isn't secure enough for your setup, you'll probably have to set it up with separate user accounts, but that's beyond what I have experience with.