- Login to your SMB with Finder, and save the password to Keychain.
- Create
timemachine-macbook.sparsebundleunder the SMB root directory.- You need to choose "Mac OS Extended (Journaled)", not "APFS", even if your MachintoshOS drive is APFS.
- Because such a buckup cannot be encrypted by TimeMachine, I recommend to set up disk encryption at this timing.
- If you set password, save the password as accountName =
TimeMachineSparseBundlePassin your login keyring. - ref. https://blog.fosketts.net/2015/07/22/how-to-use-mac-os-x-sparse-bundle-disk-images/
- Mount it to
/Volumes/TimeMachine. - Run
tmutil setdestination /Volumes/TimeMachineas root (withsudo). - Allow
securitycommand to access your keyring to automate mounting TimeMachine drive.security find-generic-password -wa TimeMachineSparseBundlePasssecurity find-internet-password -ws ***SMB HOSTNAME***- If you are prompted, always allow
securityto access these passwords.
- Save the attached
mounttm.plistandmkmountpoint.plistto local. - Rename
***xxx***points according to your environment. - Place
mkmountpoint.plistat/Library/LaunchDaemons/mkmountpoint.plist.- This file creates mount point for SMB under
/Volumes. - Execution of this command requires root permission.
- This file creates mount point for SMB under
- Place
mounttm.plistat~/Library/LaunchAgents/mounttm.plist.- This file creates mount point for SMB under
/Volumes. - Execution of this command requires root permission.
- This file creates mount point for SMB under
- Reboot the machine and check everything works.
Created
December 16, 2019 01:46
-
-
Save tomykaira/d9ea6edb67ddb085dd33358b99008718 to your computer and use it in GitHub Desktop.
How to set up TimeMachine drive on your NAS (but inefficient, slow).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.tomykaira.mkmountpoint</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/bin/sh</string> | |
| <string>-c</string> | |
| <string>mkdir -p /Volumes/timemachine-smb && chown ***YOUR MAC USER NAME*** /Volumes/timemachine-smb</string> | |
| </array> | |
| </dict> | |
| </plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.tomykaira.mounttm</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/bin/sh</string> | |
| <string>-c</string> | |
| <string>mount_smbfs "//***Windows UserName***:$(security find-internet-password -ws ***HOSTNAME***)@***HOSTNAME***/***FOLDER NAME***" /Volumes/timemachine-smb && printf '%s\0' "$(security find-generic-password -wa TimeMachineSparseBundlePass)" | hdiutil attach -encryption AES-128 -stdinpass -mountpoint /Volumes/TimeMachine /Volumes/timemachine-smb/timemachine-macbook.sparsebundle</string> | |
| </array> | |
| </dict> | |
| </plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment