Making Time Machine work with the ReadyNAS

April 20, 2008 by  
Filed under Uncategorized

The following is a summary of how to make Time Machine work with the ReadyNAS by DavidB based on initial contribution by btaroli and refinements by sirozha and a host of others on the ReadyNAS Mac/OSX Forum. We are thankful of the Mac enthusiasts who frequent and contribute to the ReadyNAS forum.

If you are using RAIDiator 4.1.5+ on the ReadyNAS NV+, NV, Duo, 1100, X6, or 600, or RAIDiator x86 4.2.3+ for the ReadyNAS Pro or NVX, you can use the built-in Time Machine support on the ReadyNAS for a simpler of setting up your backups.  Instructions here.

Ok I’ve just converted a second machine to use the NAS for networked Time Machine backups, and this time things went straight through without any mistakes. Here’s the run-down:

This example was done using a Mac Mini with a hostname of “magpie”, running OS X 10.5.2 and connected via 802.11g to a ReadyNAS NV+ (RAIDiator 4.01c1-p1 [1.00a041] with AFP patch loaded). I’ve created separate AFP shares for each machine (“TMmagpie” in this case) and set them to be accessible just to the “owner” of the machine. I could have set up one share to contain Time Machine backups for all clients, but then it could be possible for a user to access someone else’s private data within the backups.

Do make sure to keep the hostname simple — i.e. don’t have quotes in it like “Maggie’s Mac”, or the process will fail.

With the share set up on the NAS already, everything else we do is local to the client (magpie in this case). Some of the commands I list here are run within, although there are alternate (GUI) ways of accessing some of the functions.

This machine had previously been doing Time Machine backups to a local Firewire disk, and part of the process outlined here is to copy the contents of that disk to the NAS so that further backups build on top of the existing ones. No need to throw away the old backups!

  1. In System Preferences, turn Time Machine off.
  2. Find the MAC address of the machine’s internal Ethernet port:
    $ ifconfig en0 | grep ether

    This should produce a single line of output, such as:

    ether 00:16:cb:af:91:d7

    Even if the network backups will be done using a different port (e.g. AirPort: usually “en1″) the system will use the address of en0 as part of the system identifier.

    In this case the identifier that Time Machine will use is “magpie_0016cbaf91d7″.

  3. Make a new “sparsebundle” on a local disk (NOT the Time Machine disk!). This sparsebundle is a virtual filesystem image which we’ll copy to the NAS, and Time Machine will then access it remotely (that way Time Machine’s not limited by the filesystem features of whatever NAS it’s using: all the funky stuff happens within the sparsebundle). By default sparsebundles can keep growing until they fill up the NAS, but in this scenario we keep other things on the NAS as well as backups, and we’re going to limit the sparsebundle size to 140 GB. We called this one “Backup of magpie” as that’s the default name created by Time Machine, but in fact you can call the volume anything you like.
    $ hdiutil create -size 140g -fs HFS+J -volname "Backup of magpie" magpie_0016cbaf91d7.sparsebundle
    created: /Users/david/magpie_0016cbaf91d7.sparsebundle $

    This Mac Mini hasn’t had things like developer tools loaded: hdiutil comes with the OS. We make the sparsebundle manually so we can impose the size limit, and we do it on a local disk because of a bug that prevents creation of a sparsebundle remotely on the NAS (although they can be used when in place). The sparsebundle doesn’t start at 140 GB: it grows as more data is put in the filesystem inside it, up to a maximum of 140 GB.

  4. If you’re not going to copy the contents of an existing Time Machine disk, skip ahead to step 9.
  5. Mount the sparsebundle:
    $ open magpie_0016cbaf91d7.sparsebundle

    You’ll see “Backup of magpie” appear as a mounted volume in Finder.

  6. Copy the old Time Machine backups to the sparsebundle. In Disk Utility:
    Click on Time Machine disk on the left panel, then select the “Restore” tab:

    1. Drag the local Time Machine volume to the Source field
    2. Drag the sparsebundle volume (“Backup of magpie”) to the Destination field
    3. Select “Erase destination” (possibly not mandatory)
    4. Restore

    This will take a while, depending on how much data is on the drive…

  7. If you selected “Erase destination” in Disk Utility, the volume name will have been copied from the local Time Machine disk. Rename the new volume back to “Backup of magpie” (or whatever name you chose).
  8. Unmount (“eject”) the sparsebundle volume.
  9. Mount the NAS share the sparsebundle will be mounted on (“TMmagpie” in this case). I mount all our shares via AFP, but you can presumably use CIFS also. Once it’s mounted, it will be accessible within as /Volumes/TMmagpie.
  10. Copy the sparsebundle to the share:
    $ rsync -avE /Users/david/magpie_0016cbaf91d7.sparsebundle /Volumes/TMmagpie/.

    Depending on your network (802.11g, 802.11n, 100bT, 1000bT, etc) this can take a long time!
    rsync is smart enough to only copy the new bits of a file, so you can stop and re-run that command if necessary without re-copying everything.

    In the meantime you can go ahead and use the machine. Just don’t turn Time Machine backups back on yet.

  11. If the local copy of the sparsebundle is in an area that will be backed up by Time Machine, remove it before proceeding. We don’t want to double the size of the Time Machine backup for no good reason!
  12. In the Time Machine System Preferences panel, select “Change Disk…”. It will display a list of volumes you can backup to. If the share containing the sparsebundle isn’t listed (you did mount it, right?) it’s probably because it’s not mounted from a Time Capsule or another OS X machine. To show the share in this display you’ll need to have executed the following command in Terminal:
    $ defaults write TMShowUnsupportedNetworkVolumes 1

    You’ll need to log out and in again for this to have effect (select “Log Out” from the Apple menu: you can Restart, but logging out will do). Now mount TMmagie again, then try Time Machine’s “Change Disk…” again.

  13. Select the share on the NAS (“TMmagpie”) as the new destination for Time Machine backups.
    Time Machine will automatically turn itself back on and schedule a backup to begin in two minutes. If you didn’t populate the sparsebundle with the contents of a local disk, this first backup will be a full backup and can take a very long time (depending on things like your network infrastructure). If you did pre-populate the sparsebundle, this backup will be an incremental backup and shouldn’t take long at all (depending on how much has changed on the machine since you turned Time Machine off in Step 1 of course). Once the backup has started, keep going with the remaining steps in this list while the backup is running.
  14. You can now eject the TMmagpie share. Time Machine will automatically mount the sparsebundle file directly (during backups you’ll see “Backup of magpie” mounted).
  15. Unfortunately Spotlight will try to index the contents on the “Backup of magpie” share, which will slow down the backups significantly. To avoid this, as soon as the share is mounted for the first time go to Spotlight’s Privacy panel in System Preferences. Use the ‘+’ button at the bottom, select the “Backup of magpie” share, and Spotlight will then ignore it. If Spotlight has already started indexing it, it should immediately stop and the backup will speed up.

That’s it. Congratulations! New Time Machine backups should happen every hour, and you can access all the backup files via the usual Time Machine interface.With magpie this has allowed us to disconnect the local 200G Firewire disk previously used for Time Machine backups: this drive was significantly noisier than the Mac Mini itself!


Comments are closed.