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.
In this post 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. The most convenient way is to use the same user name as
in Mac OS
My 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
For the TM backups I created a directory
mkdir -p /mnt/timemachine
in a home server environment 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
Add the "mac_user" to Samba with
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 then executing the 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 continue with
sudo apt update
sudo apt install samba avahi-daemon
adduser mac_user
Then add the Samba config as above. On the Mac add the created server
and do the backup.
Mount surviving a boot
If you want to make the "mount" to survive a boot you have to add, in the host, the disk in "fstab". Get the UUID for "sdb3", in my case, with "lsblk -f", and then
nano /etc/fstab and add
UUID=your-disk-uuid /mnt/timemachine ext4 defaults 0 2
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.
Comments
Post a Comment
Feel free to leave a comment ! ... but due to a lot of spam comments I have to moderate them. Will reply ASAP !