RAID 2 is a technology which stripes data at the bit level using a Hamming code (a linear error-correcting code) to detect errors. Each bit is written on a distinct drive / strip. In RAID 2, two groups of disks are required – one for writing the data and another group is used to write the error correction code.
When data is written to the disks, it calculates the error correction code (ECC) for data on the fly, and stripes the data bits to the data disks, and writes the error correction code to the redundancy disks. And when data is read from the disks, it reads the corresponding error correction code from the redundancy disks as well, and check if the data is consistent. If needed, it makes adequate corrections on the fly.
As the error correction codes in modern hard disk drives use Hamming code, RAID 2 is no longer in use.