Zit Seng's Blog

A Singaporean's technology and lifestyle blog

Time Machine Setup On CentOS 7

Some of us Mac users who are also Linux users might have a Linux box server sitting at home. I have one that has mostly been relegated to the role of a network attached storage, although I still do various other odds and ends with it. Why not also consider it for a network Time Machine job for my Mac backups?

_DSC0715

I’ve been lazy and put it off for some time. I did get my Linux box to work as a AFP share. I had some needs for it to be AFP, in particular, and not SMB. I wrote a short AFP and SMB tutorial for CentOS 7 some time back. Getting it serve as a Time Machine server builds upon that AFP portion, since Time Machine requires AppleTalk.

This tutorial is about setting up a network Time Machine server. I won’t repeat the core steps of AFP in here, so please refer to my previous tutorial. You can skip the SMB specific steps if you don’t want SMB. Make sure your AFP is working properly first before starting on these steps.

First, add the Time Machine volume to /etc/netatalk/afp.conf:

[Time Machine]
path = /media/nas/timemachine
valid users = tmbackup
time machine = yes

Change the path above as you need, as well as the local (on the Linux machine) user that owns the volume if needed.

Next, put the following line in /etc/netatalk/afpd.conf:

- -transall -uamlist uams_randnum.so,uams_dhx.so,uams_dhx2.so -nosavepassword

Add the following line to /etc/netatalk/AppleVolumes.default:

/media/nas/timemachine TimeMachine allow:tmbackup options:usedots,upriv,tm dperm:0775 fperm:0660 cnidscheme:dbd volsizelimit:500000

Change the path and user to match what you had used before. The volsizelimit parameter sets the size that Time Machine will use. The value is in MB, so in the above example, the limit is 500 GB.

Create the actual directory for the volume.

$ useradd tmbackup
$ mkdir -p /media/nas/timemachine
$ chown tmbackup:tmbackup /media/nas/timemachine

Take care, again, to change the path and user as you need.

No new firewall configuration is needed, since you already have AFP running properly.

Restart Netatalk and Avahi.

systemctl restart avahi-daemon
systemctl restart netatalk

That’s it.

Next, go to your Mac. Open up System Preferences, go to Time Machine, then click on Add or Remove Backup Disk. You should find your new network Time Machine listed in the Available Disks list.

Leave a Reply

Your email address will not be published. Required fields are marked *

View Comment Policy