Apple Time Machine backup targeting Linux or Proxmox LXC

My old AirPort Time Capsule will not work with the new version of Mac OS 27 and since I really would like to have a local backup, besides iCloud, the tinkering started.

It ended up with a Linux solution and an external USB disk, 2 Tb.

I will show "how to" create a target for the Time Machine(TM) backup with a standard Linux host or with a Linux container in Proxmox.


Standard setup
In a Debian or Ubuntu distro you use "apt" to install Samba, filesharing, and avahi, zeroconf.

sudo apt update
sudo apt install samba avahi-daemon

and then add an user. Keep it simple and use the same user name as in Mac OS

adduser mac_user


The USB disk is partitioned as below

lsblk

:

:

sdb   8:16   0   1.8T  0 disk 

├─sdb1    8:17   0 186.3G  0 part => Backup

├─sdb2    8:18   0   1.4T  0 part => Files

└─sdb3    8:19   0 279.7G  0 part => Time Machine


create a directory for the TM backups

mkdir -p /mnt/timemachine


in a home eviroment you can make it simple 


chmod -R 777 /mnt/timemachine 

mount /dev/sdb3 /mnt/timemachine

configure Samba with "nano /etc/samba/smb.conf " and add the following at the end

 [TimeMachine]
    path = /mnt/timemachine
    valid users = mac_user
    writeable = yes
    fruit:time machine = yes
    vfs objects = catia fruit streams_xattr

You also have to add the "mac_user" to Samba with 

pdbedit -a mac_user


and restart Samba with "sudo systemctl restart smbd "
On the Mac open TM "System Settings => General => Time Machine", add the created server
and take your backup.

Proxmox LXC setup
In Proxmox I created a Debian LXC, container id 207, and on the Proxmox host executing the following commands

mkdir -p /mnt/timemachine

chmod -R 777 /mnt/timemachine 

mount /dev/sdb3 /mnt/timemachine

pct set 207 -mp2 /mnt/timemachine,mp=/mnt/timemachine


On the LXC guest check the added disk with "df -h" and then
sudo apt update
sudo apt install samba avahi-daemon
adduser mac_user

and add the Samba config as above. On the Mac add the created server and do the backup.

Latest Samba ?
In Debian you can add Backports to get the latest version.

nano /etc/apt/sources.list => and add => 

deb http://deb.debian.org/debian trixie-backports main

apt update

apt install -t trixie-backports samba 


This was done due to that there been some changes in TM which is covered in the latest Samba.

To be continued !

Comments

Popular posts, last 30 days

NetworkManager on Raspberry, easy start

Underfloor heating with PID controller, Node-RED

Home Assistant with VirtualBox or Proxmox or Linux KVM ???

Raspberry Pi OS Lite with GUI, RDP, VNC, Chromium

iCloud drive sync, or mount, with a Linux, Ubuntu, device

Installing Ubuntu 24.04 or 24.10/25.04 on an old MacBook Air(2011)

AIS receiver and dispatcher ! The best ?!

Homebridge made simple, HOOBS

Raspberry Pi 2, 3, 4, 5 USB SSD or USB drive boot

Clone the Raspberry boot disk