In digital storage, a Medium Error is a class of errors that a storage device can experience, which imply that a physical problem was encountered when trying to access the device. The word "medium" refers to the physical storage layer, the medium on which the data is stored; as opposed to errors related to e.g. protocol, device/controller/driver state, etc.
Medium errors are most commonly detected by checking the read data against a checksum – itself being most commonly also stored on the same device. The mismatch of data to its supposed checksum is assumed to be caused by the data being corrupted.
Locations of medium errors can be either temporary (as in the case of bit rot – there is no damage to the medium, the data was simply lost), or permanent (as in the case of scratching – the physical location is unusable from that point onwards).
Devices can sometimes recover from medium errors, either by retrying or by managing to reconcile the data with the checksum. If the medium has incurred permanent damage, the device might remap the logical address where the error occurred to a different, undamaged physical location.
Medium errors are often associated with long latency for the IOs. This is due to the device retrying and attempting to recover from the error.