NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

sg86's avatar
sg86
Aspirant
May 28, 2019
Solved

Readynas RAID 5 "protection" clarification

Hi, So I currently have this setup in X-RAID (Raid 5):   2TB | 2TB | 4TB | 4TB   A total capacity of 8TB. So I have purchased an 8TB disk to back this up, as I want to wipe drives and start a fr...
  • StephenB's avatar
    May 28, 2019

    sg86 wrote:

     

    Can someone let me know if there are any advantages of having the drives all the same size, as the capacity calculator (https://rdconfigurator.netgear.com/raid/index.html) is confusing me a little. It says that X-RAID will give me a 12TB capacity, but only 4TB is protected, so if I have 8TB used I will lose 4TB of data?

     


    I think you are confused on how RAID protection actually works.

     

    The short answer is that your system is protected against the loss of any single disk.  So you normally won't lose any data if any of your disks fail or need to be replaced. 

     

    I say "normally" because RAID protection isn't bullet proof, and there are failure modes for the NAS and the disks that can result in data loss even with RAID.  You need a backup strategy that backs up the NAS to a different device in order to protect your data.  Purchasing USB drives for backup is usually the most cost effective option.  Personally I back up my NAS to other ReadyNAS.

     

    If your 8 TB drive is an internal disk, then it won't give you more protection if you put install it into the NAS.  If you have 2x8+2x4TB you'd get more capacity, but not more protection.  The capacity rule for XRAID is "sum the disks and subtract the largest". 

     

    More details follow...

     


    sg86 wrote:

    but I don't see how if only 4TB is protection according to the calculator?

     


    You are confused because you are thinking the "protection" is a copied data block.  With RAID-1 it is a copy.  But it isn't with RAID-5.  

     

    So let's start with "vanilla" RAID-5 - assuming 4x4TB.  You'd have a 12 TB volume and 4 TB of RAID parity blocks for protection.  These parity blocks are evenly distributed across all your disks.

     

    The idea is that RAID organizes the disks so that three data blocks (each on different disks) has an associated parity block (on the remaining disk).  Let's call the data blocks A,B,C and the parity block P.  The partity block is computed from A,B,C.  The computation is done using the exclusive or function (A xor B xor C), but you can think of it as addition for my purpose.

     

    So if 

    P=A+B+C

    then

     

    A=B+C-P
    B=A+C-P
    C=A+B-P

     

    Since all these blocks are on different disks, then if one disk is replaced, then all the blocks on it can be reconstructed using the 4 formulas above.  This works in routine cases, but there are some caveats:

    • The formulas can only be applied if there is only one disk missing.  If a second disk is removed or fails, then the system can't reconstruct any of the disks.
    • The formulas can only be applied if the system can figure out what disk is missing (or was replaced).
    • The formulas only work if the partity block was properly written in the first place.  That is, P needs to be A+B+C before the disk failed or was removed. 

    FWIW, one reason for using xor instead of addition is that all four of these formulas end up being the same.

    P=A xor B xor C
    A=B xor C xor P
    B=A xor C xor P
    C=A xor B xor P

    sg86 wrote:

     

    Can someone let me know if there are any advantages of having the drives all the same size,

    First let's explain how XRAID handles mixed disk sizes, and then circle back to your question. We'll use your current configuration of 2x4TB+2x2TB.

     

    Your system actually has 2 RAID groups. You can think of these as "layers".  Each group has it's own protection, and the two groups are joined together into your data volume.

     

    If you look at your 4 TB disks, you'll see two data partitions of about 2 TB each.  The 2 TB disks have only one data partition.  Note there are a couple of small system partitions (the operating system is also on the disks) that I am ignoring.

     

    One group covers all 4 disks - it uses the first 2 TB data partition on the 4TB drives, and the only data partition on the 2 TB drives.  That group uses RAID 5 for protection.

     

    The second group covers the two 4 TB disks, using the second data partition on each of those drives.  It uses RAID-1 for protection.

     

    If you were to upgrade one of the 2 TB disks to 4 TB, then the system would

    1. reconstruct the first RAID group.  That is, each block in the first data partition of the replacement disk would be reconstructed using the formulas above.
    2. convert the second RAID group from RAID-1 (2 disks) to RAID-5 (3 disks).  That adds 2 TB of capacity to this RAID group

     

    If you were to upgrade the last disk, then the system would 

    1. reconstruct the first RAID group. 
    2. reorganize the second RAID-5 group (3 disks) to RAID-5 (4 disks).  That adds 2 TB of capacity to this RAID group

     

    At this point, the system still has 2 RAID groups, even though the disks are all the same size.

     

    Now if you did a factory default, the system would reformat the drives and start fresh.  You'd end up with only 1 data partition on each disk (4 TB in size), so you'd have a single RAID group using RAID-5.

     

    sg86 wrote:

     

    Can someone let me know if there are any advantages of having the drives all the same size,

    Ok, lets get back to this.

     

    If you build the system with disks that are all the same, and never increase the size, you will end up with a simple RAID-5 organization with a single RAID group.

     

    If you use mixed sizes (expanding the array), then you end up with multiple RAID groups that are joined together.

     

    The multiple RAID groups are a bit more fragile - if something goes wrong with any one of them (and sometimes it does), then the volume can't be properly assembled.  So the chance of losing your data goes up a bit, and the odds of successful data recovery go down a bit.  Personally that's a risk I take - the convenience of vertical expansion outweighs this extra risk. 

     

    And even if you only have a single RAID group, there is still some risk that you will lose data as a result of a failure.  

     

    So the best practice here is to maintain good backups - assuming that your NAS might fail at any time, and that the failure might result in losing the data.  Then you won't lose anything when something bad happens.

     


    sg86 wrote:

     

    Should I go for the 4 x 4TB and RAID 10 option then instead?

    RAID-10 is a bit faster than RAID-6, but RAID-6 offers a bit more protection.  In both cases, your ability to expand the system later is more limited (and the steps can be more complicated).

     

    Overall my recommendation is to stick with XRAID, but implement a backup plan to protect your data.