Search code examples
filefilesystemscorruption

What can be the possible causes that can lead to file corruption?


Sometimes files can get corrupted. Some applications store a hash(MD5) of the contents of the file(example.txt) in a separate file(hash.txt). When someone wants to read example.txt, the hash is recomputed and it is compared against data from hash.txt. If they are the same everything is ok, but if they differ it means that the file is corrupt.

What can cause this data corruption? Is corruption linked to specific file systems or it can happen in any file system?


Solution

  • There can be multiple possible causes, like:

    • physical harm on the disk (bad sectors)
    • authentic changes (in this case it's not a corruption)
    • changes done by malware
    • unwanted side effects of software
    • virus infections and antivirus responses to them

    This can happen in any operating system. If you have important files then you are advised to regularly create backups.