GuidesLife

Enabling Time Machine on D-Link DNS-320

Time Machine

Enabling Time Machine support on the D-Link DNS-320 is, surprisingly, a straight-forward task. Yes, you can use your own NAS (Network Attached Storage) for Time Machine backups instead of Apple Time Capsule. However, Time Machine seems to use all the available space (on the NAS) for backup purposes. So I started to explore how can I limit the amount of disk space used for Time Machine.

After getting my Apple iMac 27-inch recently from a computer show, I started to explore Time Machine  on Mac OS X (Snow Leopard). I managed to set up Time Machine to backup to my DNS-320 and, at the same time, limit the disk space used by Time Machine.

I’ve put together a short guide on configuring Time Machine to backup to the NAS. In my case, I am using the DNS-320 as the backup target, you might want to tweak the  guide slightly to suit your own needs.

 

What you will need

  1. A fun_plugged D-Link DNS-320
  2. A Mac
  3. Some free space (on the DNS-320) for Time Machine backup

 

Configuration summary

  1. Enabling AFP support on the NAS
  2. Testing (default) Time Machine backup to DNS-320’s Volume_1
  3. Creating a sparsebundle with specific disk size
  4. Editing the sparsebundle
  5. Uploading the edited sparsebundle file back to the NAS

 

Enabling AFP support on the NAS

In this section, we will enable the Apple Filing Protocol (AFP) on the NAS, which in my case is a D-Link DNS-320. CIFS works too (the default network share settings) but I think Mac are more optimized for AFP.

  1. Login to your DNS-320’s web administration page
  2. Navigate to Management –> Application Management –> AFP Service
  3. Under the AFP Service Setting, select Enable
  4. Click on the “Save Settings” button

AFP is enabled by default for network shares (DNS-320 firmware version 2.00)

 

Testing Time Machine backup to DNS-320’s Volume_1

Before you proceed. Ensure that you are able to read and write to the DNS-320’s Volume_1. You can verify it by:

  1. Navigate to Applications –> Utilities –> Terminal
    A terminal window should launch
  2. Type the command “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1” without the quotes
  3. Launching Finder
  4. Press ⌘ + k
    A Connect to Server prompt should appear 

    Using Finder to connect to network share

  5. Browse to your DNS-320 or simply specify “afp://<DNS-320’s IP address>/Volume_1” without the quotes. You should replace <DNS-320’s IP address> with its LAN IP address and Volume_1 with your network share name if you are not intending to use Volume_1
  6. Press the “Connect” button
    The network share, Volume_1, on DNS-320 should appear
  7. Test read & write by creating a new folder in the network share

After verifying that you are able to write to the network share. Try if Time Machine is able to use your NAS as a backup disk

  1. Navigate to System Preferences –> Time Machine
    Time Machine preference should launch 

    Time Machine

  2. Click on the “Select Disk…” button
    A disk selection prompt should appear 

    Time Machine - Using Network share for Time Machine backup

  3. Select the network share you connected to earlier
  4. Click on the “Use for Backup” button
  5. Force a backup by selecting “Back Up Now” from the Time Machine icon on the menu bar

If you look at your network share, a new file in the format <computer name>.sparsebundle should be created. This sparsebundle file allows Time Machine to use all the available free space on your NAS. We will need this sparsebundle image for the later section, don’t remove it.

Pause the Time Machine temporarily by switching it to the Off state while we do the rest of this guide.

 

Creating a fixed-size sparsebundle for Time Machine backups

In this section, we will be creating a 256GB sparsebundle file for Time Machine backup. First locate your computer name, you can find it by navigating to System Preferences… –> Sharing. After getting your computer name, we will create a fixed size sparsebundle image on your Desktop:

  1. Navigate to Applications –> Utilities –> Terminal
    A terminal window should launch
  2. In the terminal window, type “cd Desktop” without the quotes
  3. In the terminal window, type “hdiutil create -size 256G -fs HFS+J -volname “Time Machine Backups” -type SPARSEBUNDLE <computer name>.sparsebundle” without the quotes and replacing <computer name> with your computer name
    The <computer name>sparsebundle file should appear on your desktop

