The publication of this post marks the beginning of the “Explained.” This series will include many Tutorials/How-To Guides with the Android Community as the focus. Today, we aim to give one final verdict on the war between two completely different file systems, namely, f2fs and ext4.

An introduction

Originally developed by Samsung, F2FS (short for Flash-Friendly File System) has been around since 2012, initially merged in Linux Kernel version 3.8. Recently, OnePlus decided to include F2FS instead of EXT4 on the OnePlus 3T. An increasing number of people are already tagging F2FS as “the savior of reading and write speed.”

EXT4, the current “standard” filesystem for Android, isn’t as optimized for flash storage as F2FS is, which results in the slower read/write speeds. However, that does not necessarily mean it is worse, as it compensates for the lack of speed with a robust and reliable environment. Out of the two, EXT4 is more likely to endure crashes and sudden shutdowns.

The community is divided into three factions: the first, representing the people who back EXT4 because it works just fine. The second, representing the people who promise F2FS is the future. The third, well, the ones who are confused and clueless. For the people of the third faction, this publication will help you tons.

Compatibility

Compatibility is an issue every new iteration or introduction into the Android development scene has to face. As EXT4 has been the standard for such a long time now, almost all of the devices readily support it. F2FS, on the other hand, is currently limited to an increasing number of devices that “support” it.

Looking at the paragraph above makes me want to clarify the meaning of a “device” supporting a specified file system. We’re taking a “device” as the corporate representative of a supporting ROM, Kernel, and Recovery.

An In-depth look

This section is for the more technically inclined. Solid state drives, (the current technology used for storage on modern mobile devices, ) has a different geometry and structure compared to the hard disk drives because they are no moving parts.

As a result, it’s important to take these differences into account when working on things like I/O schedulers and file systems, which are directly interfacing with that hardware.

Some ways that F2FS does this over EXT4 are by structuring the file system in a log-based format (entries are written to the top of a queue and pushed down sequentially). The above results in lower overhead (this is part of the speed mentioned above) and auto trimming so that stale nodes are cleaned up and removed, allowing the log to stay clean.

The above also explains how F2FS can perform better in reading/write speeds as the geometry is consistent rather than changing due to moving parts.

One reason that EXT4 is seen as more stable than F2FS is the work being done to EXT4 is less intensive than F2FS. The changes to EXT4 are small or isolated and don’t change how the file system functions much at all. F2FS on the other hand often has large patches which add a major feature or change.

Who’s winning?

To help you choose which file system is better for you, I’ll lay off several known strong points for each of them.

F2FS is fast, and that’s all there is to it. It takes into account how flash storage works and has low overhead/latency, which makes the phone feel quicker. That’s the only major feature that will have a visible impact, everything else that is different is under the hood changes. On the other hand, EXT4 is selective, performing slow for some devices and fast for the others while remaining consistently stable. EXT4 is far more compatible than F2FS currently is.

If you’re looking for a file system that works just fine, EXT4 it is. However, if you prefer speed over stability and being cutting edge, F2FS it is.

The rage, the hype, and the battle. The topic we’re dealing with has been the “hot topic” of the community for a while now. After several comparisons and debates across the community, people seem to be craving for more, for yet another comparison between the two.

Oh, and we do have a winner here, and it’s none other than Android itself.


Some extra reading: f2fs wiki | f2fs documentation | ext4 wiki | ext4 documentation