A disk drive is disclosed comprising a head actuated over a disk. A
redundancy generator generates a plurality of redundancy symbols appended
to user data to form a codeword C(x) written to a selected data sector on
the disk. During a read operation, a syndrome generator generates a
plurality of error syndromes in response to a received codeword C'(x)
generated by reading the selected data sector. An error detector,
responsive to the error syndromes, detects a number of errors in the
received codeword C'(x), and a plurality of counters count a number of
times the number of errors falls within a predetermined plurality of
ranges to thereby provide a distribution of the errors. The error
distribution is used, for example, for selecting a track density or ECC
depth, or for failure prediction or defect mapping.