A mechanism is provided for migration between stripe storage and redundant
parity striped storage. When a disk is added to a disk array, the
mechanism migrates from RAID 0 to RAID 5. For each row, the mechanism
calculates parity for the row and, if the parity position is not the new
drive, the mechanism writes the data from the parity position to the new
drive and writes the parity to the parity stripe position. If a drive
fails, the mechanism migrates back from RAID 5 to RAID 0. For each row,
if the parity position is not the failed drive, reads the data from
remaining drives, XORs the data stripes to get failed drive data, and
writes the failed drive data to the parity position. If a read or write
is received for the failed drive, the mechanism simply redirects the read
or write to the parity position.