Data corruption is among the most common computer errors. Unlike a bug, which occurs because of improperly written or executed code, data corruption happens when code is intentionally or unintentionally changed from its original, correct form. Corruption can be systematic or random, and even a small change can fundamentally break a program or render a file useless.
Here’s how it happens – and what you can do stop it.
What Causes Corruption
The universe is not a friendly place for data. Stray particles can literally zap a zero to a one, or vice versa, introducing random corruption even when a computer is turned off. And if stray particles don’t do the trick, simple physical decay can. Magnetic drives lose their orientation, electrically charged media gradually lose charge, and optical media breaks down as its plastic degrades or is damaged. In a sense, then, computers are literally doomed to become increasingly corrupt as time goes on, and all digital storage will eventually be ruined. Every hard drive, floppy disk and CD-ROM will, given enough time, become a garbled mess of unintelligible code.
This can be a serious problem for systems so critical that lives depend on them. For example, some scientists have suggested that Toyota’s unintended acceleration fiasco may have been caused by the interference of cosmic rays combined with inadequate fail-safes for recovering from randomly introduced errors. For most PC users, however, invaders from outer space are not the most likely source of trouble. Good ole-fashioned human error is a more common cause. Corruption usually occurs because of user error (deleting or modifying files that shouldn’t be tampered with), malicious activity (malware) or routine degradation and failure of storage media (mechanical and solid state drives).
Whatever the source, corruption can be lumped into two categories; detected andundetected. The former causes more frequent, less severe problems, while the latter can result in a complete system crash or an unrecoverable hard drive.
As the term implies, detected corruption is just that; corruption that’s been detected. While this may seem a silly definition, it’s important because it means the user knows about the issue.
You might, for example, open an image file and find that part of it is now filled with artifacts. While that is bad, it also provides the chance to take action. With the problem now apparent, you’ll have the chance to restore from a backup or investigate the issue further to see if the corruption was truly random, or caused by a fixable problem.
Importantly, detected corruption is usually minor. A file may be lost, a bad hard drive sector may need repaired, or a program may not longer run properly. Though annoying, these issues are usually recoverable and limited in scope. Even when they lead to bigger problems, at least they give the user time to prepare. The most serious issues occur when corruption festers undetected.
Cosmic rays excluded, corruption occurs for a reason, be it malware, hardware failure or buggy software. The most serious corruption issues tend to occur when the source of the corruption is not addressed early in its lifecycle. In a way, corruption is a cancer for computers. Detected early, it can be targeted and cut out, but if it lingers undetected it can multiply until, suddenly, the situation is hopeless.
For example, your power supply could be flawed. Occasionally it under-volts the hard drive, and on these occasions random errors occur, creating bad sectors. Perhaps some of these are detected and fixed, but eventually the error hits a portion of the drive containing critical driver or operating system data. Now your computer crashes, or won’t boot, and files in the bad sectors may be unrecoverable even by a professional service.
Or perhaps the manufacturer accidentally left a tiny particle of dust in your drive, which is gradually scratching the service of the disk. Maybe a virus is changing files at random in the background. Maybe, as is common with solid state drives, errors are being introduced as a result of old age or unusually quick wear due to demanding read/write cycles.
Whatever the cause, the worst-case scenario is the same; the undetected corruption is detected only when the storage media or file system fails.
Keeping Tabs On Your Hard Drive’s Health
Your fight for order should begin by keeping tabs on your hard drive’s health. You can do this by reading S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) data from your drive with HD Tune, a hard drive analysis and benchmarking utility. While the Pro version provides helpful logging, you can likely get by with the free edition, which will read S.M.A.R.T. data but won’t create logs for you. Alternatively, you can turn to other freeware like HDDScan and Crystal Disk Info. A study by Google indicates users should pay particular attention to scan errors, reallocations and sector probations, as drives exhibiting these errors were the most likely to subsequently fail.
You can also use Windows’ built-in tool to scan for bad sectors. You can do this by right-clicking a drive in My Computer, selecting Properties, and then hitting “Check now…” in the Error-checking section of the Tools tab. A large number of bad sectors is, of course, a bad thing; even a couple should be cause for concern.
Since malware can introduce corruption, you’ll need to keep it at bay. Of course, we’ve already covered malware in-depth, so rather than repeating what’s been said I’ll just direct you to our round-up of free antivirus software. Though a free suite will not provide advanced features like phishing protection, it is quite capable of guarding against threats that might try to damage your files.
Also, Windows users should leave User Account Control turned on. This feature prevents a program from altering important data without permission, which can greatly limit the damage should your PC ever be infected. Turning off UAC lets a virus go wild should it take root in your file system.
Upgrading Your Hardware
As an extreme measure, you can guard against corruption by upgrading that hardware in your computer. You could switch to Error Correcting Code (ECC) RAM, for example. This type of RAM can detect most errors introduced by outside interference. To switch, however, you’ll need to buy a server motherboard, which likely means upgrading to a server CPU (like Intel’s Xeon). The combined added cost of the processor, motherboard and ECC memory can easily add an extra $200 or more to the price of a desktop PC, and that’s if you build it yourself.
You also might try switching to an enterprise-grade hard drive. Such drives are rated to be more reliable and usually have sturdier components (in the case of mechanical drives) or more durable flash memory (in solid state drives). On the other hand, though, a promise of reliability is not necessarily a guarantee, and even an “enterprise grade” drive is vulnerable to problems outside its control, like a faulty power supply or malware infection.
Getting Back To Backups
The aforementioned Google study found that while drives reporting certain S.M.A.R.T. errors were indeed far more likely to fail than those which reported none, the majority of drives which failed never reported a single error. Google also found drives were most likely to fail in their second and third years of operation, meaning that relatively young drives went belly-up. In short, proactive measures don’t sufficiently guard against corruption and loss of data.
You have only one option that can guarantee the survival of data; copy it! If the original file becomes corrupt, just replace it with the backup – job done. Just remember that backups themselves can become corrupted over time, which is why you need to perform a complete backup of important files regularly.
Corruption is inevitable. The question is not if it will happen, but when – and what you’re going to do about it. While you can take measures to minimize the chance it will occur, any PC owner who values their data has to assume tomorrow might be the day their data goes MIA.