Choice of filesystem for GNU/Linux on an SD card
Excellent article about flash filesystems.
Important question when talking about flash filesystems is following: What is wear leveling? Wikipedia article. Basically, on flash disks you can write limited number of times until block goes bad. After that, filesystem (if there is no built-in wear leveling management on hardware, as in case of SSDs there usually is) must mark that block as invalid, and avoid using it anymore.
Typical filesystems (for example ReiserFS, NTFS, ext3 and so on) are designed for hard disks, that do not have such limitations.
JFFS2
Includes compression and elegant wear leveling protection.
YAFFS2
- Single thing that makes the difference: short mount times, after successful umount.
- Implements write once property: once data is written to one block, there is no need to rewrite it. This is important, as it reduces wear.
LogFS
- Not very mature, but already included in Linux kernel tree.
- Supports larger filesystems than JFFS2/YAFFS2 without problems.
UBIFS
- More mature than LogFS
- Write caching support
- On scalability: article. On large disks, better performance than with JFFS2
ext4
If no driver or card (for example SSD drives do have internal wear leveling, at least usually) handle wear leveling, then ext4 is not the best idea, as it is not intended for raw flash usage.
Which one is the best?
Of course, it depends on usage and support. From what I read on the Internet, I would recommend UBIFS. Good support for large filesystems, mature development phase, adequate performance and no huge downsides.
I was facing the same problem and did some research as well. Eventually I decided to go with ext2.
It seems that some SDHC cards implement their own wear-leveling at the hardware layer. If you can get hold of SDHC cards that have wear-leveling buit-in.
Filesystems that provide wear-leveling can interfere with the Flash-level wear-leveling so it can actually be bad for the flash to use them (the IBM article cited above talks about how JFFS does it, so it's clear that that won't work with flash-level WL). I decided I didn't need ext3's journaling since I'm not storing critical data on it and I usually backup regularly anyway (cron).
I also mounted /tmp and /var as tmpfs to speed things up. If you have enough RAM you should do that (but be sure to rotate or delete your logs regularly)
HINT: Mount your ext SD cards with the "noatime" option