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.
Examples of conditions that might cause medium errors
- The head executed a Read request while being improperly aligned, causing it to read data from a wrong physical position.
- Previous operation of the disk harmed the medium in some manner (e.g. scratched it), corrupting data in the location that is now discovered as problematic.
- External conditions (e.g. dust particles) physically harmed the medium, or caused the head to harm the medium.
- A previous Write on a nearby physical location caused the head to corrupt bits in the read location (imprecision in the physical write location). This is less likely in media that is mostly read-only, such as optical media, unless the writing device is defective.
- Bit rot, i.e. the gradual, natural deterioration of the magnetic field.