You’ll find flash file systems used in personal digital assistants (PDAs), cellphones, MP3 players, digital cameras, USB flash drives (UFDs), and even laptop computers. This article looks at a couple of the read-only file systems and also reviews the various read/write file systems available today and how they work. Explore what the flash devices are all about and the challenges that they introduce.
It should be noted that file systems such as JFFS(2) and YAFFS are not appropriate for most flash memory available to consumers (USB sticks, SD, CF, MS, or SATA / IDE SSD). All of those have controllers that do wear leveling and sector translation, so the flash specific JFFS/YAFFS features are mostly useless.
These filesystems are meant to be used on flash devices where you can address the flash memory cells directly without controller translation, like in the built-in flash in embedded systems or phones/PDAs. AFAIK, the only removable flash standards which allows it are Smartmedia and xD cards.
I thought this quote was interesting:
“In addition to a maximum number of Erase cycles, certain flash devices suffer from a maximum number of Read cycles between Erase cycles. This means that if data sits for too long in a block and is read too many times, the data can dissipate and result in data loss. Static wear-leveling algorithms address this by periodically moving stale data to new blocks.”
That was totally new to me, but FYI: optical storage suffers from the same problem. Think of it like this: every read has (for a *tiny* part) a similar effect as erase.
Therefore you should distinguish between the media, and the recording. For instance for optical discs, I’ve read that recordings on CD-R are usually more durable than those on CD-RW. However, for the media itself, this is reversed. For example a recording on -R may last for five years, one on -RW only two years. After that period, you can throw the -R away, but the -RW can simply be erased & rewritten. So the -RW media may have a longer lifespan than -R media (note they use very different physical materials). Environmental factors (which includes reading) serve to speed up or slow down this process. I guess many of us remember this from the floppy disk age, where you’d have disks go bad after a couple of years, but after a reformat, ready for use again. Basically the medium needs to be ‘refreshed’ from time to time, like DRAM.
I can’t escape the feeling that much of this is not relevant for real-world use. With flash data storage, any modern OS has a disk cache. So if blocks get read repeatedly, any subsequent read comes from the cache, not from the physical medium. The more frequently it’s read, the higher the chance it’ll stay in the cache. This may not be true for an embedded system where code is executed directly from ROM (read: flash), but a CPU cache may have the same effect there.
Technology improvements make a lot of these things irrelevant anyway. For plain USB stick data storage, how many file operations can you do before hitting a limit of 1 million erase cycle on critical areas? (as long as you don’t use it as swap). A lot… That is, if the USB stick isn’t doing wear-leveling internally. This will only improve.
I usually format my Linux USB flash drives as FAT 32. I am always mounting them on Windows PCs at work. Once I tried EXT format with no journal and then installed Ext drivers for Windows XP. It worked okay but was a little flakey at times on Windows.
jffs, jffs2, yajffs, logfs, et. al. are only for situations where you have access to the raw flash memory. USB flash drives, SD, etc. have an abstraction layer that makes them look like regular ata drives to the OS. These file systems could not be put on those devices anyway.