PMS

FAT File System Errors

As a result of how the FAT file system allocates space and chains file together, there are several common types of errors that can crop up over time. Note that I am talking here about errors in the logical structure of the disk, not physical disk errors, bad sectors, and so on, which are discussed in some detail here

File system errors are occasionally the result of corruption on the disk that can have at its root a real hardware problem. These errors can therefore result from any system problem that can cause disk corruption, such as resource conflicts, bad drivers, etc. Far more often, however, file system problems occur as a result of a software problem. Program crashes, for example, often leave around clusters that had space allocated to them but not assigned to a file.

A power failure on a PC running Windows will often result in one or more file system errors due to files not being closed properly. This is why you are always supposed to exit Windows before shutting down a PC. It is also why newer versions of Windows automatically scan the disk for errors when they starts, if they detect that Windows ended without doing a proper file system shutdown.

The following are the most common errors encountered on a FAT disk:

  • Lost Clusters: Virtually every user has come across this problem from time to time. Lost clusters are simply ones that are marked in the FAT as being in use, but that the system cannot link to any file. Every file consists of a series of clusters that can be traced by starting with the directory entry and following the linked list of clusters to the end of the file. Disk checking programs can scan an entire disk volume for lost clusters using the following procedure (or something similar to it):
    1. Create a copy in memory of the FAT, noting all of the clusters marked as in use.
    2. Starting at the root directory, trace through the clusters used by each file and mark them as "accounted for", since they have been seen to be connected to a file. Then do the same for all the subdirectories of the root directory, and then their subdirectories, and so on.
    3. When finished, every cluster that is marked in the FAT as in use should be accounted for. Any that are in use but not accounted for are "orphans" that don't belong to any file--lost clusters.

    Lost clusters are usually the result of interrupted file activity of some sort--a program will allocate some clusters to a file it is building, and if the file is not properly finished and closed, the clusters never get correctly linked to a file name. The program that detects lost clusters will usually give you the choice of clearing them (marking them as "available" and returning them to the pool of free clusters) or saving them as a file. In the latter case, the program generates an artificial file name and links the lost clusters to that name, so that a real file is formed. Usually this file will then be damaged in some way, but you can often at least see what this orphaned data was and in some cases, recover at least part of it.

  • Cross-Linked Files: On rare occasions, two files can end up pointing to the same data on the disk. Both files will have the starting cluster number in the directory entry pointing to the same cluster number. Alternately, one of the clusters in the middle of two or more cluster chains may point to the same place. Obviously this is a problem: the same cluster cannot be part of more than one file, at least not in this universe! :^) Each time you use either of the cross-linked files, you will overwrite all or part of the other one. The only solution to this problem is to make new copies of each of the affected files. You will generally lose the contents of one or the other of the files (in fact, by the time you discover this problem, you have already lost the contents of at least one of them.) Often, both files will be lost and you will need to restore them from a backup.
  • Invalid Files or Directories: Very rarely, the internal structures of file or directories can become damaged so that some entries are no longer following the "rules" for how a file or directory is supposed to be laid out. An example would be a directory that doesn't have a pointer to its parent directory, or a file that has an invalid start cluster. Sometimes files get assigned an invalid date or time by a buggy piece of software. These problems can usually be fixed by the disk scanning software.
  • Allocation or FAT Errors: Occasionally the entries in the FAT can become corrupted or set to invalid values. Again, most disk-checking utilities will detect and correct these sorts of problems on the fly.

Media Retention - Media Size Matching - Media Tradeoffs
Backup - data loss - Disaster Recovery - Preventative Maintenance
Disk errors - Disk quality - Defrag - Virus detection - Virus Scanning - Infections

Need Help?  Call us - click here