Great! What’s left now is to edit the sparsebundle image!

 

Editing the sparsebundle(s)

Remember the sparsebundle image on your NAS? Navigate to the network share that contains the sparsebundle (hint: you can use ⌘ + k in Finder). We will need to

  1. Navigate  the network share containing the sparsebundle created by Time Machine
  2. Right-click on the <computer name>.sparsebundle and select “Show Package Contents”
    A new Finder window should appear 

    Editing the sparsebundle file

  3. Copy the file “com.apple.TimeMachine.MachineID.plist” onto your Desktop
    You should have a new file com.apple.TimeMachine.MachineID.plist
  4. Close the Finder window
  5. From your desktop, right-click on the <computer name>.sparsebundle and select “Show Package Contents”
    A new Finder window should appear
  6. Copy the “com.apple.TimeMachine.MachineID.plist” on your Desktop into the Finder window. It means that, you copy the “com.apple.TimeMachine.MachineID.plist” file into the <computer name>.sparsebundle
  7. Right-click on “Info.bckup” and select “Get Info”
    A new window named “Info.bckup Info” should appear
  8. Under the “Sharing & Permissions” section, change the Privilege of “everyone” to “Read Only”
  9. Close the “Info.bckup Info” window
  10. Right-click on “Info.plist” and select “Get Info”
    A new window named “Info.plist Info” should appear
  11. Under the “Sharing & Permissions” section, change the Privilege of “everyone” to “Read Only”
  12. Close the “Info.plist Info” window
  13. Close the <computer name>.sparsebundle Finder window

You are almost there! Hang on!

 

Uploading the edited sparsebundle file back to the NAS

In this section, we are replacing the <computer name>.sparsebundle file on your NAS with the one on your Desktop.

  1. Navigate to the network share containing the <computer name>.sparsebundle. (hint: you can use ⌘ + k in Finder)
  2. Copy the Desktop’s <computer name>.sparsebundle file onto the network share, replacing the one on the NAS

After you have finished copying the edited file, do the following:

  1. Telnet/SSH to your DNS-320
  2. Navigate to the folder containing the sparsebundle image
  3. Navigate into the spasebundle image by typing “cd <computer name>.sparsebundle” without the quotes and replacing <computer name> with your computer name
  4. Change the permission of the Info.* files by typing “chmod 555 Info.*” without the quotes
  5. Close the telnet/SSH window

Turn on Time Machine! Time Machine backups will be capped at the size you have defined. If you check the console logs, you will notice that Time Machine throws an error as it attempts to resize the sparsebundle to your NAS’s max free capacity. It is perfectly normal.

Now you have got a fixed-size Time Machine backup on your NAS.

 

Checking whether you did it correctly

 

You can check whether you created a fixed size sparsebundle image. The console messages should reflect that Time Machine (backupd) “Could not resize backup disk image (DIHLResizeImage returned 13)”.

To check, simply do the following:

  1. Navigate to Applications –> Utilities –> Console
  2. From the top navigation bar, click on “Show Log List”
  3. On the left menu bar, select “All Messages”
  4. In the Filter, type “backupd” without the quotes
  5. Look for the message “Could not resize backup disk image (DIHLResizeImage returned 13)”
Using Console to check on Time Machine

If you see the message “Could not resize backup disk image (DIHLResizeImage returned 13)”, it means that Time Machine failed to resize the sparsebundle image. You have successfully limited Time Machine backups to a fixed size image!

 

Treat shadowandy!

If these step-by-step guides have been very helpful to you and saved you a lot of time, please consider treating shadowandy to a cup of Starbucks.  

This site contains links to Amazon. These links will take you to some of the products mentioned in today’s article. As an Amazon Associate, I earn from qualifying purchases.
34 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments