[mythtv-users] video artifacts on recordings: could building a raid be the cause?
linux at thehobsons.co.uk
Wed Dec 27 21:20:53 UTC 2017
Mike Hodson <mystica at gmail.com> wrote:
> Finally, I would highly suggest to keep using the single disk, or a mirror, to record on, and then only use the RAID5 for long-term storage. Writes to RAID5 are also, very I/O intensive, as its doing the R R R R W cycle for every single block written.
I can't speak for MD raid, but it's not done that way by some RAID controllers. It can be done with 2 reads and 2 writes - regardless of number of disks in the array. In a 5 disk array, writing block D1 and updating the parity can be done either by :
read D1 D2 D3 D4, calculate new P, write new D1 and P
read D1 and P, XOR old P with old D1, then with new D1 to get new P, write D1 and P.
The latter is faster on large arrays - but has an unfortunate property of not self-healing any errors in the parity block. As a result, errors might go undetected for some time (maybe years) until there's a disk failure, the data is recreated using the faulty parity block, and corrupted as a result.
It's also why I'd not recommend assembling an array without initialising it - unless you absolutely know that the RAID controller/software calculates a completely fresh parity block on every write, or that all the blocks are filled with zeros. Otherwise, your array will be filled with random data, with incorrect parity blocks that will persist "forever" (unless you specifically run an array consistency check) just waiting to silently corrupt your data when a disk fails.
More information about the mythtv-users