Zit Seng's Blog

A Singaporean's technology and lifestyle blog

Setting Up Time Machine On A Network Storage

One of the best things that Apple had introduced with Mac OS X 10.5 Leopard is Time Machine. It’s a no-brainer backup utility that “just works”, and furthermore, one that people will actually use. While Time Machine works great with a direct attached storage disk (internal or external firewire/USB) or Time Capsule, it wouldn’t readily work with other network attached storage. If you want to backup “over the network”, Apple wants you to buy their Time Capsule hardware. But there are fixes to get around that.

Honestly, the Time Capsule is quite a fine piece of hardware too. It is basically a simultaneous dual band 802.11n wireless broadband router, gigabit ethernet switch, print server and includes massive internal disk storage. The problem is that what if you already have all these capabilities in one or several deviecs… there’s not much reason to buy a Time Capsule.

So… here’s the thing. You can trick Time Machine to use some other type of network attached storage. You don’t even need to run any new fancy thing like Apple’s own networking protocol. Just a few setup steps.

  1. First, make sure that your network folder is already setup and working. Particularly, make sure that your Mac can connect to it, read and write files to it. How to setup this network folder is beyond the scope of this post.
  2. Next, you need to tweak a setting in Mac OS X. Run this in a terminal:
    defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
  3. Then, you need to create a “disk image” on your Mac locally. In a terminal, run:
    hdiutil create -library SPUD -size $SIZE -fs HFS+J -type SPARSEBUNDLE -volname “Backup of $MACNAME” $MACNAME_$MACADDRESS.sparsebundle
    where $SIZE is the size of the Time Machine backup storage to create (e.g. “320G” for a 320GB size storage), $MACNAME is the computer name of your Mac (find it in System Preferences → Sharing), and $MACADDRESS is the ethernet ID of your LAN interface (just the 12 hexademical digits, e.g. d49a20122334). Note that the “sparsebundle” created is not actually the size that you specify, but it can grow to accommodate the size that you set.
  4. Use the Finder, locate the image you created above ($MACNAME_$MACADDRESS.sparsebundle) and copy it into the network folder.
  5. Now open Time Machine Preferences, click Select Disk, and then select your network folder.
  6. You’re almost done. Just wait for the first backup to start. Or you can just tell Time Machine to Back Up Now.

The initial backup does take some time, like it also does on a directly connected USB or Firewire disk. I had 93GB of data to backup initially, and over my 802.11n wireless network, it took almost 7 hours to complete.

A nice thing I like about this solution is the ability to “limit” the amount of space consumed by Time Machine. Ordinarily, Time Machine uses up the entire disk that it is offered, which is inconvenient when you want to share that disk with other data, or use it for multiple Time Machines (i.e. different Macs). How do you tell Time Machine play nice and not to gobble up all the space it can lay its hands on? Well, now the sparsebundle image lets you determine the maximum amount of space that Time Machine will use.

Note: If you are going to copy-and-paste the hdutil command line above, be wary that when displayed by WordPress in here, the quotes are replaced with nice curly quotes. Remember to swap it back for a normal quote character.

1 thought on “Setting Up Time Machine On A Network Storage

Leave a Reply

Your email address will not be published. Required fields are marked *

View Comment Policy