
An extensive ZFS setup on MacOS - tobiasrenger
https://justinscholz.de/2018/06/15/an-extensive-zfs-setup-on-macos/
======
jedberg
ZFS was supposed to be the default file system on Mac OS X 10.5 (Leopard). I
know this because I talked to some engineers at Apple, but the external
evidence is that Time Machine clearly was built as a ZFS snapshot explorer and
manager.

Sadly, they had to drop the whole thing because of the murky licensing on ZFS.

I sometimes dream of a world with a ZFS root partition on my MacBook Pro...

~~~
riobard
Is there any hope that Time Machine might get reworked with APFS?

~~~
dwaite
portions of time machine already have been (local backup uses snapshots, and
is ridiculously simpler as a result).

Proper Time Machine "v2" is a bit more complex (basically a rsync clone based
on local and remote snapshots), but still way simpler than the current "v1"
method, which builds its own change table from fsevents and has to cope with a
lack of snapshots in HFS+.

They can't use APFS as a Time Machine "v1" store because the unique feature of
HFS+ to support directory hard-links did not carry over to APFS. Migration of
a v1 to v2 volume would be a fun exercise in translations (folder hierarchy
collapsed to volume snapshots, and differing crypto approaches for encrypted
backups).

I suspect they are trying to get APFS in an evolutionary "stable" place so
they can publicly document it with the iOS 12/macOS Mojave/etc releases - the
changes they are making to support HDDs and Fusion drives this year are likely
a big internal evolution.

I also suspect Apple is just not in a rush to move time machine over - it
already works, has a surprising amount of integration across the OS for
backup/recovery, and people tend to value their backups working vs using the
newest technology.

Eventually, my belief is they will roll out Time Machine v2 and leave v1 (on
HFS+) only supported for restoration. Just like with v1 today, non-APFS
volumes will get a sparse bundle disk image to hold the APFS data. But they
will wait until they have a strategy to migrate the external volumes and disk
images.

------
mark_l_watson
Nice writeup. I have been tempted to try ZFS but to be honest it seems like
too much of a hassle compared to rotating three portable usb drives with
TimeMachine, and periodically creating ZIP / GPG encrypted backups with
descriptive names and dates, and copying to OneDrive, Google Drive, and
Dropbox. A few times a year these backups also include email, contacts,
snapshots of github repos, etc.

This may sound time consuming, but it is not. For day to day, the 256G drive
on my MacBook, github, and Dropbox are what I use for work.

~~~
thesephist
Another solution for data integrity I've been tempted to try instead of
switching filesystems is to go RAID 1 / 10 on a couple SSD's. A bit finicky to
set up (and not viable on Macbooks, obviously) but it's practically zero-
maintenance after that until one of the hardware parts fails.

I also do most of what parent comment does i.r.t. backing up to external
drives at regular intervals. It /sounds/ like a hassle, but most of my process
is automated so I plug in the drives, run a bash script, and wait til it's
done. Works quite well.

~~~
vetinari
The problem with RAID1 is, when the bit flips, you don't know (at the block
device or filesystem level) which copy is the good one.

------
Caillebotte
Glad to see ZFS adoption increasing. It is such a great filesystem and is one
of the main reasons my home servers run FreeBSD.

~~~
TheAceOfHearts
You can also use ZFS on Debian. I use it for my home server and I haven't had
any issues.

Although I'll note that I don't use ZFS on my boot device, just on storage
HDDs. Booting from ZFS seemed like a hassle, without clear benefits.

~~~
Mister_Snuggles
> Booting from ZFS seemed like a hassle, without clear benefits.

On FreeBSD, ZFS is a first-class citizen. Root-on-ZFS is something that the
installer can do and the bootloader understands. I've used root-on-ZFS through
five FreeBSD versions (plus numerous minor versions), all upgraded using
freebsd-update, with no issues.

On Linux, ZFS seems to be an addon, so hassles are to be expected.

As for benefits, Boot Environments[0][1] are a great reason for having root-
on-ZFS. While I don't personally do this, I can definitely see the appeal of
being able to roll back a major OS upgrade.

