Wear leveling in USB memory sticks (flash drives)?

F

Felix E. Klee

Hi,

does anyone know whether typical USB memory sticks use wear leveling
technology in order to distributes write accesses?

I'm particularly interested in information about the following device
(which I own in the 512MB variant):
http://www.twinmos.com/flash/flash_p_mobile_usb20.htm

Is it somehow possible to find out which firmware is running?

Felix
 
A

Arno Wagner

Previously Felix E. Klee said:
Hi,
does anyone know whether typical USB memory sticks use wear leveling
technology in order to distributes write accesses?
I'm particularly interested in information about the following device
(which I own in the 512MB variant):
http://www.twinmos.com/flash/flash_p_mobile_usb20.htm
Is it somehow possible to find out which firmware is running?
Felix

Personally I would assume that any vendor that does not list
this as a feature is not using it.

Arno
 
F

Felix E. Klee

Personally I would assume that any vendor that does not list
this as a feature is not using it.

Well, for example Kingston mentions in the overview document
http://www.kingston.com/products/DMTechGuide.pdf
that all their flash cards (this might include USB sticks) use wear
leveling. However, they do *not* mention wear leveling in the
data sheets of the individual cards that I've looked at, e.g. in
http://www.kingston.com/products/cf_white_paper.pdf

So maybe wear leveling is standard today and there's no need to
advertise with it anymore.

Felix
 
A

Arno Wagner

Previously Felix E. Klee said:
On 4 Oct 2003 12:46:30 GMT Arno Wagner wrote: [...]
Personally I would assume that any vendor that does not list
this as a feature is not using it.
Well, for example Kingston mentions in the overview document
http://www.kingston.com/products/DMTechGuide.pdf
that all their flash cards (this might include USB sticks) use wear
leveling. However, they do *not* mention wear leveling in the
data sheets of the individual cards that I've looked at, e.g. in
http://www.kingston.com/products/cf_white_paper.pdf
So maybe wear leveling is standard today and there's no need to
advertise with it anymore.

I honestly do not know. It could be a standard feature
in the controllers available. That is about the only way
el-cheapo manufacturers will have it.

Arno
 
A

Alexander Grigoriev

A flash disk just accepts whatever file system host OS puts onit (usually
FAT). Any change in the file structure (file creation, expansion, etc)
involves FAT update and may also cause boot record update. FAT always
occupies the same place. Data area blocks are updated much more seldom. I'm
not sure how to implement wear leveling with it and whether it's worth
bothering at all.
 
F

Felix E. Klee

A flash disk just accepts whatever file system host OS puts onit
(usually FAT). Any change in the file structure (file creation,
expansion, etc) involves FAT update and may also cause boot record
update. FAT always occupies the same place. Data area blocks are
updated much more seldom. I'm not sure how to implement wear leveling
with it and whether it's worth bothering at all.

I'm talking about wear leveling in the firmware of the device. AFAIK,
the file system can't do the wear leveling because the USB memory stick
emulates a conventional hard disk (on LINUX the device behaves like a
SCSI hard disk). I know that there are file systems that do wear
leveling (e.g. JFFS2), but those are supposed to be used with flash
memory interfaces that give direct access to the memory structure.

Felix
 
R

Rod Speed

You're confusing the drive choosing to put logical blocks in physical
ram to wear level with moving stuff around at the logical block level
in the OS file structure. There is no reason why say logical block
100 cant be moved around in the physical ram for wear levelling
with the OS level not even being aware that its ever happened,
because it just keeps dealing with logical block 100 regardless
of where the drive currently stores it.

Alexander Grigoriev said:
A flash disk just accepts whatever file system host OS puts onit (usually
FAT). Any change in the file structure (file creation, expansion, etc)
involves FAT update and may also cause boot record update. FAT always
occupies the same place. Data area blocks are updated much more seldom. I'm
not sure how to implement wear leveling with it and whether it's worth
bothering at all.
 
F

Felix E. Klee

I honestly do not know. It could be a standard feature
in the controllers available. That is about the only way
el-cheapo manufacturers will have it.

I just got the following answer from Kingston (as said before, I have a
TwinMOS memory stick, but I contacted Kingston because they seem to
have a good hotline):

yes, the Datraveler, like most of the USB flash devices uses wear
levveling technology.

I also contacted TwinMOS but didn't get a reply so far.

Felix
 
A

Arno Wagner

I'm talking about wear leveling in the firmware of the device. AFAIK,
the file system can't do the wear leveling because the USB memory stick
emulates a conventional hard disk (on LINUX the device behaves like a
SCSI hard disk). I know that there are file systems that do wear
leveling (e.g. JFFS2), but those are supposed to be used with flash
memory interfaces that give direct access to the memory structure.

That is correct. There is also no reason to do wear leveling
with most media. An old exception is tapes. However wear-leveling
here applies to sets of tapes, and reading wears them down just
as much as writing.

However HDDs use a contact-less access method and therefore
do not (or extremely little) care about number of
overwrites.

So the problem is not that the filesystem cannot do it,
the problem is that it is (or was) not needed for disk-type
storage and hence the filesystems do not provide for it.

With FLASH the problem is that the cells have relative low
overwite-tolerance (10,000-1,000,000 times per cell), and
conventional filesystems do a lot of updates in the
administrative areas of the filesystem.

.. High-quality flash disks also use ECC (error correction codes) and
automatic reallocation of defective sectors.

Arno
 
F

Felix E. Klee

So the problem is not that the filesystem cannot do it,
the problem is that it is (or was) not needed for disk-type
storage and hence the filesystems do not provide for it.

Just to make it clear: My point wasn't that most filesystems don't
provide wear leveling but that they can *not* do efficient wear leveling
if they don't know the physical layout of the flash memory in the USB
Stick.

With FLASH the problem is that the cells have relative low
overwite-tolerance (10,000-1,000,000 times per cell), and
conventional filesystems do a lot of updates in the
administrative areas of the filesystem.

Yes that's a problem, if wear leveling is not available. I'm currently
running LINUX with EXT2FS on my stick and I figured that it should last
at least a couple of months even in the case that it doesn't do wear
leveling. After all the write accesses are cached. So if I assume that
there isn't more than one write per minute and the stick runs 10 hours a
day then I can use it for at least 166 days.

Felix
 
F

Felix E. Klee

I also contacted TwinMOS but didn't get a reply so far.

OK, I got a reply (in German):

entschuldigen Sie die Verspätung.
Unsere Mobile Disk 2 USB 2.0 unterstützt die sogenannte "random
writing technology" um sicherzustellen, dass alle Blöcke
gleichgmäßig genutzt werden.

For English speakers: They say that the disk uses "random writing
technology" in order to ensure that the wear on all blocks is the same.

This sounds good to me.

Felix
 
F

Felix E. Klee

OK, I got a reply (in German):

.... and the English speaking support team (I send inquiries to two email
addresses and a web forum because it wasn't clear to me who is the best
to contact) replied the following:

All our Mobile Disk have "Wear Leveling"
technology to increase the lifetime of the devices !

So the technology indeed seems to be standard.

Now, I just wonder how it is usually implemented. One problem that I
see is that there must be some memory region on the stick that maps
logical blocks to hardware blocks. And this wears out as well! Can
someone point me to some documentation?

Felix
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top