Using Linux computer as time capsule - possible but any experiences?

I've had experience with this, and it does work with some fiddling, but it doesn't "just work" in the mac sense. Every now and then, you'll find that you have to reconnect the volume, restart a daemon, or else face weird time machine errors.

If you're okay with being this "hands on", you'll need to install Netatalk (AFP daemon) and Avahi (Bonjour daemon) on your Linux machine, and set a defaults option on your mac to allow Time Machine to use network drives.

This is the guide I used for setting such a system up: http://techiezone.rottigni.net/2013/12/backup-your-mavericks-using-debian-linux-as-a-time-machine/

Make sure you keep a close eye on it for your first few weeks - nothing worse than backups that aren't actually backing up!


This is a recipe that I used a long time ago on I think a raspberry pi that had a 3 TB disk attached to it. I have a MacBook pro and when it is connected to a power supply it does the backup even when it is closed. It worked for months until the hard drive died.

I should say that I have not tested this with Mavericks, but I can not think of changes that should prevent this from working. Restore worked fine even though I experienced that big partial restores sometimes seem to fail but this is not a peculiarity of the debian style time capsule. I had a time machine backup once just on a disk and a script that I wrote that had a variable like so test=/${bla} and rm -rf ${test} - CAN YOU GUESS - started deleting my root tree. Yes I am an idiot, but I learn from my mistakes. That is more than some people can say. Anyway, the restore of this did not work, it crashed somewhere and I restored important data by hand. But this was a time machine issue, it had nothing to do with debian.

I took it from:

http://routerjockey.com/2009/08/28/setting-up-apple-filing-protocol-and-bonjour-under-debian/

apt-get build-dep netatalk
apt-get install libcrack2-dev fakeroot libssl-dev
apt-get source netatalk

cd netatalk-2.2.2/
dch -v 2.2.2-2+SSL (enter ctrl+x y and enter)

DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot

cd ..
dpkg -i netatalk_2.2.2-2+SSL_i386.deb
aptitude hold netatalk


vi /etc/default/netatalk

    ATALKD_RUN=no
    PAPD_RUN=no
    CNID_METAD_RUN=yes
    AFPD_RUN=yes
    TIMELORD_RUN=no
    A2BOOT_RUN=no

vi /etc/netatalk/afpd.conf

add line at bottom:
- -tcp -noddp -uamlist uams_dhx_passwd.so,uams_dhx2_passwd.so

This was the old line that caused unsupported server problem:
- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh


vi /etc/netatalk/AppleVolumes.default

at the bottom add:
~/                 "Home Directory"   "$u"        cnidscheme:cdb
/data/music        mp3                allow:chris
3## This line is different from the tutorial in the link, as it did not work     without the tm option
/data/timemachine  TimeMachine        allow:chris cnidscheme:cdb  options:usedots,upriv,tm

I got the error on the Macbook: Something wrong with the volume's CNID DB, using temporary CNID DB instead.Check server messages for details!

After changing cnidscheme:cdb to cnidscheme:dbd the error went away.

/etc/init.d/netatalk restart

apt-get install avahi-daemon
apt-get install libnss-mdns

vi /etc/nsswitch.conf

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns

vi /etc/avahi/services/afpd.service

This file should contain:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
     <type>_afpovertcp._tcp</type>
     <port>548</port>
 </service>
 <service>
     <type>_device-info._tcp</type>
     <port>0</port>
     <txt-record>model=Xserve</txt-record>
 </service>
</service-group>


/etc/init.d/avahi-daemon restart

chown -R chris:chris /data/timemachine/
chown -R chris:chris /data/music

This worked for me and as soon as I have bought a Raid something I will redo the setup with my raspberry as it is the ideal compromise between performance and energy usage.