• ahl 4 days ago

    Back in 2016, Ars Technica picked up this piece from my blog [1] as well as a longer piece reviewing the newly announced APFS [2] [3]. Glad it's still finding an audience!

    [1]: https://arstechnica.com/gadgets/2016/06/zfs-the-other-new-ap...

    [2]: https://ahl.dtrace.org/2016/06/19/apfs-part1/

    [3]: https://arstechnica.com/gadgets/2016/06/a-zfs-developers-ana...

    • whartung 4 days ago

      As a desktop user, I am content with APFS. The only feature from ZFS that I would like, is the corruption detection. I honestly don't know how robust the image and video formats are to bit corruption. On the one hand, potentially, "very" robust. But on the other, I would think that there are some very special bits that if toggled can potentially "ruin" the entire file. But I don't know.

      However, I can say, every time I've tried ZFS on my iMac, it was simply a disaster.

      Just trying to set it up on a single USB drive, or setting it up to mirror a pair. The net effect was that it CRUSHED the performance on my machine. It became unusable. We're talking "move the mouse, watch the pointer crawl behind" unusable. "Let's type at 300 baud" unusable. Interactive performance was shot.

      After I remove it, all is right again.

      • GeekyBear 3 days ago

        Back in 2011, Apple paid $500 million for Anobit, a company producing enterprise grade SSD controllers.

        Since Apple was already integrating custom SSD controllers onto their A series SOCs, presumably the purchase was about Anobit patents.

        > Anobit appears to be applying a lot of signal processing techniques in addition to ECC to address the issue of NAND reliability and data retention... promising significant improvements in NAND longevity and reliability. At the high end Anobit promises 50,000 p/e cycles out of consumer grade MLC NAND

        https://www.anandtech.com/show/5258/apple-acquires-anobit-br...

        Apple has said in the past that they are addressing improved data stability at the hardware level, presumably using those acquired patents.

        > Explicitly not checksumming user data is a little more interesting. The APFS engineers I talked to cited strong ECC protection within Apple storage devices... The devices have a bit error rate that's low enough to expect no errors over the device's lifetime.

        https://arstechnica.com/gadgets/2016/06/a-zfs-developers-ana...

        • Marsymars 3 days ago

          That's excellent if you're using Apple SSD storage, but seems unhelpful if you're running, say, a large array of HDDs connected to your Mac.

          • GeekyBear 3 days ago

            Sure, if you are managing a large amount of external data, you may want to go with a RAID array or the existing OpenZFS port, but even Windows 11 still defaults to NTFS, which offers less resilience.

          • kjkjadksj 3 days ago

            What is the devices lifetime in apples eyes? 5 years till support is dropped? Gulp.

        • mdaniel 4 days ago

          > Just trying to set it up on a single USB drive

          That's the fault of macOS, I also experienced 100% CPU and load off the charts and it was kernel_task jammed up by USB. Once I used a Thunderbolt enclosure it started to be sane. This experience was the same across multiple non-Apple filesystems as I was trying a bunch to see which one was the best at cross-os compatibility

          Also, separately, ZFS says "don't run ZFS on USB". I didn't have problems with it, but I knew I was rolling the dice

          • queenkjuul 4 days ago

            Yeah they do say that but anecdotally my Plex server has been ZFS over USB 3 since 2020 with zero problems (using Ubuntu 20.04)

            Anyway only bringing it up to reinforce that it is probably a macOS problem.

            • 3np 3 days ago

              I haven't had any issues with attaching normal SATA drives with SATA-over-USB cables. Meanwhile some otherwise apparently fine USB thumb drives got abysmal results (<100kbps read IIRC).

              ZFS on Linux.

            • ryao 4 days ago

              > I honestly don't know how robust the image and video formats are to bit corruption.

              It depends on the format. A BMP image format would limit the damage to 1 pixel, while a JPEG could propagate the damage to potentially the entire image. There is an example of a bitflip damaging a picture here:

              https://arstechnica.com/information-technology/2014/01/bitro...

              That single bit flip ruined about half of the image.

              As for video, that depends on how far apart I frames are. Any damage from a bit flip would likely be isolated to the section of video from the bitflip until the next I-frame occurs. As for how bad it could be, it depends on how the encoding works.

              > On the one hand, potentially, "very" robust.

              Only in uncompressed files.

              > But on the other, I would think that there are some very special bits that if toggled can potentially "ruin" the entire file. But I don't know.

              The way that image compression works means that a single bit flip prior to decompression can affect a great many pixels, as shown at Ars Technica.

              > However, I can say, every time I've tried ZFS on my iMac, it was simply a disaster.

              Did you file an issue? I am not sure what the current status of the macOS driver’s production readiness is, but it will be difficult to see it improve if people do not report issues that they have.

              • atoav 4 days ago

                A thing that can destroy most files in terms of readability is a bit flip in the header section. These could be theoretically corrected with clever guesswork and a hex editor, but in practise it is going to be hard to know where the bit flip occured, when a file just can't be read anymore.

                • ryao 3 days ago

                  Good catch. I had omitted that since I was not familiar with the low level details of the file formats (e.g. would a video file duplicate that data throughout it for enabling live streaming), but if the file only has one copy of important information (e.g. I-frame spacing, dimensions) and that gets corrupted, boom.

                • Dwedit 3 days ago

                  If you know that a particular JPEG block is corrupted, it could be possible to isolate the damage to just that block. You know the next block should not have a hard edge against the block above it, so you could try to find something that minimizes the vertical edge strength for the remaining blocks in the row.

                • throw0101b 2 days ago

                  > As a desktop user, I am content with APFS. The only feature from ZFS that I would like, is the corruption detection.

                  I think some power users would appreciate an equivalent to zfs send/recv.

                  • veidr 3 days ago

                    Yeah, of course ZFS on macOS is a disaster, the people trying to make it work are what? Two people? One heroic dude?

                    But I agree with you about the most important feature that Apple failed on.

                    I lament Apple's failure to secure ZFS as much as the next Mac user, but I understood that ship to have sailed when it did, around a decade ago.

                    But as a desktop user, I almost threw up in my mouth when APFS came out with no checksums for user data. I'd assumed if they were going to pass on ZFS they would reimplement the most critical feature. But they didn't. I know I've lost data because of it, and if you have a few TB of data, I suspect you have, too.

                    Not lost permanently, because I had manually-checksummed backups. But lost in the sense that the copies of the data made on macOS were corrupted and different, and the OS/filesystem simply didn't notice. Oops!

                    Once you've used ZFS, that's unforgivable. I mean, ZFS has had some bugs, over the years (well mainly just last year lol), and a small number of users have lost data due to that. But to silently lose data by design? Fuck all the way off. It's 2025, not 1985.

                    So while APFS has some cool modern features (or at least two), it's an embarassment. (And all my non-ephemeral storage is now on Linux.)

                    • TacticalCoder 4 days ago

                      > The only feature from ZFS that I would like, is the corruption detection.

                      I run ZFS on my main server at home (Proxmox: a Linux hypervisor based on Debian and Proxmox ships with ZFS) but...

                      No matter the FS, for "big" files that aren't supposed to change, I append a (partial) cryptographic checksum to the filename. For example:

                      20240238-familyTripBari.mp4 becomes 20240238-familyTripBari-b3-8d77e2419a36.mp4 where "-b3-" indicates the type of cryptographic hash ("b3" for Blake3 in my case for it's very fast) and 8d77e2419a36 is the first x hexdigits of the cryptographic hash.

                      I play the video file (or whatever file it is) after I added the checksum: I know it's good.

                      I do that for movies, pictures, rips of my audio CDs (although these ones are matched with a "perfect rips" online database too), etc. Basically with everything that isn't supposed to change and that I want to keep.

                      I then have a shell script (which I run on several machines) that uses random sampling where I pick the percentage of files that have such a cryptographic checksum in their filenames that I want to check and that verifies that each still has its checksum matching. I don't verify 100% of the files all the time. Typically I'll verify, say, 3% of my files, randomly, daily.

                      Does it help? Well sure yup. For whatever reason one file was corrupt on one of my system: it's not too clear why for the file had the correct size but somehow a bit had flipped. During some sync probably. And my script caught it.

                      The nice thing is I can copy such files on actual backups: DVDs or BluRays or cloud or whatever. The checksum is part of the filename, so I know if my file changed or not no matter the OS / backup medium / cloud or local storage / etc.

                      If you have "bit flip anxiety", it helps ; )

                      • water9 4 days ago

                        The checksum doesn’t help you fix the flipped bit nor does it tell you which bit flipped. You would have to re-create from a complete back up instead of using the efficiency of parity discs. Basically Raid 1 vs Raid 5

                        • Marsymars 3 days ago

                          There are tools that give you hashing + parity, e.g. SnapRAID: https://www.snapraid.it/

                          • CTDOCodebases 4 days ago

                            If OP is backing up locally onto a ZFS server like they said they were then say propagating this data to a cloud provider like Blackblaze which uses ext4 this sort of approach makes sense.

                            This approach is also good when you have multiple sources to restore from. It makes it easier to determine what is the new "source of truth."

                            Theres something to be said too for backing up onto different FS too. You don't want to be stung by a FS bug and if you do then it's good to know about it.

                            • rollcat 4 days ago

                              I wonder how hard would it be to detect which single bit was flipped? As ryao noted, in JPEGs it's immediately obvious where the image was corrupted - by visual inspection. Similar for videos, you only need to inspect the data following a single I-frame. Even for bitmap/text files, you could just scan the entire file, try flipping one bit at a time, and compare the result with the checksum.

                              Unlike e.g. KDFs, checksums are built to be performant, so that verifying one is a relatively fast operation. The Blake family is about 8 cycles per byte[1], I guess a modern CPU could do [napkin math] some 500-1000 MB per second? Perhaps I'm off by an order of magnitude or two, but if the file in question is precious enough, maybe that's worth a shot?

                              [1]: https://en.wikipedia.org/wiki/BLAKE_(hash_function)

                        • jFriedensreich 4 days ago

                          The death of ZFS in macOS was a huge shift in the industry. This has to be seen in the context of microsoft killed their largely ambitious WinFS which felt like the death of desktop innovation in combination.

                          • thyristan 4 days ago

                            Both are imho linked to "offline desktop use cases are not important anymore". Both companies saw their future gains elsewhere, in internet-related functions and what became known as "cloud". No need to have a fancy, featurefull and expensive filesystem when it is only to be used as a cache for remote cloud stuff.

                            • GeekyBear 4 days ago

                              Internet connections of the day didn't yet offer enough speed for cloud storage.

                              Apple was already working to integrate ZFS when Oracle bought Sun.

                              From TFA:

                              > ZFS was featured in the keynotes, it was on the developer disc handed out to attendees, and it was even mentioned on the Mac OS X Server website. Apple had been working on its port since 2006 and now it was functional enough to be put on full display.

                              However, once Oracle bought Sun, the deal was off.

                              Again from TFA:

                              > The Apple-ZFS deal was brought for Larry Ellison's approval, the first-born child of the conquered land brought to be blessed by the new king. "I'll tell you about doing business with my best friend Steve Jobs," he apparently said, "I don't do business with my best friend Steve Jobs."

                              And that was the end.

                              • mixmastamyk 4 days ago

                                Was it not open source at that point?

                              • 8fingerlouie 4 days ago

                                Exactly this.

                                The business case for providing a robust desktop filesystem simply doesn’t exist anymore.

                                20 years ago, (regular) people stored their data on computers and those needed to be dependable. Phones existed, but not to the extent they do today.

                                Fast forward 20 years, and many people don’t even own a computer (in the traditional sense, many have consoles). People now have their entire life on their phones, backed up and/or stored in the cloud.

                                SSDs also became “large enough” that HDDs are mostly a thing of the past in consumer computers.

                                Instead you today have high reliability hardware and software in the cloud, which arguably is much more resilient than anything you could reasonably cook up at home. Besides the hardware (power, internet, fire suppression, physical security, etc), you’re also typically looking at multi geographical redundancy across multiple data centers using reed-Solomon erasure coding, but that’s nothing the ordinary user needs to know about.

                                Most cloud services also offer some kind of snapshot functionality as malware protection (ie OneDrive offers unlimited snapshots for 30 days rolling).

                                Truth is that most people are way better off just storing their data in the cloud and making a backup at home, though many people seem to ignore the latter, and Apple makes it exceptionally hard to automate.

                                • ryao 4 days ago

                                  What do you do when you discover that some thing you have not touched in a long time, but suddenly need, is corrupted and all of your backups are corrupt because the corruption happened prior to your 30 day window at OneDrive?

                                  You would have early warning with ZFS. You have data loss with your plan.

                                  • timc3 4 days ago

                                    You do realise that in your use cases you still need reliable filesystems both in the cloud and on devices.

                                    Because any corruption at any point will get synced as a change, or worse can cause failure.

                                    • sho_hn 4 days ago

                                      Workstation use cases exist. Data archival is not the only application of file systems.

                                    • wenc 4 days ago

                                      I remember eagerly anticipating ZFS for desktop hard disks. I seem to remember it never took off because memory requirements were too high and payoffs were insufficient to justify the trade off.

                                      • em500 4 days ago

                                        Linux or FreeBSD developers are free to adopt ZFS as their primary file systems. But it appears that practical benefits are not really evident to most users.

                                        • thyristan 4 days ago

                                          Lots of ZFS users are enthusiasts who heard about that one magic thing that does it all in one tidy box. Whereas usually you would have to known all the minutiae of LVM/mdadm/cryptsetup/nbd and mkfs.whatever to get to the same point. So while ZFS is the nicer-dicer of volume management and filesystems, the latter is your whole chef's knife set. And while you can dice with both, the user groups are not the same. And enthusiasts with the right usecases are very few.

                                          And for the thin-provisioned snapshotted subvolume usecase, btrfs is currently eating ZFS's lunch due to far better Linux integration. Think snapshots at every update, and having a/b boot to get back to a known-working config after an update. So widespread adoption through the distro route is out of the question.

                                          • m4rtink 4 days ago

                                            The ZFS license makes it impossible to include in upstream Linux kernel, which makes it much less usable as primary filesystem.

                                            • wkat4242 4 days ago

                                              That's called marketing. Give it a snazzy name, like say "TimeMachine" and users will jump on it.

                                              Also, ZFS has a bad name within the Linux community due to some licensing stuff. I find that most BSD users don't really care about such legalese and most people I know that run FreeBSD are running ZFS on root. Which works amazingly well I might add.

                                              Especially with something like sanoid added to it, it basically does the same as timemachine on mac, a feature that users love. Albeit stored on the same drive (but with syncoid or just manually rolled zfs send/recv scripts you can do that on another location too).

                                              • toast0 4 days ago

                                                ZFS on FreeBSD is quite nice. System tools like freebsd-update integrate well. UFS continues to work as well, and may be more appropriate for some use cases where ZFS isn't a good fit, copy on write is sometimes very expensive.

                                                Afaik, the FreeBSD position is both ZFS and UFS are fully supported and neither is secondary to the other; the installer asks what you want from ZFS, UFS, Manual (with a menu based tool), or Shell and you do whatever; in that order, so maybe a slight preferance towards ZFS.

                                                • lotharcable 4 days ago

                                                  OpenZFS exists and there is a port of it for Mac OS X.

                                                  The problem is that it is still owned by Oracle. And Solaris ZFS is incompatible with OpenZFS. Not that people really use Solaris anymore.

                                                  It is really unfortunate. Linux has adopted file systems from other operating systems before. It is just nobody trust Oracle.

                                                  • Gud 4 days ago

                                                    ZFS is a first class citizen in FreeBSD and has been for at least a decade(probably longer). Not at all like in most Linux distros.

                                                • deburo 4 days ago

                                                  APFS? That still happened.

                                                • danudey 3 days ago

                                                  Not to pointlessly nitpick, but:

                                                  > HFS improved upon the Macintosh File System by adding—wait for it—hierarchy! No longer would files accumulate in a single pile; you could organize them in folders.

                                                  MFS did allow you to organize your files into folders, but on-disk they were represented as a single list of files with unique filenames - meaning you could have 'resume.txt' in a folder called 'Jan's Docs' but you couldn't also have 'resume.txt' in a folder called 'Jake's Docs' - every file on the disk needed to have a unique filename.

                                                  Not so much an issue in the days of 400KB floppy drives, but once people started getting 20 MB hard drives that was going to be an unacceptable limitation.

                                                  The other major benefit of HFS was that it stored file data in a B-tree, which allowed directory information to be stored effectively hierarchically, meaning you could find a directory's contents very quickly. With MFS, every file being stored in a single list meant that any time you wanted to get a directory's contents you had to read through that list of every file on the disk to see which ones were stored in that directory, so every listing of any directory was O(n) for the total number of files on the disk.

                                                  • jitl 5 days ago

                                                    Besides the licensing issue, I wonder if optimizing ZFS for low latency + low RAM + low power on iPhone was an uphill battle or if it’s easy. My experiencing running ZFS years ago was poor latency and large RAM use with my NAS, but that hardware and drive configuration was optimized for low $ per gb stored and used parity stuff.

                                                    • hs86 4 days ago

                                                      While its deduplication feature clearly demands more memory, my understanding is that the ZFS ARC is treated by the kernel as a driver with a massive, persistent memory allocation that cannot be swapped out ("wired" pages). Unlike the regular file system cache, ARC's eviction is not directly managed by the kernel. Instead, ZFS itself is responsible for deciding when and how to shrink the ARC.

                                                      This can lead to problems under sudden memory pressure. Because the ARC does not immediately release memory when the system needs it, userland pages might get swapped out instead. This behavior is more noticeable on personal computers, where memory usage patterns are highly dynamic (applications are constantly being started, used, and closed). On servers, where workloads are more static and predictable, the impact is usually less severe.

                                                      I do wonder if this is also the case on Solaris or illumos, where there is no intermediate SPL between ZFS and the kernel. If so, I don't think that a hypothetical native integration of ZFS on macOS (or even Linux) would adopt the ARC in its current form.

                                                      • ryao 4 days ago

                                                        The ZFS driver will release memory if the kernel requests it. The only integration level issue is that the free command does not show ARC as a buffer/cache, so it misrepresents reality, but as far as I know, this is an issue with caches used by various filesystems (e.g. extent caches). It is only obvious in the case of ZFS because the ARC can be so large. That is a feature, not a bug, since unused memory is wasted memory.

                                                        • pseudalopex 4 days ago

                                                          > The ZFS driver will release memory if the kernel requests it.

                                                          Not fast enough always.

                                                        • dizhn 4 days ago

                                                          Maz arc size is configurable and it does not need the mythical 1GB per TB to function well.

                                                          • netbsdusers 4 days ago

                                                            Solaris achieved some kind of integration between the ARC and the VM subsystem as part of the VM2 project. I don't know any more details than that.

                                                            • ryao 4 days ago

                                                              I assume that the VM2 project achieved something similar to the ABD changes that were done in OpenZFS. ABD replaced the use of SLAB buffers for ARC with lists of pages. The issue with SLAB buffers is that absurd amounts of work could be done to free memory, and a single long lived SLAB object would prevent any of it from mattering. Long lived slab objects caused excessive reclaim, slowed down the process of freeing enough memory to satisfy system needs and in some cases, prevented enough memory from being freed to satisfy system needs entirely. Switching to linked lists of pages fixed that since the memory being freed from ARC upon request would immediately become free rather than be deferred to when all of the objects in the SLAB had been freed.

                                                          • twoodfin 4 days ago

                                                            This seems like an early application of the Tim Cook doctrine: Why would Apple want to surrender control of this key bit of technology for their platforms?

                                                            The rollout of APFS a decade later validated this concern. There’s just no way that flawless transition happens so rapidly without a filesystem fit to order for Apple’s needs from Day 0.

                                                            • TheNewsIsHere 4 days ago

                                                              (Edit: My comment is simply about the logistics and work involved in a very well executed filesystem migration. Not about whether ZFS is good for embedded or memory constrained devices.)

                                                              What you describe hits my ear as more NIH syndrome than technical reality.

                                                              Apple’s transition to APFS was managed like you’d manage any kind of mass scale filesystem migration. I can’t imagine they’d have done anything differently if they’d have adopted ZFS.

                                                              Which isn’t to say they wouldn’t have modified ZFS.

                                                              But with proper driver support and testing it wouldn’t have made much difference whether they wrote their own file system or adopted an existing one. They have done a fantastic job of compartmentalizing and rationalizing their OS and user data partitions and structures. It’s not like every iPhone model has a production run that has different filesystem needs that they’d have to sort out.

                                                              There was an interesting talk given at WWDC a few years ago on this. The roll out of APFS came after they’d already tested the filesystem conversion for randomized groups of devices and then eventually every single device that upgraded to one of the point releases prior to iOS 10.3. The way they did this was to basically run the conversion in memory as a logic test against real data. At the end they’d have the super block for the new APFS volume, and on a successful exit they simply discarded it instead of writing it to persistent storage. If it errored it would send a trace back to Apple.

                                                              Huge amounts of testing and consistency in OS and user data partitioning and directory structures is a huge part of why that migration worked so flawlessly.

                                                              • kmeisthax 4 days ago

                                                                To be clear, BTRFS also supports in-place upgrade. It's not a uniquely Apple feature; any copy-on-write filesystem with flexibility as to where data is located can be made to fit inside of the free blocks of another filesystem. Once you can do that, then you can do test runs[0] of the filesystem upgrade before committing to wiping the superblock.

                                                                I don't know for certain if they could have done it with ZFS; but I can imagine it would at least been doable with some Apple extensions that would only have to exist during test / upgrade time.

                                                                [0] Part of why the APFS upgrade was so flawless was that Apple had done a test upgrade in a prior iOS update. They'd run the updater, log any errors, and then revert the upgrade and ship the error log back to Apple for analysis.

                                                                • jeroenhd 4 days ago

                                                                  I don't see why ZFS wouldn't have gone over equally flawlessly. None of the features that make ZFS special were in HFS(+), so conversion wouldn't be too hard. The only challenge would be maintaining the legacy compression algorithms, but ZFS is configurable enough that Apple could've added their custom compression to it quite easily.

                                                                  There are probably good reasons for Apple to reinvent ZFS as APFS a decade later, but none of them technical.

                                                                  I also wouldn't call the rollout of APFS flawless, per se. It's still a terrible fit for (external) hard drives and their own products don't auto convert to APFS in some cases. There was also plenty of breakage when case-sensitivity flipped on people and software, but as far as I can tell Apple just never bothered to address that.

                                                                  • jonhohle 4 days ago

                                                                    HFS compression, AFAICT, is all done in user space with metadata and extended attributes.

                                                                  • toast0 4 days ago

                                                                    Using ZFS isn't surrendering control. Same as using parts of FreeBSD. Apple retains control because they don't have an obligation (or track record) of following the upstream.

                                                                    For zfs, there's been a lot of improvements over the years, but if they had done the fork and adapt and then leave it alone, their fork would continue to work without outside control. They could pull in things from outside if they want, when they want; some parts easier than others.

                                                                  • zoky 4 days ago

                                                                    If it were an issue it would hardly be an insurmountable one. I just can't imagine a scenario where Apple engineers go “Yep, we've eked out all of the performance we possibly can from this phone, the only thing left to do is change out the filesystem.”

                                                                    • klodolph 4 days ago

                                                                      Does it matter if it’s insurmountable? At some point, the benefits of a new FS outweigh the drawbacks. This happens earlier than you might think, because of weird factors like “this lets us retain top filesystem experts on staff”.

                                                                      • karlgkk 4 days ago

                                                                        It’s worth remembering that the filesystem they were looking to replace was HFS+. It was introduced in the 90s as a modernization of HFS, itself introduced in the 80s.

                                                                        Now, old does not necessarily mean bad, but in this case….

                                                                    • alwillis 4 days ago

                                                                      Apple wanted one operating system that ran on everything from a Mac Pro to an Apple Watch and there’s no way ZFS could have done that.

                                                                      • ryao 4 days ago

                                                                        ZFS would be quite comfortable with the 512MB of RAM on an Apple Watch:

                                                                        https://iosref.com/ram-processor

                                                                        People have run operating systems using ZFS on less.

                                                                        • DannyBee 3 days ago

                                                                          ZFS is even used on my PLC to provide consistent snapshots. So uh, going to go with "it would probably work fine".

                                                                        • fweimer 4 days ago

                                                                          If I recall correctly, ZFS error recovery was still “restore from backup” at the time, and iCloud acceptance was more limited. (ZFS basically gave up if an error was encountered after the checksum showed that the data was read correctly from storage media.) That's fine for deployments where the individual system does not matter (or you have dedicated staff to recover systems if necessary), but phones aren't like that. At least not from the user perspective.

                                                                          • ryao 4 days ago

                                                                            ZFS has ditto blocks that allows it to self heal in the case of corrupt metadata as long as a good copy remains (and there would be at least 2 copies by default). ZFS only ever needs you to restore from backup if the damage is so severe that there is no making sense of things.

                                                                            Minor things like the indirect blocks being missing for a regular file only affect that file. Major things like all 3 copies of the MOS (the equivalent to a superblock) being gone for all uberblock entries would require recovery from backup.

                                                                            If all copies of any other filesystem’s superblock were gone too, that filesystem would be equally irrecoverable and would require restoring from backup.

                                                                            • fweimer 4 days ago

                                                                              As far as I understand it, ditto blocks were only used if the corruption was detected due to checksum mismatch. If the checksum was correct, but metadata turned out to be unusable later (say because it was corrupted in memory, and the the checksum was computed after the corruption happened), that was treated as a fatal error.

                                                                          • undefined 4 days ago
                                                                            [deleted]
                                                                          • krupan 4 days ago

                                                                            "Still another version I’ve heard calls into question the veracity of their purported friendship, and has Steve instead suggesting that Larry go f*ck himself. Normally the iconoclast, that would, if true, represent Steve’s most mainstream opinion."

                                                                            LOL!!

                                                                            I really hope they weren't friends, that really shatters my internal narrative (mainly because I can't actually picture either of them having actual friends).

                                                                            • ahl 3 days ago

                                                                              Embarrassed to say I had forgotten writing that and LOLed myself… no more reliable audience for your sense of humor than yourself!

                                                                              • crossroadsguy 4 days ago

                                                                                [flagged]

                                                                                • nar001 3 days ago

                                                                                  That's exactly why so many of these can't be friends with each other though, they clash, they always have to be the most important person in the room

                                                                              • throw0101b 4 days ago

                                                                                Apple and Sun couldn't agree on a 'support contract'. From Jeff Bonwick, one of the co-creators ZFS:

                                                                                >> Apple can currently just take the ZFS CDDL code and incorporate it (like they did with DTrace), but it may be that they wanted a "private license" from Sun (with appropriate technical support and indemnification), and the two entities couldn't come to mutually agreeable terms.

                                                                                > I cannot disclose details, but that is the essence of it.

                                                                                * https://archive.is/http://mail.opensolaris.org/pipermail/zfs...

                                                                                Apple took DTrace, licensed via CDDL—just like ZFS—and put it into the kernel without issue. Of course a file system is much more central to an operating system, so they wanted much more of a CYA for that.

                                                                                • cryptonector 4 days ago

                                                                                  > indemnification

                                                                                  That was the sticking point. In the context of the NetApp lawsuit Apple wanted indemnification should Sun/Oracle lose the suit.

                                                                                  • DannyBee 3 days ago

                                                                                    That would be surprising - indemnification is usually very cheap to provide even for this sort of thing - there is always an insurer willing to sell you the policy you need to provide it at some reasonable price :)

                                                                                    • cryptonector 2 days ago

                                                                                      There may have been more to it than that. IIRC the exact details of why Apple abandoned ZFS were never made public. Indemnification was the clearest and most likely issue, though it might also have been that leaks from the Sun side didn't help.

                                                                                • rrdharan 4 days ago

                                                                                  Kind of odd that the blog states that "The architect for ZFS at Apple had left" and links to the LinkedIn profile of someone who doesn't have any Apple work experience listed on their resume. I assume the author linked to the wrong profile?

                                                                                  • nikhizzle 4 days ago

                                                                                    Ex-Apple File System engineer here who shared an office with the other ZFS lead at the time. Can confirm they link to the wrong profile for Don Brady.

                                                                                    This is the correct person: https://github.com/don-brady

                                                                                    Also can confirm Don is one of the kindest, nicest principal engineer level people I’ve worked with in my career. Always had time to mentor and assist.

                                                                                    • ahl 4 days ago

                                                                                      Not sure how I fat-fingered Don's LinkedIn, but I'm updating that 9-year-old typo. Agreed that Don is a delight. In the years after this article I got to collaborate more with him, but left Delphix before he joined to work on ZFS.

                                                                                      • whitepoplar 4 days ago

                                                                                        Given your expertise, any chance you can comment on the risk of data corruption on APFS given that it only checksums metadata?

                                                                                        • nikhizzle 4 days ago

                                                                                          I moved out of the kernel in 2008 and never went back, so don’t have a wise opinion here which would be current.

                                                                                    • volemo 4 days ago

                                                                                      It was just yesterday I relistened to the contemporary Hypercritical episode on the topic: https://hypercritical.fireside.fm/56

                                                                                      • mrkstu 4 days ago

                                                                                        Wow, John's voice has changed a LOT from back then

                                                                                      • dang 4 days ago

                                                                                        Discussed at the time:

                                                                                        ZFS: Apple’s New Filesystem That Wasn’t - https://news.ycombinator.com/item?id=11909606 - June 2016 (128 comments)

                                                                                        • smittywerben 4 days ago

                                                                                          Thanks for sharing I was just looking for what happened to Sun. I like the second-hand quote comparing the IBM and HP as "garbage trucks colliding" plus the inclusion of blog posts with links to the court filings.

                                                                                          Is it fair to say ZFS made most sense on Solaris using Solaris Containers on SPARK?

                                                                                          • ahl 4 days ago

                                                                                            ZFS was developed in Solaris, and at the time we were mostly selling SPARC systems. That changed rapidly and the biggest commercial push was in the form of the ZFS Storage Appliance that our team (known as Fishworks) built at Sun. Those systems were based on AMD servers that Sun was making at the time such as Thumper [1]. Also in 2016, Ubuntu leaned in to use of ZFS for containers [2]. There was nothing that specific about Solaris that made sense for ZFS, and even less of a connection to the SPARC architecture.

                                                                                            [1]: https://www.theregister.com/2005/11/16/sun_thumper/

                                                                                            [2]: https://ubuntu.com/blog/zfs-is-the-fs-for-containers-in-ubun...

                                                                                            • ryao 4 days ago

                                                                                              > There was nothing that specific about Solaris that made sense for ZFS, and even less of a connection to the SPARC architecture.

                                                                                              Although it does not change the answer to the original question, I have long been under the impression that part of the design of ZFS had been influenced by the Niagara processor. The heavily threaded ZIO pipeline had been so forward thinking that it is difficult to imagine anyone devising it unless they were thinking of the future that the Niagara processor represented.

                                                                                              Am I correct to think that or did knowledge of the upcoming Niagara processor not shape design decisions at all?

                                                                                              By the way, why did Thumper use an AMD Opteron over the UltraSPARC T1 (Niagara)? That decision seems contrary to idea of putting all of the wood behind one arrow.

                                                                                              • bcantrill 4 days ago

                                                                                                Niagara did not shape design decisions at all -- remember that Niagara was really only doing on a single socket what we had already done on large SMP machines (e.g., Starfire/Starcat). What did shape design decisions -- or at least informed thinking -- was a belief that all main memory would be non-volatile within the lifespan of ZFS. (Still possible, of course!) I don't know that there are any true artifacts of that within ZFS, but I would say that it affected thinking much more than Niagara.

                                                                                                As for Thumper using Opteron over Niagara: that was due to many reasons, both technological (Niagara was interesting but not world-beating) and organizational (Thumper was a result of the acquisition of Kealia, which was independently developing on AMD).

                                                                                                • ahl 4 days ago

                                                                                                  I don’t recall that being the case. Bonwick had been thinking about ZFS for at least a couple of years. Matt Ahrens joined Sun (with me) in 2001. The Afara acquisition didn’t close until 2002. Niagara certainly was tantalizing but it wasn’t a primary design consideration. As I recall, AMD was head and shoulders above everything else in terms of IO capacity. Sun was never very good (during my tenure there) at coordination or holistic strategy.

                                                                                                • ghaff 4 days ago

                                                                                                  Yeah I think if it hadn’t been for the combination of Oracle and CDDL, Red Hat would have been more interested in for Linux. As it was they basically went with XFS and volume management. Fedora did eventually go with btrfs but dints know if there are are any plans for copy-on-write FS for RHEL at any point.

                                                                                                  • m4rtink 4 days ago

                                                                                                    Fedora Server uses XFS on LVM by default & you can do CoW with any modern filesystem on top of an LVM thin pool.

                                                                                                    And there is also the Stratis project Red Hat is involved in: https://stratis-storage.github.io/

                                                                                                    • ryao 4 days ago

                                                                                                      RedHat’s policy is no out of tree kernel modules, so it would not have made a difference.

                                                                                                    • thyristan 4 days ago

                                                                                                      We had those things at work as fileservers, so no containers or anything fancy.

                                                                                                      Sun salespeople tried to sell us the idea of "zfs filesystems are very cheap, you can create many of them, you don't need quota" (which ZFS didn't have at the time), which we tried out. It was abysmally slow. It was even slow with just one filesystem on it. We scrapped the whole idea, just put Linux on them and suddenly fileserver performance doubled. Which is something we weren't used to with older Solaris/Sparc/UFS or /VXFS systems.

                                                                                                      We never tried another generation of those, and soon after Sun was bought by Oracle anyways.

                                                                                                      • kjellsbells 4 days ago

                                                                                                        I had a combination uh-oh/wow! moment back in those days when the hacked up NFS server I built on a Dell with Linux and XFS absolutely torched the Solaris and UFS system we'd been using for development. Yeah, it wasnt apples to apples. Yes, maybe ZFS would have helped. But XFS was proven at SGI and it was obvious that the business would save thousands overnight by moving to Linux on Dell instead of sticking with Sun E450s. That was the death knell for my time as a Solaris sysadmin, to be honest.

                                                                                                      • smittywerben 4 days ago

                                                                                                        Thanks. Also, the Thumper looks awesome like a max-level MMORPG character that would kill the level-1 consumer Synology NAS character in one hit.

                                                                                                      • cryptonector 4 days ago

                                                                                                        > Is it fair to say ZFS made most sense on Solaris using Solaris Containers on SPARK?

                                                                                                        You mean SPARC. And no, ZFS stands alone. But yes, containers were a lot faster to create using ZFS.

                                                                                                        • smittywerben 4 days ago

                                                                                                          Thanks I didn't notice until now. I miskeyed SPARC on my iPhone keyboard.

                                                                                                      • secabeen 4 days ago

                                                                                                        ZFS remains an excellent filesystem for bulk storage on rust, but were I Apple at the time, I would probably want to focus on something built for the coming era of flash and NVMe storage. There are a number of axioms built into ZFS that come out of the spinning disk era that still hold it back for flash-only filesystems.

                                                                                                        • ahl 4 days ago

                                                                                                          Certainly one would build something different starting in 2025 rather than 2001, but do you have specific examples of how ZFS’s design holds it back? I think it has been adapted extremely well for the changing ecosystem.

                                                                                                          • porjo 4 days ago

                                                                                                            This presentation from 2022 covers the topic: https://m.youtube.com/watch?v=v8sl8gj9UnA

                                                                                                            Note: sound drops out for a couple minutes at 1:30 mark but comes back.

                                                                                                            • ahl 2 days ago

                                                                                                              I didn't watch it in its entirety, but I'm familiar with Allan's work. There doesn't seem to be anything fundamental to the design of ZFS that his talk highlights as limiting, but there are many areas that have benefitted from optimization and tuning.

                                                                                                        • jeroenhd 4 days ago

                                                                                                          I wonder what ZFS in the iPhone would've looked like. As far as I recall, the iPhone didn't have error correcting memory, and ZFS is notorious for corrupting itself when bit flips hit it and break the checksum on disk. ZFS' RAM-hungry nature would've also forced Apple to add more memory to their phone.

                                                                                                          • Modified3019 4 days ago

                                                                                                            ZFS detects corruption.

                                                                                                            A very long ago someone named cyberjock was a prolific and opinionated proponent of ZFS, who wrote many things about ZFS during a time when the hobbyist community was tiny and not very familiar with how to use it and how it worked. Unfortunately, some of their most misguided and/or outdated thoughts still haunt modern consciousness like an egregore.

                                                                                                            What you are probably thinking of is the proposed doomsday scenario where bad ram could theoretically kill a ZFS pool during a scrub.

                                                                                                            This article does a good job of explaining how that might happen, and why being concerned about it is tilting at windmills: https://jrs-s.net/2015/02/03/will-zfs-and-non-ecc-ram-kill-y...

                                                                                                            I have never once heard of this happening in real life.

                                                                                                            Hell, I’ve never even had bad ram. I have had bad sata/sas cables, and a bad disk though. ZFS faithfully informed me there was a problem, which no other file system would have done. I’ve seen other people that start getting corruption when sata/sas controllers go bad or overheat, which again is detected by ZFS.

                                                                                                            What actually destroys pools is user error, followed very distantly by plain old fashioned ZFS bugs that someone with an unlucky edge case ran into.

                                                                                                            • tmoertel 4 days ago

                                                                                                              > Hell, I’ve never even had bad ram.

                                                                                                              To what degree can you separate this claim from "I've never noticed RAM failures"?

                                                                                                              • wtallis 4 days ago

                                                                                                                To me, the most implausible thing about ZFS-without-ECC doomsaying is the presumption that the failure mode of RAM is a persistently stuck bit. That's way less common than transient errors, and way more likely to be noticed, since it will destabilize any piece of software that uses that address range. And now that all modern high-density DRAM includes on-die ECC, transient data corruption on the link between DRAM and CPU seems overwhelmingly more likely than a stuck bit.

                                                                                                              • amarshall 4 days ago

                                                                                                                > ZFS is notorious for corrupting itself when bit flips hit it and break the checksum on disk

                                                                                                                ZFS does not need or benefit from ECC memory any more than any other FS. The bitflip corrupted the data, regardless of ZFS. Any other FS is just oblivious, ZFS will at least tell you your data is corrupt but happily keep operating.

                                                                                                                > ZFS' RAM-hungry nature

                                                                                                                ZFS is not really RAM-hungry, unless one uses deduplication (which is not enabled by default, nor generally recommended). It can often seem RAM hungry on Linux because the ARC is not counted as “cache” like the page cache is.

                                                                                                                ---

                                                                                                                ZFS docs say as much as well: https://openzfs.github.io/openzfs-docs/Project%20and%20Commu...

                                                                                                              • ahl 4 days ago

                                                                                                                It's very amusing that this kind of legend has persisted! ZFS is notorious for *noticing* when bits flip, something APFS designers claimed was rare given the robustness of Apple hardware.[1][2] What would ZFS on iPhone have looked like? Hard to know, and that certainly wasn't the design center.

                                                                                                                Neither here nor there, but DTrace was ported to iPhone--it was shown to me in hushed tones in the back of an auditorium once...

                                                                                                                [1]: https://arstechnica.com/gadgets/2016/06/a-zfs-developers-ana...

                                                                                                                [2]: https://ahl.dtrace.org/2016/06/19/apfs-part5/#checksums

                                                                                                                • ryao 4 days ago

                                                                                                                  I did early ZFSOnLinux development on hardware that did not have ECC memory. I once had a situation where a bit flip happened in the ARC buffer for libpython.so and all python software started crashing. Initially, I thought I had hit some sort of blizzard bug in ZFS, so I started debugging. At that time, opening a ZFS snapshot would fetch a duplicate from disk into a redundant ARC buffer, so while debugging, I ran cmp on libpython.so between the live copy and a snapshot copy. It showed the exact bit that had flipped. After seeing that and convincing myself the bitflip was not actually on stable storage, I did a reboot, and all was well. Soon afterward, I got a new development machine that had ECC so that I would not waste my time chasing phantom bugs caused by bit flips.

                                                                                                                • terlisimo 4 days ago

                                                                                                                  > ZFS is notorious for corrupting itself when bit flips

                                                                                                                  That is a notorious myth.

                                                                                                                  https://jrs-s.net/2015/02/03/will-zfs-and-non-ecc-ram-kill-y...

                                                                                                                  • Dylan16807 4 days ago

                                                                                                                    > ZFS is notorious for corrupting itself when bit flips hit it and break the checksum on disk

                                                                                                                    I don't think it is. I've never heard of that happening, or seen any evidence ZFS is more likely to break than any random filesystem. I've only seen people spreading paranoid rumors based on a couple pages saying ECC memory is important to fully get the benefits of ZFS.

                                                                                                                    • thfuran 4 days ago

                                                                                                                      They also insist that you need about 10 TB RAM per TB disk space or something like that.

                                                                                                                    • E39M5S62 4 days ago

                                                                                                                      Not this myth again. ZFS does not need ECC RAM. Stop propagating this falsehood.

                                                                                                                      • cryptonector 4 days ago

                                                                                                                        > ZFS is notorious for corrupting itself when bit flips hit it and break the checksum on disk.

                                                                                                                        If you have no mirrors and no raidz and no ditto blocks then errors cause problems, yes. Early on they would cause panics.

                                                                                                                        But this isn't ZFS "corrupting itself", rather, it's ZFS saving itself and you from corruption, and the price you pay for that is that you need to add redundancy (mirrors, raidz, or ditto blocks). It's not a bad deal. Some prefer not to know.

                                                                                                                        • mrkeen 4 days ago

                                                                                                                          > ZFS is notorious for corrupting itself when bit flips hit it and break the checksum on disk.

                                                                                                                          What's a bit flip?

                                                                                                                          • ahl 4 days ago

                                                                                                                            Sometimes data on disk and in memory are randomly corrupted. For a pretty amazing example, check out "bitsquatting"[1]--it's like domain name squatting, but instead of typos, you squat on domains that would bit looked up in the case of random bit flips. These can occur due e.g. to cosmic rays. On-disk, HDDs and SSDs can produce the wrong data. It's uncommon to see actual invalid data rather than have an IO fail on ECC, but it certainly can happen (e.g. due to firmware bugs).

                                                                                                                            [1]: https://en.wikipedia.org/wiki/Bitsquatting

                                                                                                                            • zie 4 days ago

                                                                                                                              Basically it's that memory changes out from under you. As we know, computers use Binary, so everything boils down to it being a 0 or a 1. A bit flip is changing what was say a 0 into a 1.

                                                                                                                              Usually attributed to "cosmic rays", but really can happen for any number of less exciting sounding reasons.

                                                                                                                              Basically, there is zero double checking in your computer for almost everything except stuff that goes across the network. Memory and disks are not checked for correctness, basically ever on any machine anywhere. Many servers(but certainly not all) are the rare exception when it comes to memory safety. They usually have ECC(Error Correction Code) Memory, basically a checksum on the memory to ensure that if memory is corrupted, it's noticed and fixed.

                                                                                                                              Essentially every filesystem everywhere does zero data integrity checking:

                                                                                                                                MacOS APFS: Nope
                                                                                                                                Windows NTFS: Nope
                                                                                                                                Linux EXT4: Nope
                                                                                                                                BSD's UFS: Nope
                                                                                                                                Your mobile phone: Nope
                                                                                                                              
                                                                                                                              ZFS is the rare exception for file systems that actually double check the data you save to it is the data you get back from it. Every other filesystem is just a big ball of unknown data. You probably get back what you put it, but there is zero promises or guarantees.
                                                                                                                            • undefined 4 days ago
                                                                                                                              [deleted]
                                                                                                                            • ein0p 4 days ago

                                                                                                                              ZFS sort of moved inside the NVMe controller - it also checksums and scrubs things all the time, you just don't see it. This does not, however, support multi-device redundant storage, but that is not a concern for Apple - the vast majority of their devices have only one storage device.

                                                                                                                              • DannyBee 3 days ago

                                                                                                                                Everyone seems to focus on the checksumming and scrubbing.

                                                                                                                                But the real win (at least for me) - every device i have - laptops, desktops, server, even PLC's (they now use freebsd under the covers + ZFS) all backup using zfs snapshots and replication.

                                                                                                                                I do not ever worry about finding an old file i accidentally deleted. Or restoring a backup to a new machine and "did it really include everything" or anything else.

                                                                                                                                The machine storing backups is itself replicated to another machine in my detached garage.

                                                                                                                                If i wanted even more security, i could trivially further replicate it to offsite storage in the same manner.

                                                                                                                                All of this takes ~0 time to set up, and require 0 maintenance to keep working.

                                                                                                                                Meanwhile, Apple has gone backwards - time machine can't even make actual full system backups anymore.

                                                                                                                              • water9 4 days ago

                                                                                                                                ZFS is the king of all file systems. As someone with over a petabyte of storage across 275 drives I have never lost a single byte due to a hard drive failure or corruption thanks to ZFS

                                                                                                                                • ewuhic 4 days ago

                                                                                                                                  What's the current state of ZFS on Macos? As far as I'm aware there's a supported fork.

                                                                                                                                • randomnottaken 4 days ago

                                                                                                                                  [flagged]