On 21/09/2018 05:22, Reindl Harald wrote:
Am 20.09.18 um 21:52 schrieb David F:
I can't imagine that this isn't a frequently asked question, but with my
poor search skills, I've come up completely empty on this.
I'm trying to understand why the newer "sophisticated" filesystems (e.g.
btrfs) are implementing raid redundancy as part of the filesystem rather
than the traditional approach of a separate virtual-block-device layer
such as md, with a filesystem on top of it as a distinct layer. In
addition to replication of effort/code [again and again for each new
filesystem implementation that comes along], it seems to be mixing too
much functionality into one monolithic layer, increasing complexity and
the subsequent inevitable increased number of bugs and difficulty of
debugging.
Of course, the people working on these filesystems aren't idiots, so I
assume that there _are_ reasons
simple: after a drive failure
* rebuild a 4x6 TB mdraid with 10 GB used
* rebuild a 4x6 TB zfs/btrfs with 10 GB used
case 1 takes ages
case 2 is done within seconds
It's a bit more complicated than that.
When raid (or redundancy) is handled at the filesystem level, it is
possible to be smarter about it. There is no need to duplicate unused
disk blocks. You can have different levels for different types of data
(like more duplication for metadata) or even different types of files or
locations in the filesystem. You can have checksumming on the files,
which catches undetected read errors (the experts differ on how
important this is).
On the other hand, block device raid is simpler, more mature, and can be
very flexible.
There are pros and cons of each system (just as there are pros and cons
of different raid levels, md and lvm raid, and hardware and software raid).
(A certain amount of functionality and code is actually shared between
different raid systems - the basic raid5 or raid6 calculations are the
same.)
(if only BTRFS would get somehow reliable or ZFS have a proper license)
BTRFS has been absolutely fine and stable for me. I use it on almost
all my systems these days, with raid1. But I have made a point of using
quite new kernels with them, and I am not sure the raid5/raid6 handling
is good enough yet.