7 ms·
An extensive ZFS setup on MacOS
- mark_l_watson 8y agoNice 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 8y agoAnother 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 8y agoThe 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.
- lomnakkus 8y agoRAID1/10 doesn't really help with data integrity (at least if it's just basic "standard" RAID). It helps against catastrophic media failure and not much else.
- QUFB 8y agoRemember when OS X have native ZFS support? It's unfortunate that Oracle choice the licensing path they did.
- frou_dh 8y agoI 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 8y agoprobably not
- ianai 8y agoI 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 8y agoI 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 8y agoZfs 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.
- peatmoss 8y agoUgh, for the life of me I never understood why Apple didn’t make Time Machine heavily integrated with ZFS right from the get go. In those days it wasn’t Oracle, it was Sun. And I cannot imagine Apple not being able to negotiate licensing terms with Sun. Hell, Jonathan Schwartz had already worked with Steve Jobs before when Lighthouse was writing heaps of software for NeXT. I can’t imagine Schwartz and Sun not being willing to play. In fact, back in those days Apple still was in the enterprise game with XServe hardware. Fellow NeXT / Apple aficionados and I remember one WWDC where we were suspecting a big Sun-Apple partnership announcement, possibly paving the way for a future Apple acquisition of Sun. But then Oracle happened and burned everything that had been good about Sun to the ground. I have mostly given up my 1990s-born hatred of Microsoft and Bill Gates. It’ll be some time before I’d ever trust Oracle or Ellison.
- dddddaviddddd 8y agoWould 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 8y agothe 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).
- lundman 8y ago\o/
- jhack 8y ago> 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-Zstd-Compression https://www.phoronix.com/scan.php?page=news_item&px=OpenZFS-...
- walterbell 8y agoFlash 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 8y agoThat seems a little tinfoil hat considering the largest consumer use of storage is photos & video, neither of which compress any more anyway.
- walterbell 8y agoMacbook Pros have use cases which extend well beyond photos & video.
- glhaynes 8y agoAnd that Apple is heavily pushing the HEIF/HEVC formats in ways that provide similar image quality with lower storage uses.
- walterbell 8y agoThis 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.
- 8y ago
- Caillebotte 8y agoGlad to see ZFS adoption increasing. It is such a great filesystem and is one of the main reasons my home servers run FreeBSD.
- TheAceOfHearts 8y agoYou 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 8y ago> 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.31662/ https://forums.freebsd.org/threads/howto-freebsd-zfs-madness...
- johannes1234321 8y ago> Booting from ZFS seemed like a hassle, without clear benefits. On Solaris it is integrated with the package manager, thus on updates a snapshot is taken and if anything goes wrong one can revert to the previous state.
- jeduardo 8y ago> Booting from ZFS seemed like a hassle, without clear benefits. It used to be a major hassle around 2 years ago but since then things have evolved significantly, up to the point where as long as you follow the install instructions correctly the first time, you can trust it to just keep on working. One benefit (for me) is the ability of having full system snapshots taken periodically with minimum storage cost. I've used a setup on my personal workstation for years where a zfSnap job takes snapshots every hour. This has proven itself to be super convenient when accidents occur. Of course that the important data is backed up externally or committed to Git, but having the possibility to quickly revert mistakes is a big nice to have. Such a system could also be easily improved to ship these snapshots to an offsite location as incremental backups. Of course the same process can be done in many other ways, but it is also other thing nice to have. Another benefit I've had with this is portability between machines. My current Debian Stable system with ZFS on root began its life running out of an external HDD plugged onto an old Macbook Air. After I was able to get an external SSD and a Thunderbolt adapter, all I needed to do was to add the new device to the existing pool as a mirror and wait for resilvering, then remove the old device after all data was mirrored and the migration was done. When I finally got a new laptop, all I needed to do was to boot from the SSD and add the new NVMe device to the pool as a mirror, then remove the old SSD afterwards. There is also the transparent compression feature that can potentially save a lot of HDD space depending on the usage pattern of the particular system. And of course since ZFS is there present in your system (as it's the rootfs anyway!) you can use all other features you want, such as slicing volumes to use as root volumes for virtual machines or to use it as the backend for a local Docker host, where Docker can use an specific ZFS driver and leverage filesystem capabilities when storing images. Of course you don't need to run it as the rootfs for many of these things, but you if do like ZFS then the benefits, possibilities, and the fact that you can do it outweigh the (nowadays reduced) hassle. :)
- jedberg 8y agoZFS 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...
- ascom 8y agohttps://openzfsonosx.org/wiki/ZFS_on_Boot https://openzfsonosx.org/wiki/ZFS_on_Boot Not quite "it just works," but it's an option...
- riobard 8y agoIs there any hope that Time Machine might get reworked with APFS?
- dwaite 8y agoportions 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.
- zimbatm 8y agoHow 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 8y agoIf 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.)
- wolfspider 8y agoI 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.
- burntrelish1273 8y agoO.O ZFS without FUSE?
- rincebrain 8y agoThere'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.
- adar 8y agoWhen 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?
- sneak 8y agoThe main reason to use ZFS, for me, is file content checksums. Neither hfs+ nor apfs support this, allowing silent data corruption.
- jiveturkey 8y agogood 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.