RAID1
Disks already have error detection built in (RAID1 是依賴 HDD 自身的 error detection)
A typical RAID 1 implementation will pick one disk to read from, (沒有每次讀兩碟 Compare)
reading from the other disk only if the first disk reports an error.
Typically, the RAID array can be scanned periodically(Patrol Read)
During this operation, both disks are compared.
The primary purpose is to detect any bad sectors and rewrite them with data from the other disk
RAID5
With RAID5, the parity information is not used until the failure of a drive is detected
RAID5 的核心 - XOR 運算
# HDD0 HDD1 HDD2 HDD(n-1) HDDn D0 xor D1 xor D2 xor ... D(n-1) = P0
D0, D1, D2= Data
P0 = parity
Data 的 mismatch 問題
RAID1 or RAID5 would not protect against "mismatch"(bit that randomly "flipped")
They are mainly meant to protect against the hardware failure of a single drive
解決
A) Using RAID6
B) Use a file system which actively checks for data integrity, such as ZFS, btrfs.
* HDD in-built redundancy for error correction and recovery
Modern drives make extensive use of error correction codes (ECCs), particularly Reed–Solomon error correction.
In the newest drives, as of 2009, low-density parity-check codes (LDPC) were supplanting Reed–Solomon;
(LDPC codes enable performance close to the Shannon Limit and thus provide the highest storage density available)
The worst type of errors are silent data corruptions which are errors undetected by the disk firmware or the host operating system;
S.M.A.R.T: "Hardware ECC Recovered"
C3 ECC Error Rate C7 CRC Error Count C8 Write Error Rate / Multi Zone Error Rate
The higher the raw value, the worse the disk surface condition and/or mechanical subsystem is.
RAID10 Mode
RAID 10 = Nested RAID
Creates a striped set from a series of mirrored drives
RAID 10 = RAID 0 ( RAID 1 + RAID 1)
* each RAID 1 set is considered a span
When configuring a RAID10 array it is necessary to specify
- the number of replicas of each data block that are required (this will normally be 2)
- replicas should be 'near', 'offset' or 'far' (mdadm layout option)
The default is 'n2' (Drive count must be even, Each drive has a mirrored pair)
Span 與 Stripe
Span: 幾個物理磁片一個接一個串聯到一起, 從而提供一個大的邏輯磁片 (JBOD)
(Concatenation or spanning)
It is not one of the numbered RAID levels
RAID 0 = stripe set
n2
each chunk is repeated n times in a k-way stripe array
(k is the number of drives)
2 drives 3 drives 4 drives -------- ---------- -------------- A1 A1 A1 A1 A2 A1 A1 A2 A2 A2 A2 A2 A3 A3 A3 A3 A4 A4 A3 A3 A4 A4 A5 A5 A5 A6 A6 A4 A4 A5 A6 A6 A7 A7 A8 A8 .. .. .. .. .. .. .. .. ..
f2
All the drives are divided into f sections.
All the chunks are repeated in each section but offset by one device.
2 drives 3 drives -------- -------------- A1 A2 A1 A2 A3 A3 A4 A4 A5 A6 A5 A6 A7 A8 A9 .. .. .. .. .. A2 A1 A3 A1 A2 A4 A3 A6 A4 A5 A6 A5 A9 A7 A8
o2
each stripe is repeated o times
2 drives 3 drives -------- -------- A1 A2 A1 A2 A3 A2 A1 A3 A1 A2 A3 A4 A4 A5 A6 A4 A3 A6 A4 A5 A5 A6 A7 A8 A9 A6 A5 A9 A7 A8 .. .. .. .. ..
Updated algorithm RAID 1
Updated algorithm enables each RAID-1 array to contain 2–32 drives
More Info.
简单磁盘捆绑 = JBOD
RAID6
dual parity calculation works
P = a + b Q = a + 2b
If you lost c and d, you can recover them by solving the original equations.
the calculated values of P and Q can be significantly larger than the original data values.
We 'd like to redefine the arithmetic operators +, –, ×, / such that our equations still work,
but the values of P and Q stay within the ranges of the input values.
The solution is called a Galois field. The particular Galois field of interest is GF(28)
it gives us efficient +, –, ×, / operators that we can use to calculate P and Q,
and if needed recalculate a lost data block from the remaining data blocks and parities.
And, each of P and Q perfectly fits into a byte. The resulting coding is called Reed-Solomon error correction,
and that 's the method used by RAID 6 configuration