The Problem with Journaling File systems on an SD Card

From TheBeard Science Project Wiki
Jump to: navigation, search

The Ext4 file system is a journaling file system, which is a "file system that keeps track of changes not yet committed to the file system's main part by recording the intentions of such changes in a data structure known as a journal" [1].

Why is this a problem for an SD card? It greatly increases the number of writes to disk and will wear out the SD card much faster. This really sucks for the Raspberry Pi because the OS is meant to be installed on an SD card, and almost all Pi-based Linux distros come on Ext4.

So what should I do?

  1. Use an SD card that has wear-leveling such as a SanDisk Extreme Pro (not SanDisk Ultra).
  2. If you have a choice, use a non-journaling file system, such as Ext2.
  3. If your application calls for heavy disk writing, consider writing data to a hard drive or SSD.

Why do Raspberry Pi OS images come on Ext4 file systems?
Probably because a journaling file system is better able to handle an abrupt system halt, like unplugging the system. Raspberry Pi's are often used for applications that require that kind of flexibility. The thing doesn't even have a power button.