How To: Set up Time Machine for Multiple Macs on FreeNAS (9.2.1.3)

FreeNAS is awesome. Also, FreeNAS is hard... I recently switched from a Synology device, and while I am already appreciating the increase in functionality and power, it's certainly not as easy to do some basic tasks. One of those tasks is setting up a Time Machine share where all of my household Macs can back up. Between reading the tutorials and giving some trial and error myself, I think I have come up with a good solution.

And before I get started with the step by step guide, let me reiterate one thing: Permissions, Permissions, Permissions! If you ever find yourself banging your head against a wall because something in FreeNAS isn't working as you expect it to, the likely culprit is permissions. Once you wrap your brain around them, though, things become more simple. Hopefully this guide helps put a foundation around that.

The Default FreeNAS Home Screen

The Default FreeNAS Home Screen

This article assumes that you have FreeNAS already up and running on your network and that you're able to connect to the main home screen with your web browser. I recommend setting it a static IP, as well. Our first step will be to create a group / user for Time Machine backups.

2

Under the "Account" section on the left, click "Groups," and then click "Add Group."

3

You don't need to change the default value for the group ID, and put something like "time-machine" for the group name. Leave everything as default and click OK.

The next step is to create a ZFS dataset where we're going to put the Time Machine backups. The dataset must be on a ZFS volume. I'm assuming you have already created a ZFS volume with your disks here, but if you haven't stop reading this guide and go read the FreeNAS ZFS documentation here. If you have already created the volume, create a dataset. Datasets can be nested inside of other datasets so I actually have one dataset called "Backup" and inside of that one, I have one callled "Time-Machine" ~ it really just depends on how you want things set up.

4

After you enter the name, "Time-Machine", leave all of the default values alone. The below screenshot shows how I have "Time-Machine" nested inside of my Backup dataset.

5

So now we have a dataset. This is going to be where all of our Time Machine backups get saved. The next step is the most important and the one that has bitten me before... so don't forget it. We need to change the permissions on the "Time-Machine" dataset. Recall that we initially created a group called "time-machine" - we are now going to set things up such that any user in the "time-machine" group can write to the "Time-Machine" dataset. Click on the "Time-Machine" dataset and then click on the icon with a key on it to change its permissions.

6

When you click that, a permissions dialog box will pop up.

7

I chose not to change the default user owner of "root." However, definitely change the group owner. In the drop down box, the "time-machine" group that we previously created should be selectable. Click that and then make sure to have the boxes checked as I have in the image above. We want any user in the group to have read / write / execute privileges.

Click the "Change" button to have the new permissions take effect. Now it's time to create a user for the Time Machine backup. I believe it is best to create a separate user for each computer (and I'll explain why at the end of the post) so just create users that reflect that computer. For example, the user I'm creating is called "kevinmacbookair."

8

Once again, you navigate over to the left column to create a new user. Leave the "User ID" field as the default. Give your username a simple lowercase name like mine. Uncheck the box about creating a new primary group for the user. Instead, go to the drop down list and select "time-machine" in there. In the full name, put a descriptive name. Type in a password, and then you're good to go.

So what we've done so far is created a group called "time-machine" which has full access to the "Time Machine" dataset. Next we added a user that is part of the "time-machine" group. Easy! The last thing we need to do is create an AFP (Apple Filing Protocol) share that will broadcast this over the network so your Mac can see it. To do this, click the "Sharing" link on the column on the far left and click the button to create a new AFP share.

9

Name your share something you like, and then use the file browser to make sure that the "Path" is set to the ZFS dataset that we created for our Time Machine backups. Next, for the "Allow List" and "Read-write Access" fields, we want to put the group that we created, "time-machine" ~ however, because it's a group and not a user, we need to put the "@" symbol in front of it: "@time-machine". Next make, sure the "Time Machine" box is checked. Finally, take a look at those check boxes of privileges and make sure they match what's listed above. Then click OK. At this point, we're done with everything on the FreeNAS system. It's now time to set up Time Machine on the Mac!

10

On the Mac, just open up the Time Machine preferences, and if you go to select a disk, you should find the one we created there! It will ask you for a username / password, and you want to make sure you enter the machine-specific one we created in FreeNAS, not your OS X username / password.

11

You should be golden! If you want to add more than one computer, you don't need to add any new AFP shares or anything like that. Just create new users for each machine, and make sure that each user is part of the "time-machine" group that we created earlier. The final improvement to make this work even better would be for us to cap how much space each computer has to back up. For example, my MacBook Air has 256GB of space, and anything on my MacBook Air is also on my other machines so I really wouldn't want to give it more than 300GB of usable space for historical backups. Time Machine will automatically delete the older ones if it runs out of room. On the contrary, my MacBook Pro is loaded up with all of my important data and I might want to give it 2x the space of its SSD. Right now there isn't a great way to do this for multiple Macs in FreeNAS, but a feature is coming soon that will make it easy! This feature is per-user quotas. This will allow us to specify the maximum amount of space each user is allowed.

I hope this guide was useful!

