Blog / Home
About
Media Gallery

Welcome
to
Thronic.com

ժʝ_

How parity works (data recovery)


Commonly used in many RAID types and certain parity based RAM technology. Comparing bits of data can retrieve lost data by simply checking if the numerical result is ODD or EVEN. In computing the XOR bit comparison operator can be used for this. Check out the example below.

Parity bits in this example are calculated based on EVEN numbers. To make it simple to understand, I'm using a dedicated parity disk.

Disk1	Disk2	Parity-data/disk
1	0	1 (1+0 needs +1 to become even)
0	1	1 (0+1 needs +1 to become even)
1	1	0 (1+1+0 already even)
1	0	1 (...)
0	1	1 (...)

Disk1	Disk2	Disk3	Disk4	Disk5	Disk6	Parity-data/disk
1	1	0	0	1	1	P0 (1+1+0+0+1+1 already even)
1	0	1	1	0	1	P0 (...)
1	1	1	0	0	1	P0 (...)
1	1	0	1	0	0	P1 (1+1+0+1+0+0 needs +1 to become even)
0	0	1	1	0	1	P1 (...)


If you remove Disk3, the missing data can be calculated the same way if you still have the parity-data/disk.

Disk1	Disk2	-	Disk4	Disk5	Disk6	Parity-data/disk	Missing data/disk
1	1	-	0	1	1	0			0 (1+1+0+1+1+P0)
1	0	-	1	0	1	0			1 (1+0+1+0+1+P0)
1	1	-	0	0	1	0			1 (1+1+0+0+1+P0)
1	1	-	1	0	0	1			0 (1+1+1+0+0+P1)
0	0	-	1	0	1	1			1 (0+0+1+0+1+P1)

Requirements

By being creative you can loose more units of storage without loosing data, but it will also require more space.


Original Post: Jan 26th, '22 16:24 CET.
Updated: Jan 26th, '22 16:27 CET.

Concept
π