Apple’s Time Machine software made it easy to set up incremental back-ups, with one exception: network drives (more formally called network-attached storage, or NAS). Time Machine only directly supports drives formatted with Apple’s HFS+J file system, and will eventually use all disk space on the drive. This page provides an illustrated guide showing how to set up Time Machine on a network drive, using a sparse bundle to emulate a smaller HFS+J drive. Click ‘show screenshot’ after each instruction to see the relevant screenshot.
Note: Many network drives fail to function with Time Machine under OS X Lion due to Apple’s decision to require DHX2 authentication. These NAS devices require firmware updates from their manufacturers to be able to support Time Machine.
1. Ensure the network drive is mounted:
1a. Click ‘Go’ and then ‘Network’ and double-click on your network drive. If your network drive is protected, enter your username and password.
2. Find the name of your computer on the network:
2a. Open System Preferences.
2b. Click the Sharing icon.
2c. The computer name on the network is shown below the input field, with a ‘.local’ suffix which should be ignored (that is, if it shows stephenmorley.local then your computer’s network name is stephenmorley).
3. Ensure Time Machine will show your NAS device:
3a. Click ‘Go’ and then ‘Utilities’.
3b. Click the Terminal icon.
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1 and press enter.
4. Find the MAC address of your computer:
ifconfig en0 | grep ether and press enter.
Your MAC address is the 17-character string consisting of six pairs of hexadecimal digits separated by colons.
Creating the sparse bundle
5. Create the sparse bundle:
hdiutil create -size 100g -fs HFS+J -volname "Time Machine" NAME_XXXXXXXXXXXX.sparsebundle and press enter, where NAME is the name of your computer on the network (as determined in step 2c) and XXXXXXXXXX is your MAC address (as determined in step 4a) without the colons.
Ths will create a 100 gigabyte sparse bundle; to create a sparse bundle of a different size replace 100g with a different value.
rsync -aE NAME_XXXXXXXXXXXX.sparsebundle /Volumes/DRIVE/. and press enter, where DRIVE is the name of your network drive.
This will copy the sparse bundle to the network drive, and will take several seconds.
rm -rf NAME_XXXXXXXXXXXX.sparsebundle and press enter.
This will delete the copy of the sparse bundle on your computer.
You can now close Terminal.
Setting up Time Machine
6. Select the back-up location:
6a. Click the Time Machine icon and then Open Time Machine Preferences.
6b. Click the Choose Backup Disk button.
6c. Select the network drive and then click the Use For Backup button. Time Machine will show the drive’s full capacity, but back-ups will be limited to the size chosen in step 5a.
7. Start the back-up:
7a. Time Machine will start the back-up automatically after two minutes. Alternative, click the Time Machine icon and then Back Up Now.
7b. Time Machine will show a status of ‘Preparing…’ while it determines which files to back up.
7c. After a few minutes the back-up will begin and the status will change to ‘Backing up’.
7d. While the back-up is in progress, a volume called Time Machine will be shown on the desktop. Once the back-up completes, this volume will disappear.