ZFS On Mac: Easier Than You Thought

by Robin Harris on Tuesday, 27 February, 2007

Not so easy I could do it, though
ZFS is the übercool Solaris file system cum volume manager cum software RAID now being ported to Apple’s Leopard (see ZFS On Mac: Now All But Official and ZFS: Threat or Menace?. Lots of skepticism from people who can’t imagine another file system – even with all the functionality of ZFS – in place of um-m-m, ah – whatever file system Mac OS X is using today. Journaled HFS+?

Oooh-h-h it’s so hard . . .
Much of the objection to a wholesale movement from HFS+ to ZFS is that it is so hard to do. But is it really? Of course the engineers involved are telling their bosses and their buddies how hard it is, even if they’re playing Halo six hours a day. Honestly though?

Maybe not super-easy, but read on
In Technical Q&A QA1242, updated a couple of months ago, Apple talks about their new VFS plug-in architecture in 10.4.

Prior to the introduction of Mac OS X 10.4 Tiger, the BSD portions of the Mac OS X kernel were not architected for binary compatibility. . . . The slightest change to the kernel (reordering the fields within a structure, for example) would break all VFS plug-ins.

With Mac OS X 10.4 Tiger, Apple has solved this problem by introducing a VFS Kernel Programming Interface (KPI). . . . you no longer access fields in kernel structures directly; rather you call accessor functions that are supplied by the KPI. By using this KPI you can develop a VFS plug-in with the expectation that it will be compatible with future systems.

Leaf it be
The KPI is designed for Leaf File Systems, which include

  • Local file systems
  • Network file systems
  • Cluster file systems

I know you’re thinking: what other kind are there?

Stacked, really

A stacking file system (sometimes called a filter file system) sits on top of another file system and modifies its behavior in some way. The canonical example . . . is an encryption file system. You could stack this file system on top of any existing file system to provide encryption support.

A telling admission
Apple then goes to say that they don’t support stacked file systems because they don’t see how to make them reliable, fast and compatible with future OS versions. Pretty good reasons, IMHO. But they used to think they could:

Note: Earlier Apple documentation stated that stacking VFS plug-ins could be used to solve certain problems, such as file-level encryption and virus checking. We even went so far as to publish an example of this, the Politically Correct file system (PCFS), that ran on pre-release builds of Mac OS X. Subsequent experience has shown that this technique does not work properly and we no longer support it.

Engineers hate it when they have to back track like that. Someone must have believed it possible to get as far as they did. The important thing is that it demonstrates the ambition of the Apple engineering team for really cool file system capabilities.

Speculation is the father of invention
It looks like they figured out that stacking file systems probably wouldn’t work about 18 months ago (they inserted the bug tracking number for stacking file systems a year ago). They’d already started working with Sun on DTrace by that point, and since Sun’s DTrace and ZFS teams know each other, there was probably some engineering over Indian food and beer. Thus ZFS on Mac took flight.

Making VFS robust
In December Apple added sample code projects for EmptyFS and MFSLives that give developers something to help develop and test their ideas. These tools are likely a by-product of making the VFS interface robust enough to support ZFS and – who knows – maybe some other file systems.

The StorageMojo take
Apple sees real demand for file system alternatives on Mac OS X, in addition to their own plans for ZFS. This is good news for the consumerization of IT: enabling new file systems to be tested and deployed on high-volume workstations and servers should encourage innovation. Kudos to Apple for opening up the VFS KPI.

Comments welcome, as always. Especially if you know more about VFS than I do. Not a very high bar. Moderation turned on because I love getting mail.

{ 7 comments… read them below or add one }

hirni February 28, 2007 at 1:04 am

just some nitpicking:

‘acfs’ aka. Apple-Xsan or more exactly ADIC StorNext was the second non-HFS+ filesystem for MacOS-X.
I personally think, ZFS is an overhyped POS – exactly like OCFS2.
Just because it’s for free – it doesn’t mean it’s usefull.
Like every new filesystem – ZFS has to go through a maturity phase of several years – and when it arrives at that usable/stable point – it’s already obsolete (because nobody needs it).

just my $0.02

Robin Harris February 28, 2007 at 7:28 am


As someone who thinks ZFS is pretty great, I have to differ. In my view, because ZFS combines the functionality of a file system, RAID and volume management with better-than-the-competition data integrity, it represents a fundamental step forward. Putting it on a high-volume platform like Mac will speed the debugging process.

Will it be perfect day one? No. Neither was journaled HFS+. Will it be a big improvement? Yes indeed.


ZDigital February 28, 2007 at 12:47 pm

ZFS on MacOS X may not mean anything to end consumers who are on their first Mac (switchers, upgraders, whatever reason), but to performance users and the alpha geeks that hack their Linux and Solaris boxes with a MacBook Pro, it is real news.

ZFS represents a lot of possibilities and it also aligns MacOS X with the at-large Unix community (particularly Solaris) even more. Apple may ship more Unix-based computers than anyone, but that doesn’t mean that they are accepted in traditional Unix circles. The inclusion of Dtrace and ZFS is another way Apple shows both leadership and alignment with existing technology and loses a bit more NIH badwill that has pervaded them for so long.

In the end ZFS won’t make anyone buy a Mac, but you never know what Mac people will do with something like ZFS until it’s officially supported by Apple. Soon, we will and then who knows what interesting things may come. I forget who coined this phrase, but it’s the truth, “new technology always fall to the level of the street.

To Hirni-lighten up, jeez.

Brainy February 28, 2007 at 2:20 pm


Before making comments about ZFS you should read http://www.opensolaris.org/os/community/zfs/docs/zfs_last.pdf

Also, there are already a lot of companies that use ZFS in Production, some even used ZFS in production before it was officially released in Solaris (Joyent…)

ZFS is really a huge step forward. Is it complete in features? No. Is it usable in production? Definitly!

Miro February 28, 2007 at 7:44 pm

I wouldn’t say that after Steve Jobs announce the new Mac OS ‘now with ZFS’ it is not going to mean anything to the end consumers – it will be the most talked new feature probably.We all know Steve and his reality distortion field…

No other desktop OS will have this kind of file system and factor of coolness – it is going to be big! Just put Apple’s marketing machine behind ZFS and watch – time machine – snapshots, mirrors, raidz, no need to fsck after hard reboot and what not.

ZFS will give Apple another big advantage over Vista and its pathetic new NTFS ‘upgrade’ with ‘versions’ for overwritten files. After 5 years in development this is all they could come up with? Give me a break… and the head of WinFS dev. team 🙂

IMHO Sun is doing a very good job these days with Solaris, Java and especially ZFS – Apple is just going to make it main stream FS, where it belongs.

I can’t wait until ZFS is ported to FreeBSD as well (almost done), I am in love with the snapshots 🙂

hirni March 1, 2007 at 2:10 am

@brainy: …yes – interesting presentation.
(nice PDF – but it doesn’t write real data to real disks)
BTW – they don’t mention fs-wide user/group-quotas !
-and you can NOT boot from it …

Being now in the filesystem-space for some years – I saw a lot of “revolutionary new” filesystems being announced(!).
The master in this space is still IBM (HPSS,GPFS,StorageTank,TSM…).
(anyone betting what the “next new thing” from them will be ?)

I understand that people are enthusiastic about “new things” – that’s fine. But this “new love” usually fades out quite fast – wait 6 months …
(just to become replaced by the next “new love” – like some revolutionary new “virtualization of whatever”)

AND the real quality of ZFS can only be determined, once this blinding (“love makes you blind”) and hyping has gone.
That’s my point. – just wait and see.

Brainy March 1, 2007 at 1:01 pm


Didn’t understand your comment about not writing real data to real disks….

It is possible to create per user/filesystem quotas, otherway around it is also possible to have reservations.

Sun also sells other filesystems. There will never be a one size fits all.

ZFS is not that new anymore, but from my point of view there has not been a hype yet. Filesystem users are mostly very conservative, in using filesystems (let the other go first attitude…).

Compared to UFS, ZFS has undergone a lot more testing before going into a solaris production release. Of course, through the age of UFS, there is a lot more real life experience…but hey, somewhere you have to start…

Finally, it is already possible to boot from ZFS, it is already available in OpenSolaris. We just have to wait half a year for arrival in Solaris (install procedure has to be updated).

Leave a Comment

Previous post:

Next post: