Goal: microSD card formatted...

  • for best write performance
  • for use only with embedded Linux
  • for better reliability (random power failures may occur)
  • using an 64kB cluster size

I'm using an 8GB microSD card for data storage inside an embedded Linux/ARM device. The SD card is not removable. I've been using ext3 instead of the pre-installed FAT32 because it seems to better handle random power failures during writes. However, I kept noticing that my write performance is always best with the pre-installed FAT32 from Kingston. If I reformat the card with FAT32, the performance still suffers. After browsing wikipedia, I stumbled upon the following comment saying that some cards are optimized for specific cluster sizes. In my case, the Kingston comes pre-formatted for an 64kB cluster size.

Risks of reformatting

Reformatting an SD card with a different file system, or even with the same one, may make the card slower, or shorten its lifespan. Some cards use wear leveling, in which frequently modified blocks are mapped to different portions of memory at different times, and some wear-leveling algorithms are designed for the access patterns typical of the file allocation table on a FAT16 or FAT32 device.[60] In addition, the preformatted file system may use a cluster size that matches the erase region of the physical memory on the card; reformatting may change the cluster size and make writes less efficient.

link|improve this question
If ext2 or ext3 allows setting cluster size (I don't know enough to know whether this is possible), this would be my suggestion. – Randolph West Jan 22 at 21:54
1  
@Randolph: It allows you to set a block size of 1, 2, or 4kB. I ended up just trying them all and 1kB is significantly faster than the others. – Harvey Jan 23 at 0:47
Please post your solution as an answer so that we can close the question. – Randolph West Jan 23 at 5:37
feedback

1 Answer

Most SD cards (as well as USB drives) out there are optimised for use with FAT32. Using them with any other FS will cause your performance to suffer.

More info at LWN.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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