Mac Backups to NAS via SMB

For a while now I have been backing up my Mac Mini to a 4GB USB keyfob I had lying around, just to test out Time Machine and see how backups worked on the Mac. My original intent when I bought the Mac was to back up my home area for any XCode work in case Apple announced a refresh within the first 30 days of my purchase.  Sure enough, a few rumors went around that the Mini would be refreshed in September and I prepared to return the Mac Mini for what would surely be a beefier product.  But it was not to be, so I continued using it on and off to just play with the system.

This was all certainly before I had recently decided to start using my Mac full time.  Upon loading new apps, and pictures from my camera onto the Mac I started to see much higher disk use.  I’m still only using 30% of the disk on the Mac Mini, but this was beyond the capability of that little keyfob with Time Machine.  Having a few servers running in the house with disk to spare, I decided to start backing up to an SMB share.  It turns out that this is as easy as typing

defaults write TMShowUnsupportedNetworkVolumes 1

at the console and then using “Connect to server…” to add smb://servername to connect to a share.  The SMB share then appears in the Time Machine device list.

Next, since my SMB share is 300GB, I don’t want Time Machine to use all of that space up, so I set a quota by running the following while in a local directory, and then drag the resulting directory off to the SMB share using Finder.

hdiutil create -size $SIZE -fs HFS+J -type SPARSEBUNDLE
    -volname "Backup of $CLIENTNAME" $CLIENTNAME_$MAC_ADDRESS.sparsebundle

where $SIZE is something like 500m or 20g, $CLIENTNAME is the name of your system, and $MAC_ADDRESS is the MAC address of your system, as reported by “ifconfig -a”, with the colons or any other separator characters removed. The -resize option is available later in case I need to make it bigger. The key to this is keeping the computer name as seen in System Preferences -> Sharing as short as possible, preferably without spaces or other symbols.


8 thoughts on “Mac Backups to NAS via SMB

  1. I am not sure I understand how you are backing up a Mac mini to a 4GB USB drive? You must have spent a LOT of time adding exclusions. I also question the stability of backing up using Time Machine and a remote mounted SMB share.

  2. I only backed up the home areas containing my xcode work in it since that's all I really did with the system. That was the original idea and has since changed – I now have more on the system, calling for replacing the 4GB stick with a 20GB network backup.Backing up over the network is always less stable, in any backup scheme, than backing up directly to a local drive, but a local drive is not always the best place for backups. Ideally this would be done to an external drive that could be mounted on another system if the problem were catastrophic to the original operating system.Essential to ANY backup system is occasionally testing the backups. I've done that enough times that I'm satisfied with the stability. I don't know if your opinion on network backups is limited to Time Machine, but my home network is stable enough that I'm running iSCSI for some VMs which is more sensitive than a backup. As we use Netback for enterprise backups over the network at my place of work, I trust network backup in general as a proven technology.

  3. I should have been clear. My concern was in backing up to network shares over wireless. I use a Time Capsule for my Time Machine backups and I have had lots of issues recovering backup that were done over the wireless network. No problems with backup over wired Ethernet.I have two Macs ( mini and MacBook ), two Windows XP PCs, one Ubuntu Linux server, and a FreeBSD based NAS ( FreeNAS ). The Macs and Windows machines are all on a 802.11g network. Other than Time Capsule my backup strategy has been to store almost all documents on the FreeNAS server ( AFP and SMB/CIFS ) and then occasionally use rsync to move that to Amazon S3.

  4. Ah, Time Capsule is a different thing altogether. As long as the protocol provides for checking data on the receiving end, which all TCP/IP based protocols should do, I don't think the data should be suspect. But the reliability of a wireless connection is always suspect and so I would not be confident that the backup completed successfully each time. For client system access, wireless is fine, but for servers the connections should be no-nonsense GbE.I hope to join the MacBookPro crowd this spring.How much do you pay for your Amazon S3 access?

  5. Makes sense. I moved the Mac mini to the wired network. It's now connected to a port on the Time Capsule. Amazon S3 costs are usage based. I pay per GB stored and GB transfered. Right now my costs are too high ( sometime as low as $5 or as high as $20 ) so I am considering a move to

  6. You have made a good resolution not to return the Mac Mini because I am still using it in spite of its disadvantages.

  7. I bought an external passport for $300..wish I would would have read this SMB share sooner! Nice workaround.

Comments are closed.