Mac Backups to NAS via SMB
November 8, 2008 – 9:11 amFor 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 com.apple.systempreferences 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.
Sphere: Related Content