Time Machine OSX Leopard to FreeNAS

I recently replaced a Windows 2003 box with an OSX Leopard server; the users are now 90% mac users and long file names are always a problem for mac users on a windows file share so it makes sense. I installed the OSX server and setup the file shares required. Being an OSX Leopard server Time Machine is the obvious choice to backup the server. So it seems out of the box you can only use Time Machine with another OSX server or so it seems. I have always been keen on FreeNAS having used its cousin m0n0wall for some as a firewall.

A bit of quick digging round lead me to an article on ReadyNAS by DavidB. The instructions are for ReadyNAS but they work just as well for FreeNAS and I’m sure any other server you may want to use.
A quick summary of the process I followed based on the above article:
  1. Setup your FreeNAS backup server, I installed FreeNAS on a small 20 GB drive and setup 2 x 1TB sata drives with Raid 0.
  2. Create your file share, I used AFP and named the fileshare ‘Backups’ to match the default name other Time Machine backups use. I ended up with a 1.6TB backup file share.
  3. Create a local FreeNAS user to authenticate with.
  4. Create your ‘sparsebundle’ as if you are not using a mac formatted HFS+J drive Time Machine will fail to create the sparsebundle and you will get an error. To create the spasebundle use the following command. The format of the sparsebundle's name is _.sparsebundle .

    hdiutil create -size 1500g -fs HFS+J -volname "Backup of server" server_0015dda324e3.sparsebundle

    NOTE : if you do not make the maximum size of the backup large enough the Time Machine backup will fail. The first time I did a backup it failed because the backup was larger than the maximum size of the sparsebundle.
  5. Connect your share and copy over the sparsebundle into the Backups share.
  6. Open console on your OSX Leopard server and execute the following command.

    defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
  7. Open Time Machine preferences and choose ‘Change Disk’ you should see your Backups file share, select it, you will be prompted to authenticate, enter you username and password and close the Time Machine preferences
  8. Disconnect your file share.
  9. You can either wait for Time Machine to do a backup or run a backup to test.
Good luck this worked for me, hopefully it will be a reliable backup, we will see over the next few weeks.

UPDATE: You may be interested in my follow up article System Restore from Time Machine on FreeNAS

Aakash Tuesday October 21 2008 09:39 p.m.
Thanks! Great tutorial. But all you out there making your sparse bundle...make sure that on this part of the command "server_0015dda324e3" that the part that says server is your computer's name, i didnt have that it was failing to create the backup...after i changed it, I worked perfectly.
Matthew Hamilton Tuesday October 21 2008 10:45 p.m.
I have been running this for a few months and it works really well. The only problem I have faced is due to our VPN to our remote NAS being across a 256 KB/sec wireless connection. Sometimes the wireless connection disconnects during a backup. Because time machine backs up so reqularly, this occurs during a backup at least once a week. This causes a few time machine errors. I would expect over a more reliable network you would not get these errors.
Nik Sunday July 19 2009 12:44 p.m.
That MAC-address, on a MBP is that the MAC-address of en0 or en1?
Matt Sunday July 19 2009 07:42 p.m.
In this case the server has only one active network connection and is plugged into the network via the ethernet cable, the MAC-address is from the card.
Tracker Tuesday July 21 2009 07:41 p.m.
i got the error The backup disk image could not be created.
Matt Tuesday July 21 2009 09:06 p.m.
Are you trying to create your sparse bundle file on the share? You need to execute hdiutil to create your sparse bundle on your local machine and then copy the sparse bundle file over to your share.