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?

link|improve this question

57% accept rate
feedback

2 Answers

up vote 5 down vote accepted

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.

link|improve this answer
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. – Dan Neely Jan 29 '10 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. – whitequark Jan 29 '10 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 '10 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. – whitequark Jan 30 '10 at 15:16
feedback

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.

link|improve this answer
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 '10 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 '10 at 13:57
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.