Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:F2FS

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

Samsung's log-structured flash filesystem used on Android data partitions: the superblock sits at byte 1024 with magic 0xF2F52010 (bytes 10 20 F5 F2), is followed by checkpoint, SIT, NAT, SSA and main areas laid out by block addresses in the superblock.

Overview

F2FS divides the volume into segments, sections and zones and keeps metadata in fixed areas: checkpoint (two packs, F2FS_CP_PACKS = 2), Segment Information Table (SIT), Node Address Table (NAT), Segment Summary Area (SSA) and the main area holding nodes and data. Block size equals the page size in the kernel (4096 in practice). Android userdata is commonly F2FS; see Format:Android sparse image for expanding the image first, and compare Format:Ext2, ext3 and ext4.

Recognition

The superblock begins at byte 1024 (F2FS_SUPER_OFFSET) and its first field is the little-endian magic 0xF2F52010, so the bytes at file offset 0x400 are 10 20 F5 F2.

Superblock fields (struct f2fs_super_block, in order)

magic (u32), major and minor version (u16 each), log2 sector size, log2 sectors per block, log2 block size, log2 blocks per segment, segments per section, sections per zone, checksum offset (all u32), total user blocks (u64), section count, segment count, then segment counts for checkpoint, SIT, NAT, SSA and main area, segment0 block address, then block addresses of the checkpoint (cp_blkaddr), SIT, NAT, SSA and main area; later fields hold the volume name, an extension list (64 entries), quota inode numbers (3) and feature flags. Exact byte offsets beyond the first fields follow from the declaration order; they were not tabulated here.

Analyst notes

  • Directory entries use names up to 255 bytes (F2FS_NAME_LEN).
  • Unverified: encryption and compression feature bits and how inline data is stored were not read.

Sources

Linux include/linux/f2fs_fs.h at c03c1a14 (GPL-2.0).

Code & repositories

  • https://github.com/torvalds/linux @ c03c1a14507dfaf8b856c2608f9ac216021fc222 · license: GPL-2.0-only WITH Linux-syscall-note (declared by the contributor for the files used; GitHub reports GPL-2.0 WITH Linux-syscall-note (read from COPYING; GitHub's detector did not classify it) for the repository)
    Linux kernel; include/linux/f2fs_fs.h declares the F2FS on-disk structures.
    Tested on: source read, not run: source read only · checked 2026-10-19; last activity 2026-10-18