Time Machine on a network drive

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.

Suggestion: consider online back-up

For six years we used the technique described on this page to back-up the Macs at my company. In 2014 we switched to Backblaze Online Backup, who provide unlimited back-up space for both Macs and Windows PCs for $5 a month. By using an online back-up solution our back-ups are safe even if a disaster hits our building and affects both our computers and our network drives.

Preparation

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.

3c. Type defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1 and press enter.

4. Find the MAC address of your computer:

4a. Type 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:

5a. Type 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. This will create a 100 gigabyte sparse bundle; to create a sparse bundle of a different size replace 100g with a different value.

5b. Type 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.

5c. Type 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.

from stephenmorley

This entry was posted in Mac. Bookmark the permalink.

Leave a Reply