How RAID works

Redundant Array of Independant (or in some cases Inexpensive) Disks

Raid 0 (disk striping)

RAID 0 visual

Description: Spreads data blocks to multiple disks. Although this is far from being reliable, it is still used because of its simplicity and the fact that it’s much less expensive than something like a RAID 10.

It’s also important to read about stripe size when you set up a RAID 0 array for various reasons. The stripe size is the size of each blocks that are split between each disks in the array. A file that is, for instance, 200KB will be split into 3 blocks of 64KB and 1 block of 8KB (3*64KB + 1*8KB = 200KB).

With that in mind, if you have a massive amount of small files that are smaller than the stripe size, then the storage of the first disk of the array will be used up faster than the other disks. On the other hand, if you have a RAID 0 used for storing large files, then having a bigger stripe size is good because if one of your disks ever fail, it’ll be easier to recover the pieces because there will be fewer blocks to recover (a puzzle of 50000 pieces (of 64KB) is much harder compared to a puzzle of 3125 pieces (of 1024KB))

While it is true that one of the only purpose of using RAID 0 is to have an increase in performance, some files do not need the performance boost given by the RAID 0 for files like a .txt containing information.

TL;DR: Files smaller than stripe size do not get the speed boost because they do not get split in multiple blocks. Files bigger than the stripe size do get split in blocks and get the speed boost.

PROS

  • Much faster read/write speed

CONS

  • If 1 hard disk fails, the data is pretty much lost.
  • Not reliable

Raid 1 (disk mirroring)

RAID 1 visual

Description: Data is cloned to one or more disks. Note that disk mirroring, or RAID 1, is NOT to be confused with a backup. Even though RAID 1 can save your data in the event of disk failure, it will not protect your data from anything else (such as fire, robbery, flood, power surge).

PROS

  • Reliable

CONS

  • Even if disk 1 has a total storage of 1TB and disk 2 has a total storage of 1TB, putting both of them together in a RAID 1 will not increase the available storage to 2TB because disk 2 is a copy of disk 1 and thus cannot be used.
  • Even though it’s more reliable than one normal drive due to the redundancy provided by having a second hard drive, there is still a possibility that both drives will fail at the same time.

Raid 10 (RAID 1 + RAID 0)

RAID 10 visual

Description: Mix of RAID 0 and RAID 1. Needs at least 4 disks. Half of the physical disks are striped (RAID 0) and then mirrored (RAID 1) to the other half of the physical disks.

PROS

  • Much faster read/write speed
  • Reliable

CONS

  • Twice as expensive as RAID 0 or RAID 1.
  • The storage space in the second half of the physical disks cannot be used because they are used as clones (see first con of RAID 1)

Stuffs you shouldn’t do

  • Mixing SSDs and HDDs in a RAID array: If 50% of the data is in disk 1 (SSD) and the other 50% is in disk 2 (HDD), the SSD’s true potential will not be used because it will have to wait for the HDD, which has a lower write/read speed, constantly.
  • Having one disk with significantly more storage space than the others: The total storage capacity of a RAID 0 array is determined by the disk with the smallest storage space. So if you have 1 disk with 4TB and 1 disk with 256GB, the RAID capacity will be limited to 256GB.