ECC is one part of the error detection and correction function from physical disk block to logical disk sector. That's the usual method of verifying block/sector data and possibility correcting (rewrite a block) soft block errors that happen fairly often due to random causes at the raw data read level. Continuous non-random but correctable ECC errors on one or more blocks might be one reason to mark a block(s) bad before data loss and possible Uncorrectable ECC errors on the block.this function is same ECC of harddisks or different?
https://www.computerworld.com/artic...that-actually-predict-hard-drive-failure.html