[0]
[https://www.freebsd.org/cgi/man.cgi?beadm](https://www.freebsd.org/cgi/man.cgi?beadm)

[1] [https://forums.freebsd.org/threads/howto-freebsd-zfs-
madness...](https://forums.freebsd.org/threads/howto-freebsd-zfs-
madness.31662/)

------
QUFB
Remember when OS X have native ZFS support? It's unfortunate that Oracle
choice the licensing path they did.

~~~
frou_dh
I remember when APFS was introduced, it was framed as being for everything
from the Apple Watch to the Mac Pro. Would ZFS have scaled down to whatever
puny hardware is in the first-gen watch?

~~~
jmovs
probably not

~~~
ianai
I can’t even think of a feature (other than compression/encryption but there
are better ways) that a watch would use from zfs.

~~~
yjftsjthsd-h
I imagine the main reason to use it would be that you have ONE filesystem that
runs everything, everywhere. Though come to think of it, I feel like snapshots
and relative ease of creating new filesystems in the pool could be handy for
upgrades.

~~~
ianai
Zfs still has a huge overhead. It needs more ram than a watch or even phone is
going to have - until they start packing enough that losing 4gigs of ram to
overhead is fine.

------
dddddaviddddd
Would use ZFS as the root file system on macOS if it wasn't so convoluted [1]
— gives the impression of being liable to break on major updates.

[1]
[https://openzfsonosx.org/wiki/ZFS_on_Boot](https://openzfsonosx.org/wiki/ZFS_on_Boot)

~~~
jmovs
the author of it here, hi ;-)

Yes, ZFS on Boot is right now more like a technology preview. Fonts break
badly, so ZFS boot is not advisable (and also doesn't give you that much
benefit really).

I want my data to be guaranteed to have integrity and really enjoy snapshots
(I've been bitten by Final Cut Pro X data deletion errors etc and rolling back
a snapshot is a bliss).

------
jhack
> Mail (super nice due to compression and big space savings (in my case 20%
> reduction of space needed)

Things will get even better once zstd is added[1]. Leaving transparent
compression out of APFS was a real big mistake by Apple, imho, given how fast
and cheap lz4 and zstd are. It's one of the reasons why I have a ZFS volume
set aside myself.

[1]
[https://www.phoronix.com/scan.php?page=news_item&px=OpenZFS-...](https://www.phoronix.com/scan.php?page=news_item&px=OpenZFS-
Zstd-Compression)

~~~
walterbell
Flash storage might be the highest-margin component sold by Apple, so there's
a conflict of interest with filesystem features that reduce the need for
storage.

~~~
ianlevesque
That seems a little tinfoil hat considering the largest consumer use of
storage is photos & video, neither of which compress any more anyway.

~~~
glhaynes
And that Apple is heavily pushing the HEIF/HEVC formats in ways that provide
similar image quality with lower storage uses.

~~~
walterbell
This is a macOS thread, but it would be helpful if Apple allows micro SD cards
to be connected to the lightning port of iOS devices.

~~~
Mister_Snuggles
Like this[0]?

I have no idea how well it works or what its capabilities are, but it seems to
be exactly what you are looking for.

[0] [https://www.apple.com/ca/shop/product/MJYT2AM/A/lightning-
to...](https://www.apple.com/ca/shop/product/MJYT2AM/A/lightning-to-sd-card-
camera-reader)

~~~
walterbell
That is mostly limited to copying photos and videos to/from the "Photo Roll".

There are many thousands of applications which process other file formats.
Some of them have natively implemented support for a 3rd-party (expensive)
storage device called iXpand, which itself comes with a poorly implemented
app. These third-party applications are poorly and pointlessly (re)
implementing basic OS file system I/O functions.

Is it possible that these pointless I/O hoops are hampering uptake of $1000
iPad Pros for "laptop" use cases?

------
sneak
The main reason to use ZFS, for me, is file content checksums. Neither hfs+
nor apfs support this, allowing silent data corruption.

------
wolfspider
I like it! As someone who uses XHyve and FreeBSD on MacOS have you considered
doing any of these ZFS ops against a VM? I also use NFS with my VM and it’s
extremely fast and reliable. This could work well moving things from the VM
into a fully working backup system which supports ZFS datasets and mounting
via NFSD which is still native on MacOS.

------
jiveturkey
good timing. i've been using zfs on macos for years (and different flavors as
well), but in a very basic way, manual snapshotting on occasion, that kind of
thing. i'm on a pretty old macos now, for fear of updating.

i've recently wanted to have a globally available privately hosted filesystem.
ie, not icloud, not dropbox, not google drive. AFS (auristorfs) would fit the
bill quite nicely except getting it backed by ZFS would be too much of a
chore. The days where I had time to deploy and time to maintain such things
are past.

but in perfect timing with this article, i've also just learned that BTMM can
make filesystems globally available. Apparently I won't see the files via the
same pathname everywhere, but I can live with that in exchange for the ease of
use.

------
adar
When I tried setting ZFS up on macOS, when I tried to set the ZFS pool as a
network share through macOS's sharing panel any individual user permissions I
set would not stay set after I closed out of the screen.

Is there another way of doing this that's recommended?

------
zimbatm
How compatible are the various ZFS forks?

Is it possible to create ZFS volume on macOS and mount it on Linux, FreeBSD
and Illumos all the same?

I'm asking because we are still missing a good cross-platform filesystem with
modern journaling and snapshotting.

~~~
rincebrain
If you take care when doing so, it's certainly possible. [http://www.open-
zfs.org/wiki/Feature_Flags](http://www.open-zfs.org/wiki/Feature_Flags) is
slightly behind ATM on documenting all of them, but is a good starting point.

(The various OpenZFS platforms all default to enabling all the feature flags
they know about on pool creation if you don't specify otherwise, which can
mean either read-only or no access to said pool on other platforms that don't
know what those flags are.)

------
burntrelish1273
O.O ZFS without FUSE?

~~~
rincebrain
There's actually not an up-to-date ZFS FUSE port on any platform, at this
point - all the OpenZFS ports are native to their respective kernels, and
while people have kicked around updating/making a new FUSE port for a while,
it's not been a priority for anyone.

------
lundman
\o/

