RAID阵列知识

raid

Redundant Array of Independent (originally Inexpensive) Disks or RAID can be set up using hardware or software.

Hardware RAID is more expensive, but offers better performance.Software RAID is cheaper and easier to manage, but it uses your CPU and your memory.

technologies like mdadm, lvm and even zfs focus more on managability.The workload on the cpu for software RAID used to be high, but cpu’s have gotten a lot faster.

raid level

  • jbod

jbod uses two or more disks, and is often called concatenating (spanning, spanned set, or spanned volume). Data is written to the first disk, until it is full. Then data is written to the second disk… The main advantage of jbod (Just a Bunch of Disks) is that you can create larger drives. JBOD offers no redundancy.

  • raid 0

raid 0 uses two or more disks, and is often called striping (or stripe set, or striped volume). Data is divided in chunks, those chunks are evenly spread across every disk in the array. The main advantage of raid 0 is that you can create larger drives. raid 0 is the only raid without redundancy.

  • raid 1

raid 1 uses exactly two disks, and is often called mirroring (or mirror set, or mirrored volume). All data written to the array is written on each disk. The main advantage of raid 1 is redundancy. The main disadvantage is that you lose at least half of your available disk space (in other words, you at least double the cost).

  • raid2,3,4

raid 2 uses bit level striping, raid 3 byte level, and raid 4 is the same as raid 5, but with a dedicated parity disk. This is actually slower than raid 5, because every write would have to write parity to this one (bottleneck) disk. It is unlikely that you will ever see these raid levels in production.

  • raid 5

raid 5 uses three or more disks, each divided into chunks. Every time chunks are written to the array, one of the disks will receive a parity chunk. Unlike raid 4, the parity chunk will alternate between all disks. The main advantage of this is that raid 5 will allow for full data recovery in case of one hard disk failure.

  • raid6

raid 6 is very similar to raid 5, but uses two parity chunks. raid 6 protects against two hard disk failures. Oracle Solaris zfs calls this raidz2 (and also had raidz3 with triple parity).