OS X Time Machine and FreeNAS


With Leopard Apple introduced its version of backup software for the Mac called Time Machine along with some hardware called Time capsule.  Adorned with coverflow as an interface it is simple to use and configure.  Periodic backups are displayed through a coverflow interface which allows users to go backwards in time to any point they desire.  Simply attach a usb drive to the local machine and Time machine does the rest.  By default it is not meant to be used with a Network Attached Server (NAS) server (other than Apple Time capsule).  However, it can certainly be done.

A Little background to the Time Machine process.

What time machine does is creates a disk image (sparsebundle) on the usb drive which is initially set at a small size than is allowed to grow until it reaches a size below the remaining disk space on the drive.  Only one image can reside on a given disk partition. For a one mac configuration this is not a problem.  However in a multiple mac environment this is not practical.  In this type of environment a NAS server is best suited.  For a one partition NAS setup see basic setup. For a multiple mac backup setup see Advance section

Getting Time Machine to work on a FreeNAS server (BASIC SETUP)

  1. Build a sparsebundle.  In terminal Type the following. Filling in the parameters for size $MACHINENAME_MAC_ADDRESS.  Where $MACHINENAME is the name give in Network preferences and MAC_ADDRESS is the mac address of your ethernet port.

tom$ hdiutil create -size $SIZEg -fs HFS+J -type SPARSEBUNDLE -volname “Backup of $MACHINENAME” $MACHINENAME_$MACADDRESS.sparsebundle

for example:

tom$ hdiutil create -size 70g -fs HFS+J -type SPARSEBUNDLE -volname “Developer” Developer_001a629dd5c3.sparsebundle

Then move the newly created sparse bundle to the NAS Drive
2.  Open a terminal session and type the following to allow time machine to use the NAS

Terminal Time Machine NAS

3.  Open Time Machine application and select change disk.  You should see the NAS drive as an option.

Getting Time Machine to work on a FreeNAS server (ADVANCED SETUP)

!!!!!!!!! Warning proceeding past this point will destroy all data on the drive !!!!!!!!!!!!!!

1.  FreeNAS does not support disk partitioning.  To do this you have to use a Partitioning application such as SuperFdisk.  It comes as a iso image that can be burned to cd.

2. Once SuperFdisk is burned to cd boot the NAS into it.

3.  Selecting the Hardisk should show the partitions already on the drive.

4.  Erase the Master Boot Record and create the new partitions.

Each new partition will be a primary partition for which there can be a maximum of 4. So if you have 3 Macs running time machine you will need a minimum of 3 partitions

5.  Once finished reboot into the FreeNAS and proceed to the FreeNAS web interface and configure FreeNAS to setup and format the new partitions.  Once in the Web interface go to Disk then Mount Point.  Click on the plus sign to add a mount point.  The mount point will refer to one of the partitions in on the disk.  The add mount point window will display.  Select the Disk then go to the Partition and select 1 from the pull down menu for partition 1.  Select the File system for the partition to be formated in  (ufs is preferred).  Give it a share name and a description.  Then click add.  Repeat for additional partitions.

6.  Now that the partitions are complete. Go to the Basic setup above and create a sparsebundle for each Mac, copying them into there respective partitions that were just created.

4 Comments

  1. Bavo says:

    I have a few questions before I start wit the one-mac solution.

    I’ve got FreeNAS installed on a 1.5TB Harddisk. The Disk is mainly used as a central place for home video, foto, iTunes musicserver, data storage etc. We use serveral computers, all windows machines, I’m the only one using a mac (MacBook Pro Snow leopard)

    Will creating a Time Machine image using the steps provided affect the current use of my FreeNAS disk?

  2. tom says:

    You should be fine. The sparsebundle is like a disk image. Just be mindful that the sparse bundle grows as your backup data grows so potentially you could run out of disk space. However, if you only backup what you need you should be fine.

  3. Bavo says:

    Thank you very much for the info!

  4. Bavo says:

    I have another question.
    Will it work if you don’t build a sparsebundle, but do enable Time machine to use your FreeNAS disk?
    I’m not sure if I acutally did build a sparsebundle. I just got a message that I can only create one sparsebundle on a disk. I didn’t move a sparse bundle either.
    I did set up Time machine and it did find my FreeNAS disk.

    It’s hasn’t started backing up, I’d like to check first.

Leave a Reply