Types of Corruption in FAT Volumes

Types of Corruption in FAT Volumes

Errors can accrue on a FAT volume, either by device removal during file system modifications, power loss, or by improper host operation. Several types of corruption are common:

  • Cross-linked files. If a single cluster becomes linked to two different files, then it is called “cross-linked.” The only way to resolve this is by deleting both files; if necessary, they can be copied first so that the contents can be verified.

  • Orphaned directory entries. If LFNs are used, a single file name may span several directory entries. If a file deletion is interrupted, some of these entiries may be left behind or “orphaned” to be deleted later.

  • Invalid cluster. The cluster specified in a directory entry or linked in a chain can become invalid. The only recourse is to zero the cluster (if in a directory entry) or replace with end-of-cluster (if in a chain).

  • Chain length mismatch. Too many or too few clusters may be linked to a file, for its size. If too many, the extra clusters should be freed. If too few, the file size should be adjusted.

  • Lost cluster. When a cluster is marked as allocated in the FAT, but is not linked to any file, it is considered lost. Optionally, lost cluster chains may be recovered to a file.