4. Configuring the Raspberry Pi as a TimeMachine Backup

Important

This article is OUTDATED. Newer Samba distributions have incorporated the required functionality to act as a TimeMachine target disk. Netatalk is no longer required. I hope to update this page in the near future (Jan 2021)

Note

These Raspberry Pi topics are outdated. Be sure to check more current sources. I’m keeping this information here for reference and hope to update it during 2021.

The Raspberry Pi and derivatives are attractive low-cost alternatives to Apple’s pricey AirPort Time Capsule devices. Unfortunately, the version of Netatalk that ships with raspbian is 2.2.5-2 as of this writing. To get the full benefit of the current Netatalk feature set, it is necessary to upgrade to version 3.11. This page documents the steps I used to get Netatalk 3.1.11-1 up and running on a Rock64 single-board computer running DietPi, a stripped down version of raspbian. These steps should work on a Raspberry Pi 3, but the Rock64 offers USB3 for disk performance, and 1 Gbps Ethernet for network performance. The Rock64 is connected to a Gbps Ethernet switch serving my home network, and a USB 3 external drive bay housing a 3.5 inch 4 TB drive.

I am grateful to Daniel Lange and his excellent page summarizing steps he used to get this running on Linux and Adrian Knoth for the work he put into the Debian Netatalk packages. I have added additional steps for getting things running under raspbian for Raspberry Pi and derivative systems.

  1. Install the requisite development tools:

    apt-get install \
    build-essential \
    devscripts \
    debhelper \
    cdbs \
    autotools-dev \
    dh-buildinfo \
    libdb-dev \
    libwrap0-dev \
    libpam0g-dev \
    libcups2-dev \
    libkrb5-dev \
    libltdl3-dev \
    libgcrypt11-dev \
    libcrack2-dev \
    libavahi-client-dev \
    libldap2-dev \
    libacl1-dev \
    libevent-dev \
    d-shlibs \
    dh-systemd \
    fakeroot \
    licensecheck
    
  2. Download the netatalk 3.1.11 debian source code:

    git clone https://github.com/adiknoth/netatalk-debian
    
  3. Navigate into the debian source directory:

    cd netatalk-debian
    
  4. build the .deb installation packages:

    debuild -b -uc -us
    
  5. Install the new .deb packages:

    dpkg -i libatalk18_3.1.11-1_arm64.deb netatalk_3.1.11-1_arm64.deb
    
  6. Edit the netatalk configuration:

    nano /etc/netatalk/afp.conf
    
    Here's the configuration I used for a 2 TB network backup target::
    
        [TimeMachine for iMac]
        mimic model = TimeCapsule6,106
        path = /path/to/timemachine/
        time machine = yes
        vol size limit = 2000000
    
  7. Restart the netatalk service:

    sudo systemctl restart netatalk
    
  8. Verify the netatalk service is running:

    sudo systemctl status netatalk
    

Last edited on Aug 29, 2021. Last build on Aug 30, 2021.

4.1. Contact and feedback

You can find me on Reddit where I lurk in many of the raspberry pi-related subreddits. You can email me directly at projects@ttlexceeded.com