Skip to content

Instantly share code, notes, and snippets.

@betweenbrain
Last active April 13, 2024 14:36
Show Gist options
  • Save betweenbrain/35ecd58fab80be31b33eeab9cf9fdee2 to your computer and use it in GitHub Desktop.
Save betweenbrain/35ecd58fab80be31b33eeab9cf9fdee2 to your computer and use it in GitHub Desktop.
Mac backup to Linux NFS via Time Machine

Host

$ sudo apt update
$ sudo apt install nfs-kernel-server
$ sudo mkdir /mnt/nfs -p
$ sudo chown nobody:nogroup /mnt/nfs
$ sudo chmod 777 /mnt/nfs
$ sudo nano /etc/exports
  • add something like /mnt/nfs 192.168.1.101(rw,sync,no_root_check,no_subtree_check)
$ sudo systemctl restart nfs-kernel-server

Client

$ sudo mkdir /private/nfs
$ sudo mount -t nfs -o resvport,rw 192.168.1.106:/mnt/nfs /private/nfs
  • Create disk image using Disk Utilities, mount it.
$ sudo tmutil setdestination /Volumes/MacBackup

References

@knowname
Copy link

Thx! This is what i was looking for. I guess you didn't run benchmarks, but do you have a feeling if its slower/faster/same in comparison to a time machine backup via SMB?

@panzeyu2013
Copy link

samba

Not really, this is mounting it manually (maybe you can write a script to automate the process but it's still a manual process nonetheless) whereas Mac natively supports backing up to a samba destination.

any solutions besides scripts in 2024?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment