For the past couple of months I have been running Mac OS X Snow Leopard (10.6) on my custom built desktop. I recently purchased a brand new MacBook Pro for use as a portable computer. All the while I have not been using Apple’s automatic backup daemon, Time Machine, and basically relying on the RAID drives on my desktop for keeping all of my data safe and secure. The desktop has been having some RAID troubles that I have not been able to diagnose yet and that got me to thinking: I should really spend some time and get this backup thing working.
I have had a NAS appliance, the D-Link DNS 323, lying around now for a couple of months collecting dust. There are many tutorials on the Internet that make this process much harder than it actually is, attempt to explain what might go wrong and finally offer no real explanation about why it is going wrong. Now, the very first thing to remember is to run this command as your user privileges. Inside of the Terminal application, execute the following command and restart your Mac.
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
What you need to do now is create a special disc image called a sparsebundle, which ideally, should be twice the size of the hard-drive that you are looking to backup. Unfortunately I do not have enough disk space available on my network for this.
First let’s go over Mac OS X Snow Leopard, where the filename of the sparsebundle needs to merely be the hostname.sparsebundle. A special XML file needs to be saved into the root directory of the sparsebundle package. If you are using Mac OS X Leopard (10.5) then the name of the image file needs to include the MAC address of the en0 ethernet interface. This is in a hexadecimal format. You can run the following commands to build the filename. The second command gets the username of the system. The format of the sparsebundle should be hostname_macaddress.sparsebundle.
ifconfig en0 | grep ether | cut -d' ' -f 2 | tr -d ':' hostname -s
The following command creates the sparsebundle package. You can create any size that you wish. Remember the last argument of the command needs to be the proper filename depending on which version of OS X you have (see above). The first command is for Leopard and the second for Snow Leopard.
hdiutil create -size 200g -fs HFS+J -volname "Backup of xavior" xavior_58b035fdf8f3.sparsebundle hdiutil create -size 200g -fs HFS+J -volname "Backup of xavior" xavior.sparsebundle
This step only needs to be done for Snow Leopard. You need to run the first command to get the UUID, and place it inside of the XML file. You should save the XML file in the root directory of the sparse bundle as the following xavior.sparsebundle/com.apple.TimeMachine.MachineID.plist.
ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }'Now place the string inside of the XML file and save it accordingly.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.backupd.HostUUID</key> <string>UUID_STRING</string> </dict> </plist>
Finally, mount the location via Samba (or any other network protocol) and copy the file over into the mounted folder. Inside of Time Machine select the mount point as the disk and let er rip.

|
James |
Thanks! My Macbook is now slowly backing itself up to the backup on my Linux server and has correctly mounted and verified the sparsebundle.
How reliable is this process (i.e are you still using it and have there been any problems with the sparsebundle getting corrupted/deleted/recreated). I used to do this with 10.5 but Time Machine kept telling me the sparsebundle was corrupt and that the backup couldn't continue.
Oh, the first time I tried your instructions I couldn't get the sparsebundle to be recognised. I didn't realise the sparsebundle 'files' are actually just folders and that the 'com.apple.TimeMachine.MachineID.plist' needs to go inside the folder, rather than inside the mounted sparsebundle itself.
johnbellone |
You make a great point. I should really write a little addendum explaining that sparsebundle is really just organized folder hierarchy. The same goes for the applications on the Mac.
I have not done a full backup over the wire yet, but I have successfully used the interface to bring back files from previous revisions. I would say that the integrity of the data should be pretty darn good. Ideally, if you have a dedicated Linux machine, you would probably want to use the Appletalk protocol (nettalk on Linux) instead of Samba which should give you a speed increase.
My hackintosh is backing up over gigabit ethernet (desktop) and the second over wireless ethernet (laptop – actual MacBook). If the integrity is great over wireless I do not think you should have a problem. After all, this system was designed with Airport (wireless) in mind.
With all that said the only time I have ever had a sparsebundle corrupted was when I was playing around initially trying to get the correct sizing. As long as you do not try to do this I don't think you'll have a problem.
ltickett |
Great article. I have just setup a new fileserver (WHS2011) and was expecting it to support Time Machine "out of the box". I read a few similar articles to yours and managed to get it up and running.
As the process is a little tricky i wrote an automator script to hopefully make life a little easier for others- take a look here: http://tickett.wordpress.com/2011/05/11/automated…
One last note… I'm using Snow Leopard but have used the "pre-snow-leopard" method… I'm curious whether i'm going to experience any problems in the future?
Lee
johnbellone |
I haven't experienced any problems using the Snow Leopard method, but I suspect as long as your backups are going through without a hitch everything should be fine.
anyshn |
Thanks for this, works very well on Snow Leopard. Have you tested this with Lion yet?
johnbellone |
I actually just installed Lion (plan on posting it tonight or tomorrow regarding my issues). I went ahead and did this first and there seems to be some issues using a Samba share. It now seems that Apple is requiring the AFP protocol for Time Machine. I'll investigate, but you may need to use netatalk package for this.
anyshn |
I managed to get this to work with AFP (Had to compile netatalk 2.2 and its deps: libgcrypt-1.5 and libgpg-error-1.10. I'm running chroot debian). I can use the same sparsebundle as before, and backups seem to work fine.