How does RAID actually work?
19 minutes ago, Arokan said:Does it matter, which drive you lose
No.
19 minutes ago, Arokan said:how is the storage arranged for that to be possible?
Simplified example:
Three disks (D1, D2, D3); D1 and D2 are data disks; D3 contains parity information generated from D1 and D2.
When you write data to the array, half will be put on D1 and the other half will be put on D2 (like RAID 0).
The parity written to D3 will be the bitwise XOR of the data written to D1 and D2.
(XOR = eXclusive OR, 0 XOR 0 = 0, 0 XOR 1 = 1 XOR 0 = 1, 1 XOR 1 = 0)
If D3 fails and is replaced, the system generates XOR parity information from existing data from D1 and D2 (easy).
If D1 or D2 fails, you can infer the value on the failed disk from the remaining disk and the D3 (parity) information.
For example, if a bit on D1 is a 0, and the corresponding bit on D3 (parity) is 1, then you know that corresponding bit on D2 was a 1 (per the XOR operation); basically solving D1 XOR n = D3.
A little more computationally complex, but not terrible.
EDIT: IIRC, XOR is fully reversible, so D1 XOR D2 = D3 means that D1 XOR D3 = D2, etc.
More EDIT: this process is extensible to more drives (assuming you only lose one at a time); XOR can be chained together: D1 XOR D2 XOR D3 = D4, etc.
10 minutes ago, Trinopoty said:In overly simple terms, imagine you have two numbers: 25 and 67. Now you can add them to get 92. Raid 5 stores these 3 numbers in 3 drives. So even if you lose, say, 25; you can get it back by doing 92 - 67. And, if you replace the drive, the controller goes to every number and restores the missing one.
See my explanation above. You've got somewhat the right idea, but you have to remember storage is bit-binary and not decimal (so the "math" is a little different).

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now