Sign in with
Sign up | Sign in
Your question

File corruption on Flash - one kibibyte long sequences of FF bytes

  • Flash Media
  • Flash
  • Storage
Last response: in Storage
April 7, 2011 5:56:41 PM


I've been experiencing some problems with corrupted files which (to me) make it look like I should be replacing one of my flash drives; however before I do I'd be interested to know if anyone knows what might be causing this particular file-corrupting phenomenon.

The corrupted files will all have, in at least one place, precisely one kibibyte consisting solely of FF bytes. I've not seen any other sort of damage to any of the files.

Can someone enlighten me as to what the cause of this might be?


James McLaughlin.

More about : file corruption flash kibibyte long sequences bytes

Best solution

a c 415 G Storage
April 7, 2011 7:05:42 PM

If you write a file to the flash drive and find that some of the data has changed when you read it back again, it's a bit of a moot point as to exactly why it happened - the sad fact is that the device is unreliable and your only real option is to replace it.

Does the 1KB of corrupt data indicate a bad flash cell? Perhaps, particularly if it turns out that the flash device has a 1KByte page size. But that seems pretty small for a flash page.

I experienced problems with a particular combination of USB3 host adapter and USB3 drive dock where sectors of hex "00"s would be very rarely written to the drive in place of the actual data on large file transfers. The fault was with the USB connection, not with the drive - replacing the dock and the host adapter solved the problem.

I say that to point out that it's possible there's some sort of protocol hiccup going on between your USB port and the flash drive that's causing the problem rather than the actual memory cells. You could test that hypothesis by trying the drive on another computer, hopefully one that uses a different chipset for the USB ports.
April 21, 2011 11:15:48 AM

Thanks sminlal.

I thought I'd just paste in the answers I got when I asked this question elsewhere:

"Flash memory is arranged into blocks which, unlike hard disks, must be
erased to 0xFF before they can be written. Blocks may be thousands of
bytes and erasing cannot happen at the byte or word level, it is a
block-level operation. (Changing a single byte requires reading the
whole block, erasing it, and writing it all back again with the one
change. It is the erasing which causes flash memory to "wear out",
incidentally.) If you are seeing large chunks of 0xFF this indicates
the block has been erased but not written. The regular offsets are
likely because file boundaries will tend to be aligned with block
boundaries. As to why the file is corrupt at all, perhaps the
controller or flash chip is flaky and missing reads? Either way it
sounds like it needs replacing!"

"Before any data can be written into flash memory, the whole block has to be erased. Hence, if the operation is interrupted at just the wrong moment you're in trouble. Not unmounting can cause this - if you're very unlucky with the timing."
Related resources
April 21, 2011 11:16:02 AM

Best answer selected by jamie_six_four.
May 17, 2011 8:49:20 PM

jamie_six_four said:
Best answer selected by jamie_six_four.

nHere in Scotland we've started a new version of the whole byte thing.
nHow many tosserbites are you experiencing ?
May 17, 2011 9:00:38 PM

jamie_six_four said:
Best answer selected by jamie_six_four.

noh and it's 1066 bits to the bite