Skip to content

Instantly share code, notes, and snippets.

@vaddieg
Last active November 11, 2022 13:56
Show Gist options
  • Save vaddieg/47538d297dc4f88fd9550e6c04be29dc to your computer and use it in GitHub Desktop.
Save vaddieg/47538d297dc4f88fd9550e6c04be29dc to your computer and use it in GitHub Desktop.
TimeMachine over SMB
Hardware:
---------
USB3 HDD, a Router with USB port and SMB file sharing
Prep physical disk:
-------------------
Format 1 Volume exFAT, connect to router
Share it via SMB in Router settings
Prep a disk image:
------------------
1. Create a sparsebundle with 1.5-2x size of your mac disk drive, band size should be reasonably large (~100MB-1GB)
to avoid SMB&exFAT stressing with millions of files. Save the image directly to the SMB share
sudo hdiutil create -size 750g -type SPARSEBUNDLE -imagekey sparse-band-size=1048576 -nospotlight -volname "SMBTimeMachine" -fs "Case-sensitive Journaled HFS+" -verbose /Volumes/my_smb_share/TimeMachine.sparsebundle
2. Mount .sparsebundle image
3. Set Time Machine destination
sudo tmutil setdestination -a /Volumes/SMBTimeMachine/
4. Make Finder alias to the TimeMachine.sparsebundle file (it resolves the SMB host and allows saving credentials)
5. Do the 1st backup (might take several hours)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment