1
\$\begingroup\$

Recently I have gotten myself in to buying USB flash drives in order to back up some of my data, however once I got into the detailed specs of the consumer flash drives I have gotten worried, about the quality of the NAND flash chips inside them. The most recent flash drive I bought is a 32GB 3.0 USB with Micron TLC chips. Now I know that these chips have about 1,000 program/erase cycles, but the problem is that I can’t find any real explanation what it takes for one of these cycles to happen. Basically, this is the question:

If I copy a 1KB txt file to the 32GB flash drive and then erase it does that use one P/E cycle, or do I have to actually write over time 32GB of data to the drive and erase it over time, for one of these cycles to be completed? Also does formatting the drive destroy some of its cycles?

Sincerely,

Neil

\$\endgroup\$
  • \$\begingroup\$ USB drives are not archival storage. Don't think you're going to put your family photos or favorite project on there and they'll be safe for years to come... Especially with the newer cheaper TLC parts, bit rot even while idle is becoming a real issue now measured in months instead of years. Now those 1k cycles they're talking about are for sectors, and your controller inside your drive will do some wear leveling to protect you but it won't perfectly rotate things around to evenly use all 32GB. \$\endgroup\$ – Some Hardware Guy Dec 2 '14 at 18:03
  • \$\begingroup\$ Here's an interesting project that's been running for a while where they've been beating on some SSD drives and looking at their failures: techreport.com/review/27062/… \$\endgroup\$ – Some Hardware Guy Dec 2 '14 at 18:04
  • \$\begingroup\$ I know, but since SSD's with SLC chips are still pretty expensive, and HDD's being a terrible way to store important data because of their usage of mechanical components, USB's seem to be the best choice at least for me. Anyways, regarding the P/E cycles, all I want to know is what will complete a full cycle? If I copy to that 32GB drive 1000 files worth 32GB, will that use a 1000 cycles or 1? By talking about the wear leveling, do you mean, that in theory 1 file would take 1 cycle, but the wear leveling protects me from such a quick loss? \$\endgroup\$ – user59528 Dec 2 '14 at 18:20
  • \$\begingroup\$ Wear leveling protects you against burning out a single sector. Let's say you had to write a 1K file 1000 times. You could write that file to the same location each time it was updated. In that case your 1000 cycles would be eaten up very quickly. Or you could choose to wear level it, and write the changed file to a different location each time. In your example you are writing 32GB 1000 times, that would be 1000 cycles. Btw you know things like amazon glacier are only $0.01 / GB / mo? :) \$\endgroup\$ – Some Hardware Guy Dec 2 '14 at 18:29
  • \$\begingroup\$ Ok, so this basically means that each sector has a 1000 cycles, and the wear leveling just distributes the files to different ones? Is there a way to tell how many sectors there are on a drive? If I delete the 1K file from the drive, that sector will lose one cycle? And finally one last question - if I copy multiple files to the drive worth 32GB do they get copied all to one sector, or each files get dispersed to many sectors? Regarding the online storage - I'm sure it's pretty reliable, but it's hard to trust people/companies. \$\endgroup\$ – user59528 Dec 2 '14 at 18:45
1
\$\begingroup\$

You are not the first to have this worry, so there has been a lot of work put into "wear levelling" (good search term) to ensure that your much abused 1KB file doesn't wear the drive out after only 1000 edits.

Indeed, in the extreme case that it's the only content of the drive, you could make 32 million edits to it and the wear levelling software would distribute it evenly across the drive, so those 32 million edits would count as one program/erase cycle.

There's a bit more to it, the directory information needs to go somewhere too, and a badly designed file system could overwrite and wear out the directory blocks sooner than this, but I think the filesystems are better designed than that.

If anyone knows specific defects or problems along these lines, such as a file system to avoid with flash drives, I'd be curious to hear about them too - but wear levelling to avoid the problem is the basic idea.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ IIRC, FAT16 (the most commonly used for most smaller flash drives, i.e. sub 4GB) has a terrible sectoring scheme for flash because it designates a fixed location for the file allocation table. I believe some smarter flash drivers are able to re-map physical sectors with virtual sectors, though, so this may not be a huge issue (It's been a while since I've played with this stuff). \$\endgroup\$ – helloworld922 Dec 2 '14 at 18:21
  • \$\begingroup\$ @helloworld922: Most flash devices have an erase-block size which is much larger than the page-program size; if a device didn't use remapping, then writing a single 512-byte logical sector would require reading 127.5K bytes, erasing 128K bytes, and then programming the 127.5K of old data and 512 bytes of new data. Not very practical. Any drive using high-capacity flash is going to use some sort of remapping scheme which will implicitly include some form of wear leveling. It's quite likely, however, that some drives' wear-leveling schemes are much better than others'. \$\endgroup\$ – supercat Dec 3 '14 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy