Pages

Wednesday, February 17, 2010

Mac OS X as an iSCSI initiator: Time Machine on ZFS

As I described in previous posts, I setup an iSCSI target with Solaris COMSTAR backed by a ZFS volume. I want to use this volume as a disk for Mac OS X Time Machine. This way, I'll get the best of the two technologies: a pretty looking and easy to manage Time Machine for backing up my MacBook backed by an enterprise-level, redundant and scalable ZFS volume published as an iSCSI target over my private LAN.

No more consumer disks on a table, no more poor hardware-implemented file system sharing protocol. No more worries to lose a disk. Just Solaris, ZFS, COMSTAR and a LAN.

Mac OS X as an iSCSI initiator

Although it's a subject most spoken of, Apple hasn't released yet the necessary components for Mac OS X to be an iSCSI initiator. Fortunately there exists a solid and free solution by Studio Network Solutions: globalSAN iSCSI Initiator for OS X. Just download it, install it, restart your OS X and a new panel will appear in your System Settings:


Connecting to a target

Connecting to a target is really easy: just use the globalSAN iSCSI GUI to add the target:


The target name is obviously retrieved from your target configuration.

Using the disk

If you read the previous post, you'll know that this target is backed by a ZFS volume which must be formatted before being used. With the Disk Utility you can format the new disk:



Using the disk with the Time Machine

To use the new disk with the Time Machine you just follow the usual procedure:


Conclusion

That's it. Using a ZFS volume as a disk for Mac OS X Time Machine is just a few clicks away. Next time you plan to buy a new external hard disk, just wait and take into account that a robust enterprise-level solution is available with not much more than the necessary budget to purchase a couple of consumer disks.

9 comments:

  1. Grey Blog:

    Very good information. I downloaded globalSAN iscsi and I could not find any documentation where the app launcher is!!

    I use freeNAS 0.70. It now (did not in the past) allow time machine backups on both AFP, SMB,NFS, ZFS. Although worth noting that AFP is twice as fast as a protocol with OSX as any mentioned, even i-scsi.

    I do have a question, remote formatting is allowed on the host machine? Not an issue with me though using freenas.

    I do have Solaris 5.10 on a PC but doing this sort of thing is way too much of an education for me.

    Again thank you!

    ReplyDelete
  2. Hi ea!

    Glad you liked it. As you can see in the screenshots, GlobalSAN has no app launcher: it just uses a custom preference pane that you can access by launching the System Preferences application. From there, you'll be able to register your iSCSI targets, mount them and unmount them.

    I'm aware that Time Machine can use unsupported volume types such as NFS and CIFS: if Time Machine supported NFS, it would be an incredibly easy configuration to setup and go. However, since I prefer having it use a supported volume type, I've decided to rely on publishing a ZFS Volume as an iSCSI target. I recognize that it's a more complex setup but, as far as I can tell, it's worth the effort.

    When you mount an iSCSI volume with the GlobalSAN initiator, Mac OS X will see it as a local drive: thus you'll be able to use Disk Utilities to format it with HFS+. In fact, that's what Time Machine actually does when using such a volume for the first time.

    I'm not suggesting you drop FreeNAS, of course, however, if you're at least familiar with a ZFS-enabled Solaris, I encourage you try it to build your storage server. I greatly appreciate ZFS features, its clean administrative model and its ease of use.

    You might also want to try OpenIndiana, Nexenta and NexentaStor as alternatives.

    You're welcome,
    Grey

    ReplyDelete
  3. Mac OS X is NOT, and never has been referred to as OS/X. It has ABSOLUTELY no relation to IBM's OS/2 system from years ago. Say it with me now: there is not, nor will there ever be a forward slash in Mac OS X.

    ReplyDelete
  4. Robert, I updated the post accordingly.

    I appreciate irony, and I swear I was not thinking about OS/2 when I mistyped OS X (unless it was a Freudian slip).

    ReplyDelete
  5. Hello Grey,

    I was actually looking for GlobalSAN's initiator when I found your blog post here (second link).

    It used to be free, but it's trialware now :(

    Just wanted to let you know. Shame they ruined your (and my!) idea :P

    ReplyDelete
  6. Thanks Andrew, you're absolutely right. It seems that, as soon as the GlobalSAN initiator had some success, they changed the licensing model. I never updated this post, and it's good you posted your comment.

    Needless to say, I'm not going to pay that license for such a home-user scenario. It's a pity, because it was great to have that possibility.

    Instead, since Lion broke the last free version of the GlobalSAN initiator, I'm performing few Time Machine backups on an external drive and switched to a heavier use of rsync against the same ZFS datasets, published using NFS. I made a small Cocoa GUI for rsync, which is not production-ready yet, but I'll surely post about it in the near future.

    ReplyDelete
  7. yea I wish someone, maybe Apple, would release an iscsi initiator that just runs on the mac. It ought to be part of BSD for crise sakes. There is open iscsi, but its still not stable.

    ReplyDelete
  8. Hello,

    Just followed your guide (at least parts of it), and got everything up and running. The main issue I had in the end was the inability to update the size of the final formatted disk.

    Resizing the ZFS volume and LU wasn't very difficult, and a simple disconnect/reconnect of the iSCSI target updated the size of the disk (iSCSI disk) on my mac. From here I couldn't get the formatted disk to update in size, no matter what i tried. Decreasing it in size worked fine, as well as increasing it, but only up to the original size of the disk.

    This problem made me realize this solution wasn't for me, since the main thing I wanted was the ability to easily add another disk or two when I ran low on disk space.

    Just a heads up for everyone. Loved the guide though!

    ReplyDelete
    Replies
    1. you can solve this problem. there is a size on the LU itself that needs to be modified:

      stmfadm modify-lu -s 600144F0599F8B00000050AD25620002

      you might need to offline the LU first.

      Delete