Mac OSX, Time Machine, and Network Shares
Using a network share or a Network Area Storage device (NAS) with Apple's Time Machine for Mac OS X 10.5 Leopard
Time Machine is the breakthrough automatic backup that’s built right into Mac OS X. It keeps an up-to-date copy of everything on your Mac digital photos, music, movies, TV shows, and documents. Now, if you ever have the need, you can easily go back in time to recover anything.
http://www.apple.com/macosx/features/timemachine.html
I've seen many discussions on many forums about using unsupported network devices and Time Machine - Specifically Network Access Storage (NAS) devices.
In theory, it "should" work. However, your results may vary - and it may depend on your computer, your network, and/or your NAS.
Here are the basic steps needed to get Time Machine to backup to your NAS...
For reference, here are some specifics but before you start doing this, check out the AppleScript...
Note: I am using a MacBook on an wired and wireless (Airport) network, MacOS X 10.5.6, and a Synology CS407e NAS (firmware version DSM 2.0-0731).
This is done with a simple Terminal command:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Open Terminal (Applications:Utilities:Terminal.app), past the above line and press return.
You must do this in order to get Time Machine to recognize anything other than "officially" supported devices (i.e. Time Capsule or direct-attach hard drives).
Note: The size of the disk image is most likely less than the size you specify above. In my case, I created a 250 gigabyte disk image and the size of the file was 1.12 gigabytes.
Okay, before we can mount it, we have to create it. I suggest creating a matching share name and user name on your NAS. Give the user exclusive read/write access to the share.
Now in the Finder click the "Go" menu and select "Connect to server...", and enter the url for your NAS:
smb://timemachine@cubestation.local
In this example, I used the user name I created on the nas (timemachine) and the DNS (or Bonjour) name of the NAS (cubestation.local). I also prefer using SMB over AFP as it is much faster. Using the IP address and/or AFP is similar:
afp://timemachine@192.168.n.n
You definitly want to use the user name you created specifically for this purpose. You do not need to save this in your Keychain.
Drag and drop the disk image you created in step 2 to the share you mounted in step 3.
(you can delete the disk image from your local machine when it's done).
Click "Choose Backup Disk" or "Change Disk" (if you used Time Machine before) and select the NAS share you mounted in step 3.
Enter the user name and password of the user you created on your NAS for this purpose. Time Machine will remember this user each time it runs.
And that's it. Your backup should start running after 2 minutes. However, there are a couple of potential problems. Mostly due to settings in the disk image that can't be controlled through Disk Utility...
When Time Machine runs, it creates files within the disk image as it stores the data being backed up. These files do not correlate to the individual files on your computer, rather they are 8 megabyte "bands". As Time Machine needs more space, it creates more bands. When the disk image is full, it removes bands to create new ones (or maybe it just reuses them, I don't know). But consider this: With bands of 8 megabytes, a 250 gigabyte backup results in 32,000 bands. Since the disk image is being mounted across the network, accessing this many bands within the disk image is, at best, tedious.
While the disk image is mounted, Spotlight will try to index it - unneeded and degrading to performance (32,000 bands of data).
A beter way of creating the disk image is via hdiutil in Terminal using this command:
hdiutil create -size 250g -type SPARSEBUNDLE -nospotlight
-volname "Backup of {Computer Name}"
-fs "Case-sensitive Journaled HFS+"
-imagekey sparse-band-size=524288
-verbose "{Computer Name}_{EthernetID}.sparsebundle"
This will create a 250 gigabyte disk image with a band size of 256 megabytes and suppress Spotlight from indexing it.
Technically, band size is based on the sector size of the disk. Since most disks have a sector size of 512 bytes (1/2k), specifying 524288 (512 * 1k) results in a band size of 256mb.
Now that you know some of the details, click on the "AppleScript: TimeMachine on NAS" tab (above) for an AppleScript that will help accomplish some of these steps.
Further Reference:
Download:
TimeMachine_on_NAS.zip
This work is licensed under the Creative Commons GNU-LGPL License.TimeMachine on NAS is an AppleScript application used to accomplish some of the steps outlined on the "Overview: TimeMachine on NAS" tab.
Specifically, it will:
Here are the complete steps involved in setting up Time Machine to use a network share:
Note: You can use the same share (but not the same disk image) to backup multiple computers. This script must be run for each computer.
To use TimeMachine on NAS, download the zip file (link above right), unzip the file and double click on "TimeMachine on NAS.app" (note that the extension (.app) may not appear in the Finder).
When you run TimeMachine on NAS, it will ask you for the maximum size of the disk image (in gigabytes) and the size of the bands within the disk image (in megabytes). It then uses shell (terminal) commands to retrieve the computer name and ethernet id and to create the disk image.
Note: Band size is based on the sector size of the hard disk. This script assumes a sector of 512 bytes and computes the band size approprietly. If the sector size of your disk is different, the band size may not be what is expected.





Disclaimer: Although this procedure has worked, I can not guarentee, nor do I make any claims or accept any responsibility in regard to the reliability of your backups. I have not tested the ability of Time Machine to restore files or complete systems after having backed up using this method. This is an unsupported method of using Time Machine and should be consider suspect untill and unless you have proven otherwise, using your own equipment, software, and network.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.