Results 1 to 5 of 5

Thread: btrfs RAID1 - do 3 drives allow for 2 drives to fail before dataloss?

  1. #1

    Default btrfs RAID1 - do 3 drives allow for 2 drives to fail before dataloss?

    this is not really SUSE related but I hope to tap into the wisdom on btrfs here. ...

    I wonder whether spanning a btrfs RAID1 over 3 drives would allow for 2 drives to fail, before data loss or rather make more space available
    Or in other words: would a btrfs RAID1 on 3 HD's provide

    A) more datasafety


    • 2 x 2TB drives RAID1 = 2TB space (1 hd can fail before data loss)
    • 3 x 2TB drives RAID1 = 2TB space (2 hds can fail before data loss)


    or

    B) more space


    • 2 x 2TB drives RAID1 = 2TB space (1 hd can fail before data loss)
    • 3 x 2TB drives RAID1 = 3TB space (1 hd can fail before data loss)



    P.S. I don't care much about hotswap capabilities if that matters. Can stop the server for exchanging a failed drive if necessary




  2. #2
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    16,287

    Default Re: btrfs RAID1 - do 3 drives allow for 2 drives to fail before dataloss?

    RAID 1 supports two drives period. Which is drive A mirrored to drive B . There are other RAID levels that support different schemes

    https://en.wikipedia.org/wiki/RAID

  3. #3
    Join Date
    Sep 2012
    Posts
    7,098

    Default Re: btrfs RAID1 - do 3 drives allow for 2 drives to fail before dataloss?

    Quote Originally Posted by vrms View Post
    I wonder whether spanning a btrfs RAID1 over 3 drives would allow for 2 drives to fail, before data loss
    No. btrfs RAID1 means 2 copies of data on different devices. Losing two devices may result in data loss depending on how exactly data is distributed over devices. In practice you will most likely lose some data; if you are unlucky, it will be metadata and catastrophic loss of almost everything.

    Quote Originally Posted by gogalthorp View Post
    RAID 1 supports two drives period.
    This is so wrong that I do not even know where to start ...

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: btrfs RAID1 - do 3 drives allow for 2 drives to fail before dataloss?

    There might be some confusion if we don't understand the difference between "drive" and "disk"
    A disk is the physical storage device
    A drive is the logical storage object that can span more than one disk.

    RAID1 is mirroring the data across two member drives, so at least one of the members can be more than one disk.

    https://en.wikipedia.org/wiki/Standard_RAID_levels

    Understanding the above,
    the features and limitations of RAID1 can also be understood since only when the integrity of an entire member drive exists, is the data considered usable.

    Most often,
    If you have 3 drives, RAID5 is the preferred option so that with the loss of <any> drive, the data integrity is still considered usable, and when the faulty drive is replaced the array can be regenerated without a problem.

    And,
    Probably most arrays are configured so that a drive=disk to simplify and isolate disk problems if they arise, else spanning potentially introduces problems similar to RAID0 where a problem on one disk might cause an entire member drive spanning multiple disks to fail.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Post Re: btrfs RAID1 - do 3 drives allow for 2 drives to fail before dataloss?

    Answering the @OP question exactly,

    To create a RAID1 across 3 disks, you will still be creating 2 member drives, for example

    Drive 1..................Drive 2
    Disk1-Disk2............Disk3

    For RAID1 to work,
    Let's say 2GB of data is spread across disk1 and disk2, and mirrored to disk3.
    If your data corruption occurs in disk1 <or> disk2, then Drive 1 is dead, but you could still have usable data on disk3.
    Note that corruption on disk1 <or> disk2 invalidates the entirety of what you have on those two disks.

    If your data corruption is on disk3 instead,
    Then the data on disk3 is unusable but the uncorrupted data on disk1 plus disk2 is usable. Note that disk1 and disk2 have to be both mounted together and working, you can't use use data when only one of the two disks working.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •