Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Phillip Susi <phill@thesusis.net>
To: George Shammas <btrfs@shamm.as>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: What exactly is BTRFS Raid 10?
Date: Mon, 22 Aug 2022 15:51:12 -0400	[thread overview]
Message-ID: <87k0706nxq.fsf@vps.thesusis.net> (raw)
In-Reply-To: <a6b0c534-4f05-4f60-a7fa-f33cfce990d7@www.fastmail.com>


"George Shammas" <btrfs@shamm.as> writes:

>> Btrfs raid10 requires an even number of drives with a minimum of 4.
>
> Is this true? I just experimented with 3 drives and `btrfs device
> usage` ends up showing 'RAID10/2' But the data is equally spread
> across all three drives. Even though the stripe is 2, the data is
> still being placed evenly across three drives. See [1] for an actual
> example I just created.

mkfs.btrfs won't let me create a raid10 with only 3 drives: it says you
need at least 4.  You can do that with mdraid but btrfs doesn't seem to
let you and I thought it was because of:

>> It's pretty much raid 1+0.

> Again, is it? raid 1+0 would imply that two drives are mirrored, and
> hence identical, and the blocks are striped over mirrored sets. This
> would also force devices being in multiple of two, which is not the
> case.

Don't forget that it is done at the chunk level rather than the drive
level.  I just tried 5 drives though and that does seem to work,
however, btrfs filesystem usage shows that the chunk is only allocated
on disks 2,3,4,5 and disk 1 is unused.  Over time you are going to end
up with the average usage about the same but no single chunk is striped
across all 5 drives.

> If I am right, and I don't know that I am, that would make raid1 and
> raid10 have the very similar data loss scenarios that are not
> completely obvious.

Yes, in general raid1 and raid10 have similar redundancy: they can only
handle the loss of a single drive.  Any more than that and you are
relying on peculiarities of the layout and which particular drives
failed, and that's never a good idea.

> And the question remains if that is the case, is there ever a reason to choose raid1 over raid, and vice versa. 

The reason to choose raid10 over raid1 is for the better sequential
performance you can get from the striping.  I ran an mdraid raid10 on 3
disks for years for the good throughput and redundancy qualities.


  parent reply	other threads:[~2022-08-22 20:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19 16:49 What exactly is BTRFS Raid 10? George Shammas
2022-08-19 18:10 ` Phillip Susi
2022-08-19 22:01   ` George Shammas
2022-08-19 22:18     ` Chris Murphy
2022-08-19 22:37       ` George Shammas
2022-08-19 22:29     ` waxhead
2022-08-22 19:51     ` Phillip Susi [this message]
2022-08-20 11:28 ` Goffredo Baroncelli
2022-08-20 18:11   ` Andrei Borzenkov
2022-08-21  0:23     ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0706nxq.fsf@vps.thesusis.net \
    --to=phill@thesusis.net \
    --cc=btrfs@shamm.as \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox