OS X Lion Time Machine backup to Debian
When OS X Lion was released I was eager to try out the updated FileVault and Time Machine features. Moving from an encrypted home directory to true full-disk encryption was a dream. I was also quite excited to find out if the new implementation of FileVault would work well with Time Machine.
I’d previously set up a Time Machine volume on my Debian file-server by installing netatalk and avahi.
Unfortunately, it seems OS 10.7 (Lion) requires netatalk 2.2, which is currently in beta. However, it’s quite simple to install the beta version of the package and it seems to run just fine.
To install netatalk 2.2~beta4-1 you’ll need to add the following line to your /etc/apt/sources.list file:
deb http://debian.oregonstate.edu/debian sid main
You can also use any of the mirrors listed here if they’re closer.
Then run the following commands to install or upgrade netatalk:
$ sudo apt-get update $ sudo apt-get install netatalk
If you had a previous install of netatalk it may detect changes to your local configuration files. By default the installer will keep the local copies of your files. This behavior is fine in this case.
After the install has finished run $ dpkg -s netatalk | grep -i version to ensure it was successful.
The netatalk service will be restarted by the installer after it completes. You may need to give it a few seconds to spin back up before trying to connect to it.
Your Time Machine backups in OS X Lion should now work correctly!
At this point you may want to comment out or remove the line you added to /etc/apt/sources.list so that you don’t inadvertently upgrade other packages to an unstable branch. After removing the line simply run $ sudo apt-get update one more time.
Update: Found the official Netatalk documentation.
Update 2: Here is the contents of both my afpd.conf and AppleVolumes.default files.
34 comments
Trackbacks/Pingbacks
- How to build an 8 TB RAID5 encrypted time capsule for 500 Euros « funky code - [...] that your shiny new DIY time capsule has stopped working since you upgraded your Macs to Lion. This blog ...
- Updating to netatalk 2.2 - to support Lion clients (for those wanting to run AFP Server on ATV) ? « Stm Labs Forums - [...] Apparently per this http://www.tristanwaddington.com/2011/07/debian-time-machine-server-os-x-lion/ [...]
- Two apples in a pod and those other guys » Blog Archive » Debian AFP server for OS X Lion - [...] http://www.tristanwaddington.com/2011/07/debian-time-machine-server-os-x-lion/ [...]
- How do I back up a bunch of OS X machines via TimeMachine without buying a bunch of Time Capsules? - Admins Goodies - [...] netatalk on a Linux or *BSD box; see http://www.tristanwaddington.com/2011/07/debian-time-machine-server-os-x-lion/ among other guides out there. This would be fine if ...

Thanks for the instructions. I was able to successfully upgrade netatalk to 2.2 beta4-1, but Lion still gives me the same error “The network backup disk does not support the required AFP features.” Any idea what else I might need to check?
ah- nevermind. I got it figured out. I reconfigured netatalk and avahi using the instructions here http://www.bootc.net/archives/2010/11/07/apple-time-machine-and-netatalk/. I had used an older method of originally setting up my Time Machine.
Thanks for instructions on upgrading netatalk to 2.2!
Thanks for the info Dennis. I’m glad you were able to get it working! I’m planning on posting my netatalk config files later today when I get home from work.
Unfortunately, this didn’t work with the Lion GM or the released version. I could mount the shares I need, but whenever I tried to run Time Machine I get the following error:
\The network backup disk does not support the required AFP features.\
What I ended up having to do was add \options:tm\ to the Time Machine share line in AppleVolumes.default *and* deleting /etc/avahi/services/afpd.service, since Netatalk 2.2 now advertises itself.
Thanks. Deleting deleting /etc/avahi/services/afpd.service worked for me. I had Yum’ed Netatalk 2.2, and the older recipes for setting up afpd were apparently written prior to this change.
Thank you. It worked a treat on my Ubuntu server. Presumably a full stable release of netatalk 2.2 will be available soon.
Hi,
I am using Ubuntu 10.4 and I have done what you explain and now the time machine backups work as before installing Lion on my mbp
The only thing is to remove the /etc/avahi/services/afpd.service file so the afpd is announced by netatalk directly.
I have 2 disks exported that keep working fine and a backup disk that is displayed in the mbp as a time capsule.
Thanks a lot for the instructions.
Best regards.
Thanks for the tip Javier! I’ll try shutting down avahi and see if my AFP mounts still work without it. If so, I’ll probably just uninstall that service.
I tried temporarily stopping the avahi-daemon service and my server disappeared from finder on my Mac. I guess I might need to configure the AppleTalk support in netatalk? I just restarted avahi for now.
It seems like there will be no final release of netatalk/2.2 — http://www.netafp.com/open-letter-to-the-netatalk-community-501/
Terrible news! The open source community needs to step up their game. Although I can understand how hard it must be with a fairly obscure package like netatalk.
Thank you for this walkthrough, Tristan! I’d like to note that this works just fine on my Ubuntu 11.04 (64 bit) server.
I had tried doing this same sorta process a few years ago, and while at first I was able to get time machine to back up to my Ubuntu server, after a few days or weeks, all of a sudden Time Machine would complain that the backup disk was messed up or something. I recently decided to try it again, and found a note that this can happen if the Mac goes to sleep while backing up. The recommendation was to not back up while on battery power (I already have my MBP set to never sleep when powered from the wall). Hopefully this will prevent that from happening!
Thanks again.
Thanks Chris, glad you found it useful!
I followed your instructions and was able to back up OS X Lion to my server, however when i click on Enter TimeMachine to browse it i sometimes see the following:
1) The operation can’t be completed. An unexpected error occurred (error code -6584).
2) Connecting to server window comes up however it does not go into timemachine, literally nothing happens at all.
Hey Andre, I’m not familiar with that error. Did you previously have a working Time Machine server configured on your Debian server?
Tristan,
Yes, it was backing up perfectly prior to Lion. I think my problem was that i was moving around the sparsebundle file and the name of my freshly installed machine with Lion on it was the same when Snow Leopard was on it. Not sure if that had anything to do with it which may have corrupted the file. Ultimately i reinstalled Lion and reverted my pool since as i’m using zfs and currently i’m in the process of transferring the users from the backed up timemachine sparsebundle.
Hi,
Once I install netatalk 2.2, from TimeMachine I get the following error:
“The server may not exist or it is unavailable”
If I go back to netatalk 2.1, I get the original “AFP features not supported error”
Will be really glad if you could help.
Are you running Netatalk on a Debian or Ubuntu server? If you type
sudo service netatalk statuson your box what is the output? If the service is running and your Mac can see the server, I would imagine something is funky with your timemachine mount. It’s possible the permissions are messed up.I am using ubuntu 11.04. Its working now. I tried the suggestion in the comments, to shut down avahi and it worked.
So I went to the logs to find out the reason, and apparently it is because there is a Name Collision.
afpd[9598]: Failed to add service: Local name collision
Thanks for your help bud.
In my case, the collision was with /etc/avahi/services/afpd.service, which was left over from the Snow Leopard time machine setup.
It works! I think the crucial step for me involved the removal of the avahi afpd.service (but, for some reason, stopping avahi made the server disappear from Finder!)
Before that I had compiled and installed 2.2b4 from source but I was still getting the missing AFP features error, annoyingly. I reinstalled as you wrote (from debian this time) and let the installer replace all my config files and then removed afpd.service and it appears to be working
Thanks for the post. I was at a loss before I found it!
It works also for me : Thanks!
Short 10 step Summary about my steps
0) Comming from 2.6.38-8-server (ubuntu)
1) Follow this instruction earlier (with SL on my MBP) : http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/
2) Add “deb http://debian.oregonstate.edu/debian sid main” to /etc/apt/sources.list
3) $ sudo apt-get update
4) $ sudo apt-get install netatalk
5) dpkg -s netatalk | grep -i version
6) remove “deb http://debian.oregonstate.edu/debian sid main” to /etc/apt/sources.list
7) sudo apt-get update
8) The install script asked me what to do with the “/etc/netatalk/afpd.conf” and “AppleVolumes.default” files. I let the script go. It saves my previous versions to “.dptg-old”. I moved them back to be active without chaining anything within them.
9) Change “options:upriv” (coming from step 1) to “options:tm” *Important:without it does not work!
10) deleting /etc/avahi/services/afpd.service (I renamed it)
TX
Nice summary! However, I wouldn’t delete afpd.service. Instead I would call
$ sudo service avahi-daemon stopor$ sudo apt-get uninstall avahiif you really don’t want it.I was suffering with the ‘AFP features…’ error message, too. I followed your way to solve the problem, then it works! Thanks!
If someone get some error massage at the step 3, try this.
http://en.kioskea.net/faq/809-debian-apt-get-no-pubkey-gpg-error
Great information here but can you tell me if I can update to the 2.2 N/talk whilst I am still on Ubuntu 8.04 LTS. I need it to get my Time Machine backing up as normal prior to Lion. Currently using 2.0.3
I have as follows…..
System hostname Media-Server.com
Operating system Ubuntu Linux 8.04.2
Webmin version 1.560
Kernel and CPU Linux 2.6.24-29-server on x86_64
Processor information Intel(R) Xeon(R) CPU 3065 @ 2.33GHz, 2 cores
Appreciate your thoughts,
Michael in Manchester UK
Hey Michael, I can’t comment on the exact requirements of Netatalk 2.2, but when you apt-get install the new version it should install and/or upgrade any required dependencies as well. After adding the new source you can run apt-get show netatalk and it should give you information on the new version and its requirements.
I have done what you have said as I also followed this tutorial: http://www.bootc.net/archives/2010/11/07/apple-time-machine-and-netatalk/
But now I cannot connect to the AFP server… Any guesses?
Went through this tutorial and it’s now working. http://ubuntuforums.org/showthread.php?p=11101453
And it creates a .sparsebundle for you so no need to do that
http://i.qyk.in/JOWkX.png
Hi Tristan and All,
Tristan thanks you very much. I’ve followed a few site to get this far and yours has been the most useful thus far for Lion.
I have followed you instructions above and blended it with some others.
I have the contents of my /etc/netatalk/AppleVolumes.default looking like below, though i have tried a few different configurations:
# By default all users have access to their home directories.
~/ “Home Directory”
“/media/Iomega HDD/TimeMachine” TimeMachine cnidscheme:dbd options:usedots,tm
and i have placed a sparse bundle on the drive using script (makeImage.sh) I found on another site http://www.insanelymac.com/forum/index.php?showtopic=184462
I’ve added the Avahi daemon from the site http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/
and this has allowed my mac to think it can backup to the disk. However it seems there is nothing being copied to the TimeMachine folder. Total size is about 5.7Mb. Also it seems my machine cannot enter time machine.
Any help would be much appreciated.
Matt
Hey tristan,
thank you so much for your tutorial. It works now really fine and now I can save my data again on the normal way!
thx mate
Michael
Hey, I was wondering is there a source for 2.2.1 yet? I just followed this guide, and I am already out of date (:, so I was wondering what you did. TM is working great now after fiddling with it for hours, so I was just wondering how to get the latest version. I tried compiling from the tarball on their website, but I get some array errors on the ldap.c file, so are there any apt sources I can use to get 2.2.1?
I’ve tried this a bunch of times, and can’t make it work on my Ubuntu 11.10 server. However, it works perfectly on my Ubuntu 11.10 workstation.
When I try to connect to the server, I get \The version of the server you are trying to connect to is not supported…\
So, if someone knows of a difference between the server and workstation configuration, I would appreciate their insight. If not, I would appreciate some help in completely removing the setup from my server (including config files) so I can start over.
Thanks in advance.
g2
Grim2, I’m getting the exact same problem, however i’m still on 10.04 ubuntu server.
this worked great until I allowed 11.10 desktop update to run, now I am getting the server does not exist or is not available error. I installed 2.2.1 and it did not change the behavior. I am still using my old config files that worked with 2.2b4, is a syntax change involved? same whether avahi is on or off. shows in sidebar fine with avahi running.
any ideas?