Category: backups

How-to Use a Linux Server for Time Machine Backups

How-to Use a Linux Server for Time Machine Backups

Well, this desktop machine is becoming more of a server than anything else, so, I followed this guide to create the backups of my Mac Book Pro using my home network to a 3 TB hard disk attached to the desktop Ubuntu Linux, before setting up the server I created myself a LVM volume following this great guide in the book (see chapter Storage and Management Backup):


Prepare the disk

I created a LVM volume and the final result is:

$ sudo pvdisplay /dev/sdd1
 --- Physical volume ---
 PV Name /dev/sdd1
 VG Name timeMachine
 PV Size 2.73 TiB / not usable 4.42 MiB
 Allocatable yes (but full)
 PE Size 4.00 MiB
 Total PE 715396
 Free PE 0
 Allocated PE 715396
 PV UUID 6pVk0Z-7XhB-SwtB-TYaQ-WG0d-YafZ-rG0uPP


$ sudo vgdisplay timeMachine
 --- Volume group ---
 VG Name timeMachine
 System ID 
 Format lvm2
 Metadata Areas 1
 Metadata Sequence No 2
 VG Access read/write
 VG Status resizable
 Cur LV 1
 Open LV 1
 Max PV 0
 Cur PV 1
 Act PV 1
 VG Size 2.73 TiB
 PE Size 4.00 MiB
 Total PE 715396
 Alloc PE / Size 715396 / 2.73 TiB
 Free PE / Size 0 / 0 
 VG UUID GPj6BC-Zopo-4i3p-jl7t-H1pk-dNtm-hpmqRK

Setting up a server

The next step is to use the following article by Sam Hewitt:

How-to Use a Linux Server for Time Machine Backups

A comment here is that after executing:

cd netatalk-debian

it is necessary to execute first ./configure and then make


After a successful backup I was not able to backup again, Mac showed an error message that the disk was unavailable, for some time my workaround was to restart the server daemon with:

$ sudo systemctl restart netatalk.service

That allowed me to make a new backup again, but restarting the service everytime, seems that for a permanent solution this need to be done in System Preferences


In options select “Share files and folder using AFP”, keep disable the SMB selection if you don’t need to share file with Windows machines.
Now I can just repeat the backup process without restarting the server


Also this file needs to be added:

[mavila@marco-workstation-amd 20:59:26] ~ $ cat /etc/avahi/services/afpd.service

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->

<!DOCTYPE service-group SYSTEM "avahi-service.dtd">


 <name replace-wildcards="yes">%h</name> 

 <service> <type>_afpovertcp._tcp</type> <port>548</port> </service> 

 <service> <type>_device-info._tcp</type> <port>0</port> 




[mavila@marco-workstation-amd 20:59:41] ~ $ 

And it simply works. Nice