19 thoughts on “How To: Set up Time Machine for Multiple Macs on FreeNAS (9.2.1.3)

  1. Josh G

    I just use a separate dataset for each mac i'm backing up, and thus a separate share. this allows me to limit the max size each system can use.

    Reply
    1. Post author

      Yes, but if you use a separate dataset, as you state, you must also create a separate share. This is not recommended by FreeNAS (saw that in the documentation) and it requires having 3 AFP shares. It does give you the ability to limit the max size each system can use, though. I'm hoping the user quotas come sooner than later. Apparently you can already do it with the CLI, but it's just not yet implemented in the GUI.

      Reply
      1. Josh G

        More shares on the system would cause more load, which is probably the reason why FreeNAS dosn't recommend it.
        This is what i use at home, i have a AFP share for Each Data set, and i have a Dataset for each Mac. Each dataset has a max size limit, works perfectly.

        Reply
        1. Post author

          Glad to hear it's working well for you! As long as you're not having issues, then this seems reasonable as well. As long as you haven't had issues, both seem to be a just fine fit. How many Macs are you backing up?

          Reply
          1. Josh G

            I only have 1 at home, used to have 2.. but at one of my customer sites i've got 5 backing up with about 300 gb each.

  2. I tried this last year and found it unstable at that time. After a few days/weeks, Time Machine would tell me that there was something wrong with the backup on FreeNAS and it would have to restart the backup. Perhaps it's working better now.

    The killer feature I wanted was being able to backup family computers remotely. In other words, I wanted to automate the backup for my Mom and brother over the Internet. I'm not aware of a way to make FreeNAS available to Time Machine clients outside my LAN without opening a hole in my firewall. That didn't seem safe.

    So, for both stability and remote access, I switched from Time Machine to CrashPlan, which has never hiccuped for me in over a year I've used it.

    Others are very happy about Time Machine, but I don't feel it's a good choice for a multi-user, network access backup. YMMY.

    Reply
    1. Post author

      Nello,

      It seems like the issues have been fixed. The only reproducible issue I can create is if I'm in the middle of a backup and my router reboots, when it comes back online, Time Machine will say the volume is in use. This is due to AFP not releasing the connection, but I don't typically reboot my router so this is pretty rare. I think this is a bug that can be fixed (and to be honest, I have seen it with Apple Time Capsules, the official product, as well).

      I have had zero issue backing up 3 macs now for at least a week. I actually use Crashplan as well. The only issue with Crashplan is you can't do a full recovery from it like you can w/ a Time Machine. Yes, of course you can just copy the data, but with Time Machine, when you buy a new Mac, you just point it tot he backup and voila all of your settings / everything is there as if you were still using your old computer.

      Reply
      1. George Hartzell

        You'll need to wait a bit longer to see the issues that Nello described and may never get bitten.

        Once per month (I think at the beginning of the month, but maybe every 30-ish days?) OS X will verify the contents of any networked backups.

        That is the point where you'll discover whether or not you've been bitten. You can also verify a backup manually by holding down the option key when you access the timemachine menu from the toolbar and choosing 'Verify Backup'.

        The problem seems to be related to backups that don't run to completion. I see it frequently on my laptop and I believe that it happens when I wake the laptop up, which often fires off a time machine backup, then close it and take it to work with me.

        I do not believe I have had a problem with a Mac Pro that never leaves its home next to my desk.

        It is not a FreeNAS issue, it is yet another downside of OS X's crappy filesystem. Apparently there is a lot of magical code in OS X and the Apple TimeCapsule that makes the remote back more reliable but even there this problem comes up. I also see it on remote disks served up from an Raspberry Pi running Linux, one via netatalk and another via samba.

        Reply
  3. Karl

    Any thoughts on ZFS reduplication? I'd imagine that there'd be a lot of identical data between multiple macs' time machine backups.

    Reply
    1. Post author

      I did a lot of reading up on FreeNAS, and apparently de-duplication is VERY CPU / disk intensive. I'm not sure what the space savings would be, but since I have multiple machines that are automatically backing up hourly, I didn't want that extra stress on the machine. FreeNAS does have LZ4 compression enabled by default, though… but according to the UI, I'm only getting a 1.01x compression ratio on that.

      You can enable higher compression (which would be slower / more disk / cpu intensive) like gzip, and I actually have that enabled on an "Archive" dataset I use just for archiving data I don't access very frequently. I get a 1.3x compression ratio on that.

      Reply
      1. Karl

        I don't have any experience with deduplication as of yet (Haven't used ZFS since a job a few years ago and I have not built my FreeNAS box yet), but gzip compression was no problem – just use one of the lower compression levels (e.g. not 9). Also, higher compression is more CPU intensive but less disk intensive since fewer bytes are written to/read from the disk, Depending on the speed of your disks and CPUs, speed might actually go up from compression.

        I'll probably experiment with deduplication for the time machine volume since I don't expect it to get hit very hard in my case. Worst comes to worst I'll have to change it and start over.

        Anyway, thanks for the guide! It will probably save me a bunch of time when I get around to this.

        Reply
  4. I have listen first time about this brilliant machine. Your post is really great. I would like to visit again your website. Thanks for nice post.

    Reply
  5. I tried this last year and found it unstable at that time. After a few days/weeks, Time Machine would tell me that there was something wrong with the backup on FreeNAS and it would have to restart the backup. Perhaps it's working better now.

    Reply
  6. Graham J

    Wow thanks so much for this! I've been fighting with Time Machine and FreeNAS for a while now and didn't realize groups were the answer.

    Cheers!

    Reply
  7. Matt

    Excellent article – unfortunately, as in the past, I’m able to login and connect to the ZFS dataset in FreeNAS and recognized by Time Machine. Time Machine will begin a countdown till backup, when the backup start, I get the following Backup Failed error…

    “Time Machine couldn’t complete the backup to “freenas server”.

    The network backup disk could not be accessed because there was a problem with the network username or password. You may need to re-select the backup disk and enter the correct username and password”

    As I said, I am able to complete the initial login when prompted, so I’m confident the username/password is correct. FreeNAS is showing an immediate AFP logout after login and a small read/write stat. What I think is occurring is that the initial login credentials are not being saved, when Time Machine attempts the initial backup, there’s no attempt at login.

    This was the very same issue I ran into post-Mavericks update. Help appreciated, if you have the time, otherwise, thank for your contributions to the FreeNAS community.

    OSX: 10.9.4

    FreeNAS: 9.2.1.5-RELEASE-x64

    -Matt

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">