Dec 312013

tux-tmIt took me quite a lot and quite long time of experimenting before finding the proper way to do this, especially considering that Mavericks is a bit different from the previous felines… and that I was using Debian Squeeze…

I’ve finally been able to achieve it (and testing with file restore also), hence I’ve decided to document here my configuration hoping it will be of some benefit for others.

To be clear: this is a document to build a backup system “à la Time Machine” for your Mac based on Mavericks OS X 10.9.1 using a file share on Debian Linux and AFP protocol.

First of, some statements about false/deviating info I’ve found on other sites:

  • You cannot use AFP with Mavericks, since it defaults to SMB2 ==> not true. I have a working configuration using AFP
  • You can use whatever Debian/Ubuntu version, at worst you just tune your config ==> not true. At least not for me. It all started working when I moved from the previous Squeeze Debian (6.0) to the latest greatest Wheezy (7.0)
  • It’s hard to configure the stuff, requires programming/scripting. Not true. Sure, you need to modify some configuration files on your Linux box… but if you are not able to vi some files, maybe you should think to have another operating system.

As said, please ensure your Debian Linux is at version 7.0 (Wheezy). If not, you should really consider to upgrade. It’s free, well documented, easy and it will save you tons of days and headaches trying to make bits behave 🙂

Second, ensure that the following two packages are installed:

  • netatalk ==> to have your Linux talk AFP (Apple Filing Protocol) natively
  • avahi ==> to have your Linux saying “bonjour” to an Apple networked machine. This is optional, since netatalk seems to include it in recent versions.

After upgrade to wheezy, I’m at the following releases (you can check with dkpg -s <package name> command):
netatalk is at version 2.2.2-1
avahi is at version 0.6.31-2

Now suppose that you want to backup your Mac to your Linux, where you have a shared disk bigger than your Mac internal HDD mounted in /media/mybigstuff.

First operation is to share this disk via samba, so that you can access to it from your Mac. I’m not detailing here how you should handle permissions and restrictions to user. Here’s what you should append to your /etc/samba/smb.conf file:

   comment = Time Machine
   path = /media/mybigstuff
   browseable = yes
   writeable = yes
   read only = no
   guest ok = yes

Restart Samba service with command “service samba restart” to take new configuration into account.

Second, ensure you have a user on your Linux with same credentials of your Mac. Although not mandatory, this will greatly simplify operations. If you have a user called Appleseed with password AppLove on your Mac, issue the following commands in your Linux box to create a similar user:

useradd -d /home/appleseed -s /bin/bash -c "John Appleseed" Appleseed
mkdir /home/appleseed && chown Appleseed /home/appleseed && passwd Appleseed
New password: <type AppLove>
Retype new password: <re-type AppLove>

Now you should try to access to the Linux system from your Mac using samba protocol. From Finder, press CTRL+K and type in the appearing window the following string:



then click Connect (or + to add to the Favorites).

When prompted to authenticate, insert your password (and optionally flag to save it to Keychain) as shown below:


When the Finder window with the mounted drive appear, close it (was just to test that we did everything ok so far 🙂 )

Using Terminal, connect to your Linux box and edit the file /etc/netatalk/AppleVolumes.default and paste the line below at the end of the file:

/media/mybigstuff "MyTimeMachine" allow:Appleseed options:usedots,upriv,tm cnidscheme:dbd volsizelimit:640000

What you instructed Netatalk to do is basically the following: make /media/mybigstuff available as MyTimeMachine to user Appleseed as a TimeMachine volume of max 640Mb size.

Restart Netatalk service with command: service netatalk restart

Because this is not exactly an official Time Machine volume, we need to instruct our Mac to be a bit more tolerant.

Open Terminal and type the command

defaults write TMShowUnsupportedNetworkVolumes 1

Go into Time Machine, activate it and choose the disk you just defined as a backup disk, as shown below:


Optionally choose to encrypt the backup and confirm clicking “Use Disk”

Authenticate once and forever when prompted… et voilà, your system is now ready to perform backups onto the Linux share.

Enjoy and… remember to share your comments to confirm the beautiful experience, or correct mistakes I could have made in describing my setup!


  23 Responses to “Backup your Mavericks using Debian Linux as a Time Machine”

  1. Hey RoarinPenguin,
    Thank you so much for the run down, I had be stuck trying to do this for some time! 
    Just one thing when you create your new users on the linux box you need to set their smbpasswd and not just create a linux passwd.
    Thanks again! 

  2. …or have Unix authentication for Samba users, or set share level access without password.

    Thanks for the useful hint!


  3. /etc/netatalk/AppleVolume.default or /etc/netatalk/AppleVolumes.default ? Plural I believe.

  4. Oh yes, plural indeed! Thanks for the correction, which I’ll integrate in main post immediately.

  5. Sorry, i don’t get it. What is the samba-share for? Why don’t you just only use AFP via netatalk?

  6. Oh, and what filesystem do you use for the backup-volume? Is there anything important about that?

  7. Because I need to access to the share from other OS also…

  8. No, as long as it supports the filenames you wanna use.

  9. This stops the computer working as a samba server though as now OSX only sees the Netatalk shares.

  10. Did you try checking in samba log file if any error is there? Did not happen to me…

  11. I was able to get this working much more easily using Ubuntu Precise (12.04).

    1) install avahi-daemon (apt-get install avahi-daemon)
    2) ensure avahi-daemon is started
    3) install netatalk (apt-get install netatalk)
    4) execute command you specified on laptop “defaults write TMShowUnsupportedNetworkVolumes 1”

    I’m not sure you even need #4, but I had already run it when I did the following:

    5) edit /etc/netatalk/AppleVolumes.default

    The last few lines of the file look like this.

    # By default all users have access to their home directories.
    ~/ “Home Directory” options:tm

    # End of File

    All I did was add options:tm to the “Home Directory” line.

    6) restart netatalk

    You should now see your server appear if you open finder (or click on the desktop), hit command-k and click “browse”. Click on your server, click on “Home Directory”. You should now be prompted for your user login for the server. Enter credentials.

    You have now successfully mounted your home directory via AFP.

    You may now select “Home Directory – servername” in Time Machine.

  12. Great comment John! Many thanks!

  13. It works ! I’ve searching for a while and you guys finally make it work !!!

    I use Ubuntu 14.04 and OS X 10.9.3 (Mavericks)

    Thanks You Very Much !!!

  14. You wanted to thank you quickly. This works perfectly.
    As I have a dual-solution, I can be sure that I have an ‘officially supported’ backup on an external USB 3.0 drive but I can also access my files from Windows and Linux from my Debian backup server.

    Again, thanks a lot 🙂

  15. What you instructed Netatalk to do is basically the following: make /media/mybigstuff available as MyTimeMachine to user Appleseed as a TimeMachine volume of max 640Mb size.
    Feeling a bit of a “grammar nazi” here, but you meant 640MB right? (megabytes, not megabits) Just to kill some confusions.

    Thanks a lot for the easy howto though! I’ve set it all up through ssh from work and will try if it works when I get back home.

  16. Thank you for trying this. Happy that it worked!

  17. Yeah, megabytes was naturally what I was meaning.
    Thanks for the hint!

  18. […] is a very useful guide here which you can follow step by step and now all our machines have a proper backup. No more hard disks […]

  19. I’m puzzled, i followed as you did (changing only some names), but i now have 2 mounted volumes (MyTimeMachine, and one named after my username) and i can’t write to either of them. Also, one is 99 gigabytes in size and the other is 1,9 gigabytes in size…

    can you help me?

  20. I couldn’t get my Mac to authenticate and open the server (I’d be having issues since El Capitan in this respect). Instead of smb://192.168.x.x/TimeMachine – use the afp protocal and open afp://192.168.x.x/TimeMachine – worked like a charm. These instructions are great!

  21. Thanks for your info!

  22. Hey thanks, this was extremely helpful in setting up TimeMachine on my RaspberryPi. A lot cheaper than an Airport!

  23. Thanks for the perfect guide!

    Have you got some specification on the volsizelimit option? According to though, the volsizelimit is 1000 for 1GB, so your setup is 640GB and not 640MB.
    Just if someone was depending on this limit 🙂

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>