ext4 vs F2FS on SBC Root Filesystems: Power-Loss Behaviour, Performance, and When to Switch

Filesystem comparison diagram showing ext4 and F2FS performance characteristics on SBC flash storage

How ext4 Journaling Works on Flash

ext4 writes metadata changes (and optionally data) to a journal before committing them to the main filesystem. This guarantees consistency after a crash — fsck replays the journal and the filesystem is clean within seconds.

The problem on flash media: every journal write is a random write to a fixed region of the storage. SD card controllers must erase a large block to update a small journal entry. This creates write amplification — the controller internally writes 10-100x more data than the OS requested.

Practical consequences:

How F2FS Log-Structured Writes Work

F2FS (Flash-Friendly File System) was designed by Samsung specifically for NAND flash storage. Instead of updating data in place, it writes to new locations sequentially — a log-structured approach that works with the flash hardware instead of against it.

Key differences from ext4:

The trade-off: F2FS is faster and gentler on flash for writes. ext4 is more battle-tested and has more predictable recovery behavior. Both are mature filesystems in 2026 kernels — the choice depends on your priorities.

Power-Loss Behaviour Comparison

This is the critical comparison for always-on SBCs that may lose power unexpectedly.

Aspect ext4 F2FS
Recovery mechanism Journal replay Checkpoint rollback
Recovery time Seconds (journal replay) Seconds (checkpoint scan)
Data loss window Last 5 seconds (default commit) Since last checkpoint (varies)
fsck required after crash Rarely (journal handles it) Rarely (checkpoint handles it)
Full fsck time (32 GB) 1-3 minutes 30-90 seconds
Risk of unrecoverable corruption Very low Low (improved significantly since 2020)
Behaviour on sudden power cut Replays journal, consistent metadata Rolls to checkpoint, may lose recent writes
Years of production use 15+ years 10+ years (Android default since 2016)
Warning: Both filesystems can lose data written after the last commit/checkpoint on sudden power loss. Neither filesystem guarantees zero data loss without an fsync() call from the application. If you're running a database on your SBC, use a UPS or accept the risk.

Performance on SD and eMMC

Tested on a Banana Pi Pro with Samsung PRO Endurance 32 GB SD card, kernel 6.6 LTS:

Benchmark ext4 F2FS Winner
Sequential write (4M blocks) 17 MB/s 18 MB/s Tie
Sequential read (4M blocks) 22 MB/s 22 MB/s Tie
Random 4K write (IOPS) ~800 ~1,800 F2FS (2.2x)
Random 4K read (IOPS) ~2,400 ~2,600 F2FS (slight)
File creation (10,000 small files) 45 seconds 22 seconds F2FS (2x)
apt install (50 packages) 4 min 20s 2 min 50s F2FS (1.5x)

The standout result: random 4K writes are 2x faster on F2FS. This is the I/O pattern that dominates system workloads — logging, package management, database writes. On SATA drives the difference narrows, but on SD cards and eMMC, F2FS has a meaningful advantage.

When ext4 Is the Safer Choice

Tip: If your root filesystem is on SATA (see the SATA root guide), the performance difference between ext4 and F2FS largely disappears. Stick with ext4 on SATA — you gain nothing from F2FS on rotating or SSD media, and ext4's tooling is more mature.

When F2FS Is the Faster Choice

Migration: ext4 to F2FS

Warning: There is no in-place conversion from ext4 to F2FS. You must copy data to a new partition. Back up everything first.

Prerequisites

Procedure

# 1. Back up the entire SD card
sudo dd if=/dev/mmcblk0 bs=4M status=progress | gzip > full-backup.img.gz

# 2. From another machine, mount the SD card
# Identify the root partition (usually partition 1)
lsblk /dev/sdX

# 3. Copy the root filesystem to a temporary location
sudo mkdir -p /mnt/old-root /mnt/new-root
sudo mount /dev/sdX1 /mnt/old-root
sudo rsync -axHAWXS --numeric-ids /mnt/old-root/ /tmp/rootfs-backup/
sudo umount /mnt/old-root

# 4. Format the root partition as F2FS
sudo mkfs.f2fs -l rootfs -O extra_attr,inode_checksum,sb_checksum /dev/sdX1

# 5. Mount and restore
sudo mount /dev/sdX1 /mnt/new-root
sudo rsync -axHAWXS --numeric-ids /tmp/rootfs-backup/ /mnt/new-root/

# 6. Update fstab on the new root
sudo nano /mnt/new-root/etc/fstab
# Change the root line:
# OLD: /dev/mmcblk0p1  /  ext4  defaults,noatime  0  1
# NEW: /dev/mmcblk0p1  /  f2fs  defaults,noatime  0  0

# 7. Update boot configuration
# For Armbian:
sudo nano /mnt/new-root/boot/armbianEnv.txt
# Add or change: rootfstype=f2fs

# For manual boot.cmd, change rootfstype=ext4 to rootfstype=f2fs
# Then recompile boot.scr

sudo umount /mnt/new-root

Kernel support check

Before migrating, confirm your kernel has F2FS compiled in (not just as a module that might not load during early boot):

# Check if F2FS is available
cat /proc/filesystems | grep f2fs
# Or check kernel config
zcat /proc/config.gz | grep CONFIG_F2FS
# Should show CONFIG_F2FS_FS=y (built-in) or =m (module)
Note: If F2FS is compiled as a module (=m), you need to ensure it's included in the initramfs. On Armbian this is handled automatically. On stock Debian, run update-initramfs -u after installing f2fs-tools. See the Debian 13 guide for initramfs details.

Verification Steps

# After booting on the F2FS root:

# 1. Confirm filesystem type
mount | grep "on / "
# Should show: /dev/mmcblk0p1 on / type f2fs

# 2. Check F2FS status
cat /sys/fs/f2fs/mmcblk0p1/segment_info 2>/dev/null | head -5

# 3. Run a quick write test
dd if=/dev/zero of=/tmp/test bs=4k count=10000 conv=fsync
rm /tmp/test

# 4. Check dmesg for F2FS messages
dmesg | grep -i f2fs
# Should show clean mount messages, no errors

# 5. Verify discard/TRIM support (if card supports it)
cat /sys/fs/f2fs/mmcblk0p1/discard_granularity 2>/dev/null

Rollback to ext4

If F2FS causes problems, restore your backup:

# Flash the backup image
gunzip -c full-backup.img.gz | sudo dd of=/dev/sdX bs=4M status=progress conv=fsync
sudo sync

The backup image contains the original ext4 partition and all boot configuration. One flash restores everything to the pre-migration state.

Tip: Run on F2FS for at least a week before deleting your ext4 backup image. Test through multiple reboots and at least one simulated power loss (pull the plug, then boot and check for corruption). If you're combining F2FS with SD wear reduction techniques, see the SD card endurance guide — log2ram and tmpfs are just as important on F2FS as on ext4.