On 2017-07-25 08:55, Hérikz Nawarro wrote:
Hello everyone,
I'm migrating to btrfs and i would like to know, in a btrfs filesystem
with 4 disks (multiple sizes) with -d raid0 & -m raid1, how many
drives can i lost without losing the entire array?
Exactly one, but you will lose data if you lose one device. Most of the
BTRFS profiles are poorly named (single and dup being the exceptions),
and do not behave consistently with the RAID levels they are named
after. BTRFS raid1 mode is functionally equivalent to MD or LVM RAID10
mode, just with larger blocks. It only gives you two copies of the
data, so losing one device will make the array degraded, and two will
effectively nuke it.
If you care about data safety, I would advise against using raid0 for
data. If you lose _one_ device in raid0 mode, you will usually lose
part of most of the files on the volume. Single mode for data will
still distribute things evenly and will not have that issue (unless you
have files larger than 1GB, a file will either be all there or all gone,
as opposed to having read errors part way through), and isn't much worse
in terms of performance (BTRFS does not parallelize device access as
well as it should).
If you care about both performance and data safety, and can tolerate
having only half the usable space, I would actually suggest running
BTRFS with both data and metadata in raid1 mode on top of two LVM or MD
RAID0 volumes. This should outperform the configuration you listed by a
significant amount, will provide better data safety, and should also do
a better job of distributing the load across devices.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html