A data recorder for recording data on a recording medium includes a data
storage part, an error detection part, an erasure part, a determination
part, and a recovery part. When the error detection part detects a data
transfer error, the determination part determines whether data
corresponding to the data erased by the erasure part is stored in the
data storage part. When the determination part determines that the
corresponding data is stored in the data storage part, a recovery part
recovers the erased data on the recording medium based on the stored
data.