News for hackers. Stuff that matters.
Re:ZFS 2.3.0 released with ZFS raidz expansion by lousken on Tuesday January 14, 2025 @05:45AM (#42695813)
as far as stability goes, btrfs is used by meta, synology and many others, so I wouldn't say it's not stable, but some features are lacking
Re:ZFS 2.3.0 released with ZFS raidz expansion by azalemeth on Tuesday January 14, 2025 @06:40AM (#42696095)
My understanding is that single-disk btrfs is good, but raid is decidedly dodgy; https://btrfs.readthedocs.io/en/latest/btrfs-man5.html#raid5... states that:

> The RAID56 feature provides striping and parity over several devices, same as the traditional RAID5/6.

> There are some implementation and design deficiencies that make it unreliable for some corner cases and *the feature should not be used in production, only for evaluation or testing*.

> The power failure safety for metadata with RAID56 is not 100%.

I have personally been bitten once (about 10 years ago) by btrfs just failing horribly on a single desktop drive. I've used either mdadm + ext4 (for /) or zfs (for large /data mounts) ever since. Zfs is fantastic and I genuinely don't understand why it's not used more widely.

Re:ZFS 2.3.0 released with ZFS raidz expansion by lousken on Tuesday January 14, 2025 @07:31AM (#42696451)
I was assuming OP wants to highlight filesystem use on a workstation/desktop, not for a file server/NAS. I had similar experience decade ago, but these days single drives just work, same with mirroring. For such setups btrfs should be stable. I've never seen a workstation with raid5/6 setup. Secondly, filesystems and volume managers are something else, even if e.g. btrfs and ZFS are essentialy both.

For a NAS setup I would still prefer ZFS with truenas scale (or proxmox if virtualization is needed), just because all these scenarios are supported as well. And as far as ZFS goes, encryption is still something I am not sure about especially since I want to use snapshots sending those as a backup to remote machine.

Re:ZFS 2.3.0 released with ZFS raidz expansion by hooli_gan on Tuesday January 14, 2025 @07:34AM (#42696474)
RAID5/6 is not needed with btrfs. One should use RAID1, which supports striping the same data onto multiple drives in a redundant way.
Re:ZFS 2.3.0 released with ZFS raidz expansion by johnmaguire on Tuesday January 14, 2025 @02:22PM (#42702395)
How can you achieve 2-disk fault tolerance using btrfs and RAID 1?
Re:ZFS 2.3.0 released with ZFS raidz expansion by Dalewyn on Tuesday January 14, 2025 @02:38PM (#42702631)
By using three drives.

RAID1 is just making literal copies, so each additional drive in a RAID1 is a self-sufficient copy. You want two drives of fault tolerance? Use three drives, so if you lose two copies you still have one left.

This is of course hideously inefficient as you scale larger, but that is not the question posed.

Re:ZFS 2.3.0 released with ZFS raidz expansion by johnmaguire on Tuesday January 14, 2025 @03:07PM (#42703094)
> This is of course hideously inefficient as you scale larger, but that is not the question posed.

It's not just inefficient, you literally can't scale larger. Mirroring is all that RAID 1 allows for. To scale, you'd have to switch to RAID 10, which doesn't allow two-disk fault tolerance (you can get lucky if they are in different stripes, but this isn't fault tolerance.)

But you're right - RAID 1 also scales terribly compared to RAID 6, even before introducing striping. Imagine you have 6 x 16 TB disks:

With RAID 6, usable space of 64 TB, two-drive fault tolerance.

With RAID 1, usable space of 16 TB, five-drive fault tolerance.

With RAID 10, usable space of 32 GB, one-drive fault tolerance.

Re:ZFS 2.3.0 released with ZFS raidz expansion by ryao on Tuesday January 14, 2025 @03:05PM (#42703063)
Btrfs did not support that until Linux 5.5 when it added RAID1c3. On its mirror devices instead of doing mirroring, it just stores 2 copies, no matter how many mirror members you have.
Re:ZFS 2.3.0 released with ZFS raidz expansion by crest on Tuesday January 14, 2025 @08:19AM (#42696800)
One problem with your setup is that ZFS by design can't use a traditional *nix filesystem buffer cache. Instead it has to use its own ARC (adaptive replacement cache) with end-to-end checksumming, transparent compression, and copy-on-write semantics. This can lead to annoying performance problems when the two types of file system caches contest for available memory. There is a back pressure mechanism, but it effectively pauses other writes while evicting dirty cache entries to release memory.
Re:ZFS 2.3.0 released with ZFS raidz expansion by ryao on Tuesday January 14, 2025 @09:06AM (#42697349)
Traditionally, you have the page cache on top of the FS and the buffer cache below the FS, with the two being unified such that double caching is avoided in traditional UNIX filesystems.

ZFS goes out of its way to avoid the buffer cache, although Linux does not give it the option to fully opt out of it since the block layer will buffer reads done by userland to disks underneath ZFS. That is why ZFS began to purge the buffer cache on every flush 11 years ago:

https://github.com/openzfs/zfs/commit/cecb7487fc8eea3508c3b6...

That is how it still works today:

https://github.com/openzfs/zfs/blob/fe44c5ae27993a8ff53f4cef...

If I recall correctly, the page cache is also still above ZFS when mmap() is used. There was talk about fixing it by having mmap() work out of ARC instead, but I don’t believe it was ever done, so there is technically double caching done there.

Re:ZFS 2.3.0 released with ZFS raidz expansion by taskforcegemini on Tuesday January 14, 2025 @01:42PM (#42701813)
what's the best way to deal with this then? disable filecache of linux? I've tried disabling/minimizing arc in the past to avoid the oom reaper, but the arc was stubborn and its RAM usage remained as is
Re:ZFS 2.3.0 released with ZFS raidz expansion by ssl-3 on Tuesday January 14, 2025 @02:43PM (#42702732)
I didn't have any trouble limiting zfs_arc_max to 3GB on one system where I felt that it was important. I ran it that way for a fair number of years and it always stayed close to that bound (if it was ever exceeded, it wasn't by a noteworthy amount at any time when I was looking).

At the time, I had it this way because I had fear of OOM events causing [at least] unexpected weirdness.

A few months ago I discovered weird issues with a fairly big, persistent L2ARC being ignored at boot due to insufficient ARC. So I stopped arbitrarily limiting zfs_arc_max and just let it do its default self-managed thing.

So far, no issues. For me. With my workload.

Are you having issues with this, or is it a theoretical problem?

Re:ZFS 2.3.0 released with ZFS raidz expansion by ryao on Tuesday January 14, 2025 @02:57PM (#42702945)
These days, ZFS frees memory fast enough when Linux requests memory to be freed that you generally do not see OOM because of ZFS, but if you have a workload where it is not fast enough, you can limit the maximum arc size to try to help:

https://openzfs.github.io/openzfs-docs/Performance%20and%20T...

Re:ZFS 2.3.0 released with ZFS raidz expansion by brian_cunnie on Tuesday January 14, 2025 @09:18AM (#42697478)
> I have personally been bitten once (about 10 years ago) by btrfs just failing horribly on a single desktop drive.

Me, too. The drive was unrecoverable. I had to reinstall from scratch.

Re:ZFS 2.3.0 released with ZFS raidz expansion by worthless-trash on Tuesday January 14, 2025 @11:08AM (#42699001)
Licensing incompatibilities.
Re:ZFS 2.3.0 released with ZFS raidz expansion by _joel on Tuesday January 14, 2025 @07:58AM (#42696633)
I'm similar to some other people here, I guess once they've been bitten by data loss due to btrfs, it's difficult to advocate for it.
Re:ZFS 2.3.0 released with ZFS raidz expansion by lousken on Tuesday January 14, 2025 @08:03AM (#42696668)
I am assuming almost everybody at some point experienced data loss because they pulled out a flash drive too early. Is it safe to assume that we stopped using flash drives because of it?
Re:ZFS 2.3.0 released with ZFS raidz expansion by _joel on Tuesday January 14, 2025 @08:10AM (#42696716)
I'm not sure we have stopped using flash, judging by the pile of USB sticks on my desk :) In relation to the fs analogy if you used a flash drive that you know corrupted your data, you'd throw it away for one you know works.
Re:ZFS 2.3.0 released with ZFS raidz expansion by ryao on Tuesday January 14, 2025 @03:07PM (#42703091)
I once purchased a bunch of flash drives from Google’s online swag store and just unplugging them was often enough to put then in a state where they claimed to be 8MB devices and nothing I wrote to them was ever possible to read back in my limited tests. I stopped using those fast.
Re:ZFS 2.3.0 released with ZFS raidz expansion by fourfour3 on Tuesday January 14, 2025 @06:12AM (#42695972)
Do Synology actually use the multi-device options of btrfs, or are they using linux softraid + lvm underneath?

I know Synology Hybrid RAID is a clever use of LVM + MD raid, for example.

Re:ZFS 2.3.0 released with ZFS raidz expansion by phs2501 on Tuesday January 14, 2025 @03:46PM (#42703608)
I believe Synology runs btrfs on top of regular mdraid + lvm, possibly with patches to let btrfs checksum failures reach into the underlying layers to find the right data to recover.

Related blog post: https://daltondur.st/syno_btrfs_1/

Re:ZFS 2.3.0 released with ZFS raidz expansion by fourfour3 on Thursday January 16, 2025 @08:34PM (#42733099)
That was very interesting reading, thanks!
Re:ZFS 2.3.0 released with ZFS raidz expansion by jeltz on Tuesday January 14, 2025 @03:49PM (#42703644)
It is possible to corrupt the file system from user space as a normal user with Btrfs. The PostgreSQL devs found that when working on async IO. And as fer as I know that issue has not been fixed.

https://www.postgresql.org/message-id/CA%2BhUKGL-sZrfwcdme8j...

Re:ZFS 2.3.0 released with ZFS raidz expansion by curt15 on Tuesday January 14, 2025 @05:11PM (#42704635)
LMDB users also unearthed a btrfs data corruption bug last year: https://bugzilla.redhat.com/show_bug.cgi?id=2169947