Howto Mac OS X Time Machine Backup to a Network Drive
- October 13th, 2011
- Posted in GeekLife . OS
- By Zerga
- Write comment
I do not own a Time Capsule, I do not plan to get one, nor do i want to connect a usb disk every time i feel like making a backup of my stuff. What i do have however is a wireless network and a Windows 7 PC. Why not use the available disk space in my PC for the backups of my Macbook Pro? I found out how to Time Machine Backup to a Network Drive…
In Snow Leopard it was still possible with a few tweaks and manual image file creation to get the OS to actually backup over the Network onto a Windows NTFS disk. Hoozah! In Lion (MacOSX 10.7.2) there is even another step required to get the backup process running. Using just step 1 it will fail with the message ‘The network backup disk does not support the required AFP features’.
1. So besides the same steps as in Snow Leopard to prepare the Backup Image File (my previous post) you will also need to…
2. Download and run the script from this file to modify backupd in such a way that it accepts remote disk on the network share: backupd_anyafp_r2 – just unpack and run ./install.sh from the terminal.
Thanks to msft.guy for the script!
PS: I still get the feeling that the backup of a FileVault encrypted home directory even on Lion still doesn’t work while being logged in. Meh.
Correction: I had to switch to FileVault2. Now the whole disk is encrypted and my guess is Time Machine can handle that…
What if I still can’t find my share in TimeMachine?
(added 24. Jan. 2013)
Here is a checklist what I would try then:
- close the preferences or even reboot after running the script above.
- Find out your Computer Name:
- Go to Apple menu > System Preferences and click Sharing.
- Note the computer name appearing at the top of the window.
– For example “ZergasMacbook”.
- Find your MAC address:
- In Apple menu, select
System Preferences...
- From the
View
menu in System Preferences, selectNetwork
. - In the left column of the
Network
preference window that opens, click the name of your connection (Ethernet
or
Built-in Ethernet
). - Click the
Advanced...
button, and in the dropdown, click theHardware
orEthernet
tab. - The address is the string of letters and numbers next to “MAC Address:” or “Ethernet ID:”.
– For example “00:15:20:aa:fe:a1”.
- In Apple menu, select
- Create your sparsebundle:
- Follow the steps described in my guide: Create a sparsebundle on your Mac manually with the name “ComputerName_MACaddressWithoutColons.sparsebundle” and move it into the shared folder on the windows machine.
– In the case of the examples above it would be “ZergasMacbook_001520aafea1.sparsebundle”.
- Follow the steps described in my guide: Create a sparsebundle on your Mac manually with the name “ComputerName_MACaddressWithoutColons.sparsebundle” and move it into the shared folder on the windows machine.
- Connect to the share:
- On your Mac, in Finder go to the menu Go -> Connect to Server…
- Choose the share with the sparsebundle in it on your Windows computer. The share will now be mounted under Volumes with the name of the share folder you gave in windows.
– For example let’s call the directory “MacBackup” on the computer “WindowsPC” then you a folder on your Mac called “/Volumes/MacBackup”.
- Mount the sparsebundle:
- Open a terminal and mount the sparsebundle as a drive under /Volumes on your mac by typing: hdiutil attach -verbose /Volumes/MacBackup/ZergasMacbook_001520aafea1.sparsebundle
You can also just double-click on it to mount (thanks, mike!).
- Open a terminal and mount the sparsebundle as a drive under /Volumes on your mac by typing: hdiutil attach -verbose /Volumes/MacBackup/ZergasMacbook_001520aafea1.sparsebundle
- Connect the sparsebundle:
- Now add the sparsebundle as the Time Machine destination with the terminal by typing: sudo tmutil setdestination /Volumes/mounted_sparse_bundle
- Then try starting the preferences and go to TimeMachine looking for the sparsebundle again.
BTW: In the terminal you can hit TAB and OSX will complete the name of a file or folder you were about to write. Like this you dont have to type all the sparsebundle file name.
Good luck!
Thanks! Worked really well for me.
My only other option was upgrading netatalk on the old fedora box I’m using as a time machine server, with no guarantees that it would fix anything. Your solution was quick and painless, so I tried it first.
Yay!
@nello
Happy to know it helped! Thanks for the feedback!
I’m trying this out, but when Time Machine creates the .sparsebundle file it does not have the MacAddress with it. It creates ComputerName.tmp.sparsebundle
I tried creating just ComputerName.sparsebundle and it creates ComputerName.sparsebundle-1
I tried creating ComputerName_MACAddress.sparsebundle and it creates ComputerName.tmp.sparsebundle
Would really hate to have to plug in my MBP to my external HDD everytime I want to back it up… Hoping I can find a solution that will work.
@Jesse Geron
First thing you can try is to observe the network share folder when trying step no. 5 of my tutorial. It can be that the file gets changed to the name you describe later on and the MAC Address will be removed from it.
Second, you could try opening a terminal on your Mac and type “ifconfig” which will display the MAC Address of your ethernet. It should be the one of your primary interface (usually called ‘en0’) just behind the word ‘ether’. Use the numbers without the ‘:’ in between them. For example, when it says ‘ether 00:21:3f:40:66:1e’, try creating a sparsebundle called ‘ComputerName_00213f40661e.sparsebundle’ where ‘ComputerName’ has to be the name of your Mac. You can find out the name by typing in the terminal ‘networksetup -getcomputername’.
I have the same problem, Time Machine creates a sparse bundle that has tmp in its and and doesn’t accept the file I created in Disk Utility. Does the backup need to be started without WiFi? It names the sparse bundle file MacBook.tmp.sparsebundle so I named mine MacBook.(mac address).sparsebundle. But it still creates the .tmp. file. Not sure what the issue is :(
If I remember correctly, the backup process fails and only then the file is called “MacBook.tmp.sparsebundle”. But while Time Machine is in the process of trying, you should repeatedly check the name of the file it creates initially. I am pretty sure it has the desired format containing the mac address as mentioned above at the beginning and then gets changed to “MacBook.tmp.sparsebundle” during the process (and after it failed). I don’t think it mattered if you tried to backup on WiFi or not, but it is worth a shot. Let me know if it helped…
Trying for a couple days to get this stupid thing to work with no luck. I have followed several tutorials on this.
Running a macbook pro with 10.8.2 installed. My share drive is on my network as a SMB share. I create the sparse bundle and it’s there. I put the plist file inside it as directed. I can browse it and see it.
I ran the default blah blah to make Time Machine show other stuff, but when I open TM all I see is my one extra hard drive and none of the network shares. How can I fix this, or can’t I with this version of OS?
I do not know if this still works on Mountain Lion as I have not upgraded yet. But assuming it does, there are only two things that can lead to what you describe:
First, make sure you have mounted the drive successfully (for example via the address cifs://192.168.1.1/mybackupshare)
Seconds, as described in step 2 of my guide, it is essential to run
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
in a terminal to make TM recognize the share.
Sometimes it helps to reboot after doing so.
Hope you just missed one of the above… Good luck!!
First I used this guide ( http://foliovision.com/2010/05/network-backup-apple-timemachine ) and when I was done with it I could see my shared folder on my Win7 in TM and in the comments I saw I link to this “ending” guide. I’ve run the script and followed the instructions showed in Terminal and rebooted. When I try to make a backup to my shared folder on my Win7 I get this message: http://cl.ly/image/0j3M1T2P0E0G
It’s in Danish so let me translate:
“TM could not complete backup
The disk image for backup “/Volume/TimeMachine/Marc Storm Larsens MacBook Pro.sparsebundle” could not be created (error 45)”
Any ideas of what my next move should be?
@Marc
It seems something went wrong on the way up to this point. Best to try an re-do all the steps…
Especially make sure you followed step 3 of my guide linked above (http://zerga.dyndns.org/wordpress/2010/02/15/howto-convince-mac-os-time-machine-to-backup-on-samba-network-share-winlinux)
Also confirm that the sparsebundle file you created has the correct name containing your IP address of your LAN (not your WiFi for example).
All of this you can find in my guide. Just go through it again carefully, i am sure you have just missed something…
Good luck!
Trying to wrap my head around the ins and outs. I have a MAcBookPro running OSX10.8.2 sharing with a drive on a network connected XP machine. I have SMB and AFP enabled in sharing. My question is, since the network drive (on the XP machine) is being communicated with via SMB, why do AFP commands affect things? Put another way, why do AFP commands have to be modifies by the script when the protocol is SMB? I don’t doubt its needed, I just seek to understand why.
Thanks in advance.
For those that haven’t been able to get this to work under Mountain Lion.
I had the same problem – followed all the instructions to the letter for Lion – just didn’t show up in TM.
Until this: mount the backup drive (just clicking on the sparsebundle file is enough)
Enter the following command in Terminal: sudo tmutil setdestination /Volumes/[your volume name]/
Worked like a charm!
@Mike
Wow, thanks mike! As I am not using Mountain Lion myself, I really appreciate you sharing this information with those who do! I really hope it helps! Cheers!!
Thanks Mike, the terminal command to set the destination did the trick for me. Before I wasn’t able to see the network drive or sparsbundle in TimeMachine.
> sudo tmutil setdestination /Volumes/mounted_sparse_bundle
You can save yourself some typing etc by starting with
sudo tmutil setdestination
and then dragging the mounted volume into the Terminal window and Terminal will fill in the rest.