6

Flash memory has a limited number of read/write cycles, after which it fails. What happens when it fails? Is it like a hard drive, where a failed write is silently moved to another part of the disk and that sector marked as bad and never used again, without data loss? Are there a limited number of replacement sectors? Do operating systems warn the user in some way?

1
  • Related: This newer post had asked on "What actually happens with an USB flash drive when it dies?", which has explanations in terms of memory cell and semiconductor material failures.
    – user109256
    Jan 7, 2016 at 9:43

2 Answers 2

5

Yes, they do very similar operations when sectors fail: both silently move sectors to unallocated area after failed write verification. Yes, their number is limited on both the memory types.

There is just one, but important, difference: number of writes on hard drives isn't limited, so failure of sectors in hard drive is unexpected and is probably sign of failure in some other it's part: a crashed head or scratched surface or overheated controller etc. Most time you will want to replace the whole driver when bad sectors begin to appear even if controller has remapped them successfully because soon the whole drive will fail.

Failure of sectors on flash drive is expected and (quite) often happens in normal use: a sector has a limited and determined maximal number of writes, avg. 100000 on a recent flash chip (I'm referring to datasheets of common I2C flashes, but the technology is very similar in USB flash drives). After this number for any sector is exceeded it will fail, sooner or later, so it does not refer to overall state of the drive in any way.

Because hard drives weren't supposed to have any bad sectors during normal work, there were not any technology that was able to detect them (and also remap and notify user). Some years ago SMART was created to do this job.

As remapping for flashes is required by the technology, SMART-like technology was used in flash drives initially. No standardized methods of checking it's status exist, and AFAIK there are no vendor-specific utilities too. That's all about cost reducing.

7
  • 1
    I've read that the USB external drive interface doesn't provide any way to send SMART errors to the OS; so even if a thumb drive implemented SMART the warnings wouldn't be delivered. This is doubly disappointing because flash cells don't suddenly stop working, failure comes after a period of progressively slower write times meaning there always should be plenty of warning to send a SMART error vs mechanical drives often failing without warning. Jan 29, 2010 at 16:38
  • 1
    Yes, there is no way to send SMART commands over any compliant USB mass storage controller. The slowness you mention appear because controller repeatedly tries to write same sector and eventually remaps it.
    – Catherine
    Jan 29, 2010 at 16:52
  • Why are there a limited number of sectors? Couldn't the drive just slowly reduce in reported size as sectors disappear to wear?
    – endolith
    Jan 30, 2010 at 15:11
  • 1
    None of currently present filesystems can handle a slowly shrinking drive. Also the number of sectors is only checked by OS when drive is inserted and cannot be changed during work if the device is USB mass storage-compliant.
    – Catherine
    Jan 30, 2010 at 15:16
  • Yes, they do very similar operations when sectors fail: both silently move sectors to unallocated area after failed write verification. Is this for SSDs or “thumb drives” too? Is the remapping automatic and transparent? Shouldn’t that mean that if there are spare cells available, the write should succeed even if it had a problem? I just copied some files to a brand-new, brand-name SD card and flash-drive and both of them had some files that were slightly corrupted. I re-copied them and they were fine.
    – Synetech
    Aug 19, 2013 at 4:55
1

I've had quite a few failed flash drives, and there was no warning - the drive simply stopped being readable. They were large drives, and I didn't put much on them, so I assume things were being written to good sectors automatically, if silently.

Moral of the story? Back up everything on your flash drives.

9
  • 1
    USB key-style drives? They may have broken due to mechanical damage or similar. Of course, you should back up everything that you want to keep, regardless of what it's stored on :)
    – pjc50
    Jun 7, 2010 at 11:59
  • @pjc50: Could have been. I try to be careful with stuff, but it's not beyond me to be particularly clumsy!
    – Phoshi
    Jun 7, 2010 at 13:57
  • If you (or anyone) has a lot of trouble with flash drives, especially different ones, then it could be the port. Make sure to try different USB ports/card-readers and check that the pins on the port and device are clean. Also, if you are using a USB extension cable, try connecting directly to a port (I found that a cheap cable I bought on eBay gave me a lot of trouble when I connected flash-drives through it).
    – Synetech
    Jun 10, 2013 at 12:21
  • Also note that wear leveling is almost nonexistent on pen drives.
    – Calmarius
    Aug 9, 2013 at 18:39
  • Also note that wear leveling is almost nonexistent on pen drives. @Calmarius, so what is the results of that? Does it get “bad sectors”? Do they get remapped? Does the whole thing fail? Also, if that is/were true, then it would mean that the parts of the drive where the file-system structures (FAT, MFT, etc.) are stored would get worn out very quickly even from just renaming and moving files around, thus rendering the whole thing useless even if 99% of the drive is perfectly good. I can’t imagine that drive manufacturers would be so obtuse.
    – Synetech
    Aug 19, 2013 at 18:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .