GitHub as Blogging Platform Testing GitHub as Blogging Platform
Test Post, PDF Attachment
Test Post: MS Word Document
Test Post: MS Word Document
Test Post: Getting Time Machine to Work with Your NAS
This is a test post to see how posterous handles a google doc I wrote. I'm posting this via google docs' send document in email, "Paste the document into the email message".
Getting Time Machine to Work with Your NAS
Since the birth of our little girl, we have been obsessed with taking pictures and capturing video of family events, cute moments, and blackmail material for those later teenage years. All those pictures and videos take up space - as does the ever expanding and, mostly, legally acquired music and movie collections. External firewire/USB drives clutter my work area to accommodate our expanding digital collections. Of course we can and have kept sporadic back ups to DVD and CD and on a few rare occasions had to recover from that media due to hardware failures and careless mistakes. I even experimented with a few online storage services, but accessing Gigabytes of data takes time and, it seems, services for Macs are still nascent.
This article describes how I finally established a painless backup solution for my home computers using OS X's Time Machine and a network attached storage (NAS) device - the ReadyNAS NV+. Using Time Machine with Network Attached Storage (NAS) is disabled in OS X's Leopard (as of version 10.5.2) for anything but Time Capsule. However, it can be done without too much effort on your part.
NOTE: Since I wrote this, the ReadyNAS guys have come up with an official how-to: "Making Time Machine work with the ReadyNAS". You may still find these instructions useful.The Backup Thing
Okay. We all know we are supposed to do it. Everyone tells you to do it before you try something silly like re-size your disk's partitions. But admit it, we don't do it nearly enough, if ever! Then it happens - tragedy! Your data gets lost/scrubbed/deleted/corrupted beyond all recognition. Literally, parts of your digital life are gone and are never to be seen or heard from again.
Kudos to Apple for recognizing an area that sorely needed some innovation. Time Machine is Apple's backup utility that makes backup as simple as flipping a switch. Simply plug in an external firewire/USB drive, turn Time Machine on and tell it to use that drive. All data will be transparently and reliably backed up to that drive.
If you haven't heard about Time Machine, visit Apple's site for more information.
The NAS Thing
Network attached storage (NAS) is slowly becoming a solution for these types of storage problems because it provides centralized storage on your home's LAN. The space can be shared by multiple computers. These appliances tend to be much more energy efficient than desktop computers and optimized for file serving - unlike your current desktop which you may already
be using as a file server.
Doing the Backup Thing with the NAS Thing a la Time Machine
- Apple's Time Capsule - supports Time Machine out of the box. If you go this route, you don't need this article!
- Drobo + Drobo Share - A multi-drive solution that provides hot swapping of drives without the RAID techno-confusion.
- ReadyNAS NV+ - A four drive fully RAID compliant storage device, plus iTunes server, plus..
- Google it. There are plenty more that fit this bill and I make no claim which solution would be right for you.
Making Time Machine Play Nice
Backups are supposed to be a sure thing so what I'm about to describe may not be such a good idea. The steps I'm about to describe are not support by Apple in anyway. I take no responsibility for anything you may do to your computer or what Time Machine may do to your back ups.
DO THIS AT YOUR OWN RISK.
My own boiler plate legalese aside, I feel fairly confident with that this solution is producing reliable backups at least for my environment. I've only just starting using this solution so it is possible issues will arise down the road.
I can take no credit for figuring out these instructions. Everything I'm writing down here is what I have pulled from the ReadyNAS discussion forums. (Since I wrote this, the ReadyNAS guys have come up with an official how-to: "Making Time Machine work with the ReadyNAS". You may still find these instructions useful.) I extend many thanks to those who worked out the technical issues and posted them there.
Lets get to business.
Requisites:
- A NAS that supports AFP or SMB, NFS? (I've only tested AFP)
- Mac OS X Leopard 10.5.2+
- OS X admin privileges and the ability to use the terminal
General Steps
- Turn off Time Machine
- Enable Time Machine to work with unsupported network shares
- Create a disk image, called a sparsebundle, to hold your Time Machine backups
- If you are using ReadyNAS 4.0.1 and earlier and AFP, apply AFP update
- Put the sparsebundle on a share on your NAS
- Turn on Time Machine and choose the network share
Turn Off Time Machine
First, turn off Time Machine, by choosing it in your System Preferences and sliding the controller to the off position.
Enable Time Machine to Work with Unsupported Network Shares
To get Time Machine to allow you to pick an unsupported network share as a target for storing backups, you must set a secret system property. Using the terminal run the following command:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
You can verify that it is now set to '1', by reading the system property:
defaults read com.apple.systempreferences TMShowUnsupportedNetworkVolumes
Create a "sparsebundle"
thor:~ jduprey$ hostname | sed 's/[.].*//g'
thor
ifconfig en0 | grep ether | awk '{print $2}' | sed 's/://g'
0018f31587d1
So in this example computerName=thor and MAC=0018f31587d1.
Now you are ready to create the sparsebundle image. Decide how much space you want Time Machine to take up. This will be the maximum size of the sparsebundle. I chose 320 Gigabytes for mine, imageSize=320g. One rule of thumb is to use 110% of your actual disk capacity. Another might be to use 150% of the actual data on your drive. Basically, it will need to be big enough to hold all the data you want to back up plus how much history you want it to keep about past files.
Execute the following command ALL on ONE line with YOUR image size computerName and MAC in :
hdiutil create -size imageSize -type SPARSEBUNDLE -nospotlight -volname "Backup of computerName" -fs "Case-sensitive Journaled HFS+" -verbose ~/Desktop/computerName_MAC.sparsebundle
e.g.
hdiutil create -size 320g -type SPARSEBUNDLE -nospotlight -volname "Backup of thor" -fs "Case-sensitive Journaled HFS+" -verbose ~/Desktop/thor_0018f31587d1.sparsebundle
du -hs ~/Desktop/thor_0018f31587d1.sparsebundle
160M /Users/jduprey/Desktop/thor_0018f31587d1.sparsebundle
Apply ReadyNas AFP Update (If Applicable)
If you are using a ReadyNAS product with RAIDiator version 4.01c1-p1 or earlier and AFP shares, you may need to patch the AFP software. I noticed that the sparsebundle when copied to the share appeared as a regular folder which didn't leave me with a good feeling that all was well.
Grab the patch from http://www.readynas.com/. The 4.01 patch can be found here:
http://www.readynas.com/?page_id=94
Look for "Update_AFP_Support". Perform a local update and reboot the NAS when you are done.
Copy Sparsebundle to Your Backup Share
Connect your computer to the share in the standard Leopard way. Make sure you are connected as the appropriate user and that your backup share has the appropriate permissions so that there will be no problems accessing the image through Time Machine.
Turn On Time Machine and Choose the Network Share
Its show time! Turn on Time Machine in the System Preferences and choose your backup network share by clicking the "Change Disk" button.
You can wait for Time Machine to start backing up or tell it to start now by using the menu bar option.
Your first backup will likely take a long while. Verify that Time Machine is writing to your sparsebundle and has not created one of its own. If it creates its own, proper maximum size limits may not be placed on the bundle leading to problems.
Conclusion
Hopefully these steps have you taking full advantage of Time Machine and your NAS investment. If you still have questions about setting this up, I recommend that you post them to the ReadyNAS Time Machine discussion thread (or your own NAS's support forums) or applicable Apple howto sites. All that I know was extracted from the original discussion thread from ReadyNAS. This article attempted to put that information into context.
Posterous. P/Hosting That Just Works
Test