Get free access to our online edition!

Tech Forum

December 2016

Hit By A Speeding Card

My Raspberry Pi Model III uses a microSD card. The cards are available in different “speeds.” Is there any significance to how “fast” a card I get?

Rick Holtz
Grand Rapids, MI


The answer isn’t really clear cut.

Class-10 SD cards are rated on the basis of streaming a single file to a clean (recently formatted) card. Essentially, what would happen with a video camera.
Class-2/4/6 SD cards are rated on multiple small files written to a fragmented card. Still image cameras where one has erased a few images.

One would hope that a Class-10 used for multiple small files would not be slower than a Class-6 card, but this is not always the case. Especially when used with a journaling file system — the ratings are based on FAT — where for single file writes one basically has the data file, and the File Allocation Table; journaling file systems, especially for something like EXT3 or EXT4 (common for Linux OS), will have things like the data file, inodes, journals, and bitmaps.

Flash memory needs to be erased to all “1” before it can be written — writes can only convert a “1” to a “0” but not the other way around. Erasure is done in large chunks. When doing small writes, the card allocates a cleaned chunk, then if needed, copies previously written data to that chunk before adding the new data.

Higher quality cards have the ability to “hold” multiple allocations “open” at the same time. These cards will function better on a journaling file system then a card that only holds two open allocations a time (which is all the Class-10 streaming model requires). Everytime a “2 allocation” card changes files, it has to close/flush any data changes to the card, then prepare a new “allocation” if changes are expected for the next file to be opened.

For FAT file systems, that means just closing the data chunk and opening another. For EXT3, that could mean closing a data chunk, opening an inode chunk and updating it, then closing it to open the next file chunk. Cards supporting 6 open allocations can minimize the number of times they have to perform the flush/close operation. They can flush a data chunk while still holding the inode/bitmap chunks active.

This may not be a concern if the device (RPI, Beaglebone Black) is used in an embedded mode, where the only data being written is a log file from some running application. But if the device is being used as an interactive computer, where one is compiling files, building applications, etc., a high end Class 6 card may be better suited than a low end Class 10, even if Class 10 implies nearly twice the transfer rate of Class 6. The RPI “NOOBS” OS starts out on a FAT system (it allows one to use native Windows to create a new card), but I believe the first step it performs is to repartition the card with an EXT3 file system, and copy the running OS into that partition. The Beaglebone Black OS images are currently EXT3 — and need special tools to create a card image.

Dennis Bieber
Kentwood, MI