Helping people with computers... one answer at a time.

File corruption happens most commonly when there's a hardware issue or bad sector on your hard drive. I'll look at implications and preventative steps.

How are files "corrupted" and why do they go "missing"? I had this happen recently and was told that it was not a virus that caused it: that it "Just happens". Whatever! Windows had to be re-loaded.

Yes, it does "just happen".

That should make you a little nervous, and perhaps motivate you to invest in that backup strategy you've been putting off. Smile

The fact is, things occasionally break, and when they break the failure can be catastrophic - as in suddenly your machine won't turn on - or much more subtle, not showing up for weeks or months or sometimes never.

For the most part, I'm talking about the hard disk in your computer.

It's not uncommon for a hard disk to develop or even come with a bad sector - an area on the magnetic media that is somehow damaged. Think of it much like a scratch on an audio compact disc; sometimes it'll play the music just fine and you'll never notice, but then sometimes it'll skip or have a little distortion. In the worst case you might not be able to play the rest of that song or disc.

"You cannot prevent a hard drive from developing bad sectors or failing."

Bad sectors develop for a number of different reasons. The magnetic media may have come with a subtle flaw or a "thin spot" that simply wears out over time. The more common cause is likely motion - a drive getting moved around while its in use, and the read/write mechanism perhaps ever so slightly touching the magnetic material and scratching it. This is one of the reasons that the more rugged laptop drives are also somewhat slower: the mechanisms are often built more solidly with motion in mind so as to minimize the possibility of this type of thing happening. But regardless of these and other causes, it can and does happen.

And when it happens to data the result is corruption - data that used to be

The quick brown fox jumps over the lazy dog.

might suddenly become:

The quick br-t?hZO1E-Ca fE??IGGq+

Now, it's one thing if the text you're reading is suddenly garbled like that, but if that's your financial data, or one of your installed programs - or even Windows itself - you could be in a world of hurt.

  • In the simplest case you might never notice, because the bad sector is on some unused portion of your hard disk, or in part of a file you never or rarely use, or where the corruption is actually benign. You'd simply never see it.

  • In relatively benign cases you might get a "read error" or a "CRC error" as the operating system detects that some form of data corruption had occurred.

  • As you can see above, if it happens in a data document of yours, you might open that document to find its content scrambled.

  • In more complex document formats (Microsoft Office documents are a good example), the program might not be able to even open the document due to corruption somewhere within.

  • If the corruption happens within the file that contains a computer program (an EXE or DLL file), then the program might not run at all, might crash when you do run it, or it might crash at some point when you access a certain feature that uses the instructions that have been corrupted.

  • If the corruption happens within the file system information - perhaps the information about what files are stored on the disk - files can disappear.

  • If the corruption happens within the files that comprise Windows itself, Windows can crash or even fail to boot.

  • If the corruption happens within the master boot record, partition information or other key areas of the hard disk, the entire disk may suddenly appear unformatted or empty.

As you can see, problems resulting from even a single bad sector's worth of data corruption can range from benign to disastrous.

You'll sometimes have warning. CRC errors are common as a hard disk starts to go bad, as are sudden slowdowns as the operating system attempts to read and re-read areas of the disk that are having trouble.

But you won't always get a warning. You could just wake up one morning with a dead hard drive; it quite literally has happened to me.

The good news in all this is that it's not something that happens every day. Hard drives often run for years without a problem. But in a sense it's a game of Russian Roulette: your hard drive could also develop a failure tomorrow.

So, how do you prevent it?

The most common answer is simply that you cannot. You cannot prevent a hard drive from developing bad sectors or failing. It happens. The best you can do is prepare.

There are tools - most notably SpinRite - that can "condition" your hard drive by carefully writing and rewriting your data on the drive and in doing so repair or avoid known bad areas on the drive. That can delay, sometimes significantly, a drive having a problem.

But the real "solution" is simply to know that someday when you least expect it (and perhaps when it'll be most inconvenient) it will happen, and to prepare.

And that of course means having regular backups so that when, not if, a file becomes corrupt you can repair or replace the drive and restore that file or even the entire contents of the drive as needed.

Article C3962 - December 26, 2009 « »

Share this article with your friends:

Share this article on Facebook Tweet this article Email a link to this article
Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

18 Comments
Dan Ullman
December 28, 2009 3:40 PM

Gamma rays cause these sorts of problems. A friend proved it to my by pointing out that hard drives are not protect from gramma rays. Seemed reasonable to me :). It was the only reasonable explain for the problem I was having... :)

Carolyn
December 29, 2009 8:23 AM

My son has an Acer 3000, and suddenly it won't power on at all. We have charged it for a long time, and tried it with and without the power cord, but it still won't come up. Can you recommend anything to try that won't cost anything? I am struggling right now financially. Do you know of any moonlighting jobs using your pc where you can work from home in the evenings or on the weekend?

Gabe
December 29, 2009 9:54 AM

How can I be sure that my backup isn't copying corrupt files to begin with? Is that what the "verification" process handles?

It depends on the kind of corruption. If it's a physical problem, as outlined in this article, then reading the disk will show errors and is likely to return different data each time the bad sector is read - thus when the verification stage comes along the comparison it does fails. If the data is physically ok, but has been corrupted in some other way (some rogue program went in and turned all of your "a"'s into "b"'s) then the verification phase will simply verify that the corrupt data has been backed up properly.
Leo
30-Dec-2009

Frank Golden
December 29, 2009 11:56 AM

I believe that if gamma radiation (very high energy x-rays) can cause data coruption on a HDD you have a more serious problem. Your exposure to the same radiation.
As it is gamma should have no effect on a HDD.

Moving a drive while it is in use or dropping it can an most likely will cause problems as Leo suggested.

Again if you have a gamma source near enough that you think it could be causing your data corruption then you yourself are in some danger.

I've actually had a respected electrical engineer I know comment that "cosmic rays" (no idea if that's gamma or not) can, in fact cause problems. It's very rare, but the same cosmic rays that we simply live in by virtue of living on planet earth can, apparently and very rarely, interfere with the micro-electronics we now rely on every day. Just one bit "knocked out of place", so to speak, can be completely benign, or if it's the wrong one, cause a system crash. It's extremely rare as I understand it, so I wouldn't run around blaming all your system crashes on cosmic rays, I just thought it was fascinating because it's so counter-intuitive.
Leo
30-Dec-2009
Alan Hart
December 29, 2009 12:02 PM

It seems that a careless shutdown or accidental power loss can cause file damage...can you comment?

Same basic idea: sectors can fail to be written completely as the power disappears from the drive. Add to that the fact that the operating system may not have the opportunity to write all data to the disk and everything from incomplete files, to completely corrupted directories can result.
Leo
30-Dec-2009

Nicholas Gimbrone
December 29, 2009 3:05 PM

Correct powerloss can cause data loss. Windows may not have flushed all of a modified file's contents to disk even if you have done a "close" on the file (depending upon the details of how you opened the file). Thus, it is easy for a poorly timed powerloss to cause data you thought was hardened to disk to be lost. This problem should not exist for a shutdown, as the operating system knows to flush those buffers during that process. A good/professional programmer knows how to take steps to prevent such data losses (but most "programmers" are not good or professional in their profession ;-).

Bharat Bhardwaj
December 29, 2009 10:29 PM

well, I see, yet again, you emphasise the point of 'backup'. however, my question is, should one backup only the computer or laptop or even the online content such as, email IDs, social bookmarking profiles. & much more?

would my emails not be secure with a paid account with yahoo? should i sign up a contract with a third party site that claims to make a backup of all my online content? should i trust a site such as:

backupify.com

which is a recent entrent in the 'data backup' industry?

Your help would be really appreciated in the matter.

Thanks yet again for such a wonderful resource!

Lee Nelson Guptill
December 30, 2009 8:44 AM

Frank, how in the world would a person be exposed to gamma rays in normal, everyday circumstances?

By virtue of living on planet earth. Gamma radiation is one component of Cosmic Radiation ( http://en.wikipedia.org/wiki/Cosmic_ray ). Miniscule amounts, but there.
Leo
31-Dec-2009

Henk
December 30, 2009 12:24 PM

Alpha, beta and gamma rays are everywhere around us. Part of these rays are coming out of the earth (e.g. alpha rays are emitted by the gas Radon which leaks from cracks in the shell of the earth) and another part is coming from outer space. Compare it to the light coming from the sun. Cosmic rays may contain high energetic neutrons, protons, electrons and so on. Some places on the earth are absolutely unfriendly to life and just as you may develop cancer after exposure to sunlight you may also develop cancer by breathing air with Radon in it.
As a scientist I do not suppose hard drives to fail by a normal exposure to the rays mentioned above--this story is probably an easy way out for someone who can not think of anything else. What about the rays used at airport security checks? They won't kill a HDD as far as I know.

Yee
January 8, 2010 7:48 PM

I always come across quite a number of crc errors and data corrupted every 1 out of 5-6 files I downloaded. At first, I could unRAR those files, but the next time I tried to do that, the files turned corrupted, crc errors or checksum does not match when I made a checksum file. Mr. Leo, would you mind commenting on this issues. Is my hard disk drive starting to fail or is it very common now that datas can be easily corrupted in hard disk after being kept for a period of time? Is there a way to minimize such problem as it started driving me nuts.

Pat Van Dusseldorp
February 9, 2010 9:04 AM

Toyota problems with highly computerized, wireless devices, voice activated automobiles of today??

Mick Ames
February 9, 2010 9:12 AM

One sure way to get corrupted magnetic media of any kind is to put it on or near the floor on an electric train, overground or underground. The motor under your feet generates a very powerful magnetic field and will corrupt the data on the media. If you're carrying your laptop on a commuter train, keep it high off the floor. It happened to me a long time ago with a box full of floppies which were wiped clean on the London underground!

Mick Ames
February 9, 2010 9:16 AM

I had a serious HDD crash a couple of years ago and had to buy a new one. However, I managed to recover most of my files off the corrupt disk by using Acronis Disk Director on a bootable floppy. This package got me out of a very deep hole! I am very impressed by this software and NO, I do not have any connection with the company that produces or markets it.

Me
February 9, 2010 11:58 AM

There's also the bathtub curve; basically, either the drive fails right away or lasts for years. Still, things can happen, such as dropping a laptop or a power surge or accidentally swiping it with an extra-strong magnet or dust getting through the filter and causing a head crash; and of course they sometimes fail for no obvious reason. However in general it goes by the bathtub curve.

Also, do redundant backups. If you only do one backup and that goes, you're doomed.

Menagerie
February 9, 2010 5:12 PM

You may like this little story as an epilogue to the problems of system crashes.
MANY years ago I worked as an engineer for the 'worlds largest computer manufacturer'!? I was called in when our biggest system - based in Portsmouth - crashed at exactly 9 o'clock every morning.
We took the system apart and virtually rebuilt the hardware and software platform! With NO SOLUTION!
Then.... someone had a bright idea... The Royal Naval Radar testing station was in the hills about 2 miles away and above us and one of our managers phoned them to see if they were testing anything that might be causing problems!
30 minutes later a large group of Naval techniciams were secretly in meeting with our senior staff!
The outcome was that we encased our computer room in foil insulated shutters and the RNTS changed their testing to 2am-5am!! We had no problems after that!!
Draw your own conclusions?
Oh yes... it was NOT the hard drives that caused the failure but system boards! Nothing on the drives was ever found to be damaged.

Pookey
February 9, 2010 6:18 PM

In reference to the people talking about Cosmic Rays causing damage; you are CORRECT. It is one reason why ECC memory has been developed. In the unlikely event that a Cosmic Ray hits a stick of RAM, it may flip some of the "1"s to "0"s and vice-versa. ECC Memory works sort of like RAID 5 so that a hash is created for each piece of memory to ensure that when it is used, it has not been corupted by radiation.

Yeppers
April 12, 2010 8:23 AM

Leo

Hi. I now clearly see the wisdom of your backup strategy composed of DAILY incremental backups with a monthly full backup. As in one of your examples in the article, I had two Microsoft documents (Word and Excel) on my desktop that suddenly would not open. Fortunately, I had made 2 backups of each file, each saved on separate flash drives. Unfortunately, those 2 backups were also corrupted and would not open. My full backup on a portable hard disk did have a clean copy, but it was old.

My question: Those two files were the only corrupted files (I hope, at least) and they were last modified on the same day. A subsequent Check Disk scan indicated that the volume was clean. Is it still likely that a bad sector had been the cause of the corruption? Can the SpinRite software you mentioned help me to recovery my files?

Thanks

Quite possibly, yes. (Of course I can't guarantee it, but SpinRite comes with a money-back guarantee.)
Leo
15-Apr-2010

aeneas
November 13, 2011 8:26 AM

I never had a single problem with file corruptions up until 2000s or so. Lately it has become an everyday problem.

Yet the first and a major cause is bad technology, bad controllers, and bad programming on modern system platforms.

It is impossible -or, at least >>was The "system file" has gone missing because the system ordered/flagged it for deletion and it will get deleted during some later clean up process. Not because some disk cluster has suddenly become unreadable. Because a chkdsk would reveal that a cluster x in file xy is unreadable.

At least 70% of "files missing" and "files corrupted" are a result of programming flaws on the system. The file has become corrupted because: The system has written data in an occupied cluster arbitrarily. That's why.
Other 30% are of course caused by a bad hdd surface and anomalies.

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to http://askleo.com/ask to ask your question.