Hubbry Logo
F2FSF2FSMain
Open search
F2FS
Community hub
F2FS
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
F2FS
F2FS
from Wikipedia
Not found
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
F2FS (Flash-Friendly File System) is a developed by for the , specifically optimized for NAND flash memory-based storage devices such as SSDs, eMMC, and SD cards. Introduced in Linux kernel version 3.8 on December 20, 2012, it addresses the unique characteristics of flash storage, including erase-before-write operations and limited write endurance, by using an append-only logging scheme to convert random writes into sequential ones. The design of F2FS draws from traditional log-structured file systems like LFS while mitigating their drawbacks, such as the "wandering tree" problem and high garbage collection overhead, through innovative features like a Node Address Table (NAT) for efficient index updates and multi-head to separate hot and cold data. Its on-disk layout divides the storage volume into fixed-size segments of 2 MB each, organized into sections and zones that align with the operational units of underlying flash layers (FTLs), enabling better and reduced . F2FS supports adaptive modes—switching between normal and threaded based on storage utilization—to maintain high even as the file system fills up, and it incorporates background cleaning algorithms with greedy or cost-benefit victim selection for efficient garbage collection. In terms of performance, F2FS has demonstrated significant advantages over file systems like on flash storage: on mobile devices, it achieves up to 3.1× faster throughput in benchmarks like IOzone and 2× in workloads, while on server-grade SSDs, it delivers up to 2.5× improvement in random write scenarios. Additional optimizations include fsync acceleration via roll-forward recovery and support for zoned storage, making it suitable for a range of applications from embedded systems to centers. Developed by a team at Samsung's Memory Business unit, including lead author Jaegeuk Kim, F2FS was first presented at the 13th on File and Storage Technologies (FAST '15) in 2015, where its architecture and empirical results were detailed. Tools for creating, checking, and debugging F2FS volumes are maintained in the official kernel repository, ensuring ongoing integration and evolution within the ecosystem.

History

Development and Initial Release

F2FS, or Flash-Friendly File System, was initiated by in 2012 to overcome the inefficiencies of traditional block-based s when used on NAND flash storage devices. Traditional systems like , designed for rotating magnetic media, struggle with flash memory's erase-before-write mechanism and the need for , leading to increased and reduced lifespan. Samsung's development effort focused on creating a that aligns with flash characteristics, such as sequential writes and out-of-place updates, to minimize garbage collection overhead and enhance performance on devices like SSDs, eMMC, and SD cards. The primary development was led by Jaegeuk Kim, a engineer, who submitted the initial patch series to the on October 5, 2012. Kim's team at addressed known limitations in earlier log-structured file systems, including the snowball effect of the wandering tree problem and excessive cleaning costs, by introducing configurable on-disk layouts and adaptive allocation strategies. Early prototypes were tested internally on 's NAND flash-based devices to validate optimizations for real-world mobile and embedded storage scenarios. F2FS was merged into the mainline on December 20, 2012, via commit a13eea6bd9ee62ceacfc5243d54c84396bc86cb4, marking its official integration as part of the 3.8 release cycle. The full version 3.8, including F2FS support, was released on February 18, 2013. This initial release introduced core features like checkpointing for crash recovery and support for extended attributes, establishing F2FS as an open-source alternative tailored for flash-centric workloads.

Subsequent Enhancements

Following its initial integration into the Linux kernel in version 3.8, F2FS received inline data support in Linux 3.14, allowing small files to be stored directly within inode blocks to reduce metadata overhead and improve access times for tiny files. This enhancement was part of broader refactoring efforts to optimize bio operations and inline features. In Linux 4.2, F2FS added native file-based encryption support via the fscrypt framework, enabling per-directory encryption keys for secure storage on flash devices while maintaining compatibility with Android's requirements. This feature addressed growing needs for data protection in mobile environments without significant performance penalties. Transparent compression capabilities were introduced in Linux 5.6 with support for LZO and LZ4 algorithms, allowing optional on-the-fly compression to enhance storage efficiency on NAND flash. Zstd compression was added shortly after in Linux 5.7, providing higher compression ratios for better space savings in resource-constrained systems. Linux 6.7 brought support for 16K block sizes, aligning F2FS with larger page sizes common in modern ARM-based mobile SoCs and enabling improved I/O throughput. Concurrently, the maximum for 16K-block configurations was adjusted to 16 TB to accommodate crypto data unit compatibility and prevent overflows in addressing schemes. The 6.18 kernel series also includes performance refinements, such as optimizations for journaling through tunable checkpoint modes and controls to reduce latency during metadata updates. These updates also improve fragmentation handling via node block prefetching, efficient FUA write merging, and prioritized block allocation for hot data, yielding measurable gains in write-heavy workloads. Throughout its evolution, F2FS has benefited from contributions by companies like , , and , focusing on mobile-specific tweaks such as quota support and block size adaptations for Android devices.

Design Principles

Log-Structured Approach

F2FS adopts a (LFS) paradigm, designed specifically for NAND flash storage, where new data versions are appended sequentially to logs rather than performing in-place updates. This approach minimizes the number of erase operations on flash blocks, which are constrained by NAND flash's requirement to erase entire blocks before rewriting. By treating the storage as an append-only log, F2FS avoids the inefficiencies of random writes that would otherwise lead to fragmented updates and increased wear on the medium. To enhance efficiency, F2FS separates metadata, referred to as nodes, and user into distinct log streams. Metadata updates are written to node logs, while is directed to separate data logs, allowing for independent management and reducing contention during writes. This separation enables optimized handling of different access patterns, with operations converting potential random I/O into sequential writes, which align well with the strengths of NAND flash for high-throughput . F2FS employs adaptive logging modes, switching dynamically between normal logging (copy-and-compaction scheme) when the filesystem is clean and threaded logging (writing to dirty segments without foreground ) as utilization increases, to maintain and minimize garbage collection overhead. File system updates in F2FS are managed through a versioning mechanism, where modifications create new log entries, and previous versions are marked as invalid without immediate erasure. Invalidated blocks accumulate until garbage collection reclaims space, ensuring that the system maintains a clean log structure over time. This contrasts with traditional LFS implementations, which often suffer from due to excessive copying during log . F2FS mitigates this issue through multi-head , which divides logs into hot, warm, and categories based on access frequency, thereby isolating frequently updated data to reduce unnecessary overwrites and garbage collection overhead.

Flash-Specific Optimizations

F2FS incorporates optimizations specifically tailored to NAND flash memory's inherent constraints, including limited program/erase (P/E) cycles, the requirement for erase-before-write operations, and the inefficiency of in-place updates. These adaptations prioritize by minimizing and leveraging hardware-level features like the Flash Translation Layer (FTL), while enhancing performance for flash-based workloads such as those in mobile and embedded devices. A core optimization is the hot/cold data classification, which separates frequently accessed "hot" data from archival "cold" data to distribute wear more evenly and reduce erase cycles on high-activity areas. F2FS achieves this through multi-head logging with up to six distinct logs (configurable to 2, 4, or 6), categorizing node and blocks as hot, warm, or based on access patterns and file types—for instance, directory entries and small inline as hot, regular file as warm, and or migrated blocks as . This proactive separation aligns writes with flash's sequential preferences, mitigating the "wandering tree" problem in log-structured systems and improving overall lifespan without relying on FTL alone. To integrate effectively with the device's FTL, F2FS avoids implementing its own wear-leveling algorithms, instead mapping active logs across different zones that match the FTL's set-associative or fully-associative granularity. This design reduces filesystem-induced garbage collection overhead by distributing updates and allowing the hardware FTL to handle block remapping and leveling transparently, which is particularly beneficial for consumer-grade flash like eMMC and UFS. Out-of-place updates form another fundamental adaptation, where all modifications are appended sequentially to new log segments rather than overwriting existing blocks, thereby preventing and aligning with NAND flash's out-of-place write semantics. Old data versions are invalidated via structures like the Node Address Table (NAT), enabling efficient later reclamation during without immediate erases. Building on its log-structured appending, this approach converts random writes into sequential ones, further optimizing flash . F2FS supports multi-device configurations for flash arrays, enabling a single filesystem to span multiple block devices through linear of address spaces without striping or built-in . This feature, introduced in 4.10, facilitates larger storage pools on multi-flash setups like SSD arrays, with segment allocation adjusted per device to maintain flash alignment. For small-block writes prevalent in mobile workloads, F2FS optimizes via inline and dentry storage within inode blocks for files smaller than 3,692 bytes (approximately 3.6 KB), eliminating separate block allocations and reducing metadata overhead. Additionally, roll-forward recovery during fsync operations writes only affected and direct node blocks, minimizing latency and amplification for frequent small synchronous updates common in journaling scenarios. These mechanisms ensure efficient handling of flash's page-level programming while preserving atomicity.

On-Disk Format

Volume Segmentation

F2FS organizes the storage volume into fixed-size segments to facilitate efficient management tailored to characteristics. Each segment is 2 MB in size, comprising 512 blocks of the default 4 KB block size, serving as the fundamental unit for allocation, garbage collection, and . These segments are grouped into sections (typically one segment per section by default) and zones (groups of sections), enabling structured handling of metadata and across the volume. This segmentation supports the log-structured design by allowing sequential writes within segments, minimizing random access patterns that could degrade flash performance. The volume is partitioned into distinct areas starting from the beginning of the device. The superblock area, located at the partition's start with two redundant copies for , stores essential filesystem parameters such as version information, block size, segment count, and configuration options like zone sizes. Following the superblock is the checkpoint area, which contains checkpoint blocks (CP blocks) that record the filesystem's state for crash recovery, including references to valid metadata bitmaps and summaries. The summary areas encompass the Segment Information Table (SIT), which tracks the valid block count and dirty status bitmap for each segment; the Node Address Table (NAT), which maps node IDs to physical block addresses for all node blocks in the main area; and the Segment Summary Area (SSA), which provides ownership information for data and node blocks within segments to aid in recovery and allocation. The bulk of the volume constitutes the main area, dedicated to storing actual file data and metadata, and is subdivided into hot, warm, and cold zones to optimize and load distribution. Data segments in the main area hold file contents, while node segments store metadata such as inodes and directory entries; these are allocated preferentially in specific zones based on access patterns to balance wear across flash blocks. The hot zone prioritizes frequently accessed items like directory entries and direct node blocks, the warm zone handles moderately accessed data and indirect nodes, and the cold zone manages infrequently updated or archived data such as files, ensuring that hot data remains isolated from colder segments to reduce garbage collection overhead. This zoning aligns allocations with the flash translation layer's , promoting even utilization of underlying storage. F2FS supports maximum volume sizes of 16 TB when using the default 4 KB block size, limited by 32-bit block addressing (2^32 blocks × 4 KB). Following enhancements in Linux kernel 6.7 for larger page sizes, F2FS accommodates 16 KB block sizes, extending the maximum volume capacity to 64 TB (2^32 blocks × 16 KB).

Checkpoint and Metadata Areas

F2FS employs a checkpointing mechanism to ensure filesystem consistency, particularly in the face of sudden power losses common in mobile devices. This involves creating periodic snapshots of the filesystem state, which serve as recovery points without requiring full filesystem synchronization operations. The checkpoints utilize shadow paging, where updates are written to new locations while preserving the previous checkpoint as a fallback, enabling quick recovery by simply rolling back to the last valid checkpoint during mount. For , F2FS maintains dual checkpoint packs, labeled CP #0 and CP #1, stored in the checkpoint area. Each pack contains critical information including references to the inode, valid NAT/SIT bitmaps, segment summaries that outline block usage per segment, and journal logs recording recent modifications such as inode changes and directory entries. At mount time, the filesystem scans the checkpoint area to identify and load the most recent valid pack, ensuring atomic updates and minimizing recovery overhead. Supporting the checkpoint process are dedicated metadata structures that track filesystem state efficiently. The Segment Information Table (SIT) resides in the SIT area and uses bitmaps to record the number of valid and invalid blocks within each 2 MB segment, facilitating informed decisions during garbage collection by identifying segments for cleaning. The Node Address Table (NAT), located in the NAT area, maps logical inode numbers to their physical node block addresses in the main area, enabling rapid location of file metadata. Complementing these, the Summary Structure Area (SSA) provides per-block summary entries detailing ownership information for data and node blocks within segments, such as the parent inode number and offset.

Core Data Structures

Node and Index Structures

F2FS utilizes a pointer-based hierarchical node system to index file blocks and metadata, mitigating update issues common in traditional file systems by isolating node updates. This structure draws from log-structured principles but incorporates multi-level optimized for flash storage, where nodes are stored in dedicated segments of the main area. The core of this system is the inode, a fixed-size 4 KB block that stores such as permissions, timestamps, , and size, alongside indexing pointers. Each inode includes up to 923 direct pointers to blocks, two pointers to direct node blocks, two pointers to indirect node blocks, and one pointer to a double indirect node block, enabling efficient access to file contents without excessive for small to medium files. For small files under approximately 3.5 KB, F2FS supports inline storage directly within the inode block via the inline_data mount option, which embeds the file contents to minimize block allocations and I/O operations. Node blocks fall into three primary types: inodes, direct nodes, and indirect nodes, each designed to chain hierarchically for . A direct node block points to up to 1018 data blocks, providing immediate access for files that fit within this limit. Indirect nodes extend this by pointing to up to 1018 additional node blocks (direct or further indirect), while a double indirect node points to 1018 indirect nodes, allowing the system to address vast file sizes—up to 3.94 TB for 4 KB block sizes or 16 TB for 16 KB block sizes—through this multi-level indirection scheme, akin to traditional Unix file systems but with log-optimized updates to reduce on flash. Node addressing relies on the Node Address Table (NAT), a bitmap-based structure in the metadata area that maps logical node identifiers to physical block addresses in the main area, ensuring quick lookups without traversing the entire hierarchy. To maintain consistency during log-structured writes, NAT entries include version numbers that are updated only at checkpoints, preventing stale references and enabling atomic metadata operations. Directory entries reference these inodes by ID to link filenames to file metadata and .

Directory Organization

F2FS organizes directories through hash-based entries stored in specialized dentry blocks, which are pointed to by the directory's inode. These blocks contain filename hashes, corresponding inode numbers, and the full names, enabling quick mapping from names to file metadata. Each 4 KB dentry block includes a 27-byte to track valid entries, followed by an of up to 214 dentry slots (each 11 bytes, holding a 32-bit hash, inode number, name length, and type) and space for filename entries (1712 bytes total, with individual filenames limited to 255 bytes). This structure supports efficient storage and retrieval in flash-optimized environments. To handle large directories, F2FS implements multi-level hash tables divided into . A filename's hash value identifies the starting , after which the system incrementally scans a fixed number of dentry blocks per level—typically 2 blocks at level 0 and 4 blocks at higher levels—until the target entry is located or the maximum level (configurable up to 6) is exhausted. This hashing mechanism delivers an average lookup performance of O(1)O(1), as most operations resolve within the initial scan, with a fallback to linear scanning of the block if collisions occur. In the worst case, especially for directories containing millions of entries, the multi-level traversal results in O(logN)O(\log N) complexity, where NN is the total number of entries, ensuring without excessive overhead. The lookup behavior can be tuned via the lookup_mode mount option (e.g., perf for performance-optimized hashing or compat for compatibility with linear scans). Since 5.3, F2FS has supported case-insensitive name handling through the casefold feature, which normalizes filenames using casefolding for lookups while preserving the original case on disk; this is enabled during filesystem creation with the -O casefold option in mkfs.f2fs and controlled at mount time. Hard links and deletions in directories are managed via reference counts stored in the target inodes. Creating a increments the inode's reference count and adds a new dentry entry, while deletion invalidates the entry by clearing the bitmap bit in the dentry block and decrementing the count; the inode and its data are reclaimed only when the count reaches zero during garbage collection. This approach maintains consistency without immediate space reclamation, aligning with F2FS's log-structured design.

Allocation and Maintenance

Block Allocation Strategies

F2FS implements block allocation through a multi-log that separates into hot, warm, and cold categories to optimize flash storage performance by minimizing and fragmentation. This separation is managed via six active log areas in the main storage region: hot, warm, and cold logs for both node blocks (metadata) and blocks. Hot typically includes directory entries and small or frequently accessed files, warm covers general file content, and cold encompasses less frequently modified blocks such as files or those migrated during . By default, new or small files are allocated to the hot data log to prioritize quick access and reduce initial fragmentation. As files age or their access frequency decreases—determined by last modification time and usage patterns—subsequent writes shift to warm or logs, ensuring hotter data remains in faster-accessible areas while colder data is isolated to reduce unnecessary overwrites. Allocation occurs through dedicated cursors for each log type, such as CURSEG_HOT_DATA, CURSEG_WARM_DATA, CURSEG_COLD_DATA, CURSEG_HOT_NODE, CURSEG_WARM_NODE, and CURSEG_COLD_NODE, which track the current segment for writes and advance sequentially within section-aligned boundaries (default 2 MB segments). To select victim segments for new writes, F2FS uses a cost-based that evaluates segment utilization and age, favoring underutilized areas to provide efficiently without excessive cleaning overhead. This approach integrates with the file system's segment zoning layout, where logs are confined to specific zones for parallelism. For compressed or encrypted files, F2FS prefers inline allocation when data fits within the inode block (up to approximately 3.4 KB), storing compressed clusters directly to avoid extra block overhead. Larger or extent-based files leverage an extent cache—a red-black —to map contiguous logical blocks to physical ones, enabling efficient allocation of sequential clusters (default minimum 16 KB) and reducing fragmentation in workloads involving compression algorithms like LZ4 or . The extent cache can be enhanced with the age_extent_cache mount option, which tracks the update frequency of extents to provide better allocation hints based on access patterns. Adaptive strategies further enhance allocation for sequential workloads: the default "adaptive" mode switches between normal (for random writes) and LFS-style threaded (for sequential patterns) at high filesystem utilization levels, such as when overprovisioned space becomes limited, promoting contiguous block assignment to minimize fragmentation. Experimental modes like "fragment:segment" or "fragment:block" allow controlled scattering of allocations for testing, but production use relies on the extent cache and log separation for robustness.

Garbage Collection Process

F2FS employs garbage collection (GC) to reclaim invalid blocks in its log-structured layout, ensuring sufficient free space for ongoing writes while minimizing on flash storage. The process identifies segments with invalid data, migrates any valid blocks to new locations, and erases the victim segments to make them available again. This is crucial for maintaining performance, as flash devices cannot overwrite blocks in place and require erasure at the segment level before reuse. Background GC operates periodically through a kernel thread when the system is idle, proactively cleaning segments to prevent space exhaustion. It selects victim segments using a cost-benefit that evaluates both the number of valid blocks (utilization) and the segment's age, derived from the last modification time in the Segment Information Table (SIT), to balance efficiency and avoid excessive thrashing. An alternative age-threshold GC (ATGC) , available via mount option, uses age thresholds for victim selection in background operations, particularly beneficial for workloads with aged data patterns. This approach prioritizes reclaiming segments with high invalid block ratios while considering the cost of migration, such as the effort to relocate older, potentially colder data. In contrast, foreground (on-demand) GC triggers synchronously when free segments fall below a threshold—typically when insufficient space is available for a VFS operation—potentially blocking I/O until completion. It employs a simpler greedy , selecting the segment with the fewest valid blocks to minimize latency during urgent reclamation. Victim selection emphasizes cold segments to preserve hot data integrity and reduce unnecessary migrations. The SIT maintains per-segment validity bitmaps and counts, enabling quick identification of invalid blocks without scanning the entire filesystem. During GC, the Segment Summary Area (SSA) provides block ownership details, facilitating the retrieval of parent node structures for valid data migration. Valid blocks are lazily moved to the page cache and then written to free logs, after which the victim segment is invalidated and queued for erasure post-checkpoint. This process integrates hot/cold data classification by directing colder data toward segments easier to reclaim. Multi-head logging supports even distribution of writes across hot, warm, and cold zones, reducing localized wear and aiding GC by isolating data lifetimes. F2FS maintains up to six active logs (separate for nodes and data, categorized by temperature), which helps in selecting victims from colder logs during background operations. When free space drops critically low (e.g., below 5% of total segments), the system switches to threaded to trigger more aggressive cleaning. Tuning parameters like the overprovisioning ratio—defaulting to 5% of device capacity—reserve hidden space to buffer against fragmentation and delay GC invocations, enhancing overall efficiency. This ratio can be adjusted during formatting (e.g., via mkfs.f2fs), with values around 4-7% commonly used to optimize for different workloads, allowing more headroom for invalidation before reclamation is needed. Mount options such as background_gc=on (default) enable periodic cleaning, while gc_merge integrates foreground requests into background processes for better throughput.

Key Features

Compression and Encryption

F2FS supports transparent compression to reduce storage usage on flash devices, allowing files to be compressed on write and decompressed on read without user intervention. Compression can be enabled on a per-inode or per-directory basis using the chattr +c command, with support for algorithms including LZO for fast compression, LZ4 for a balance of speed and ratio, and for higher compression ratios. In the default "fs" mode, F2FS automatically compresses eligible data during writeback, while "user" mode permits manual control via ioctls such as F2FS_IOC_COMPRESS_FILE and F2FS_IOC_DECOMPRESS_FILE. Compression is limited to write-once files to avoid , with data compressed only if the ratio meets a configurable threshold. The compression implementation organizes data into clusters, typically starting at 16 KB (configurable via compress_log_size), where each cluster maps to one or more physical blocks depending on the compression efficiency. Compressed clusters are stored as extents in metadata, including details like the compression flag, data length, checksum for verification (if enabled via compress_chksum), and the compressed payload itself; small extents may be stored inline to minimize overhead. This approach reduces the physical footprint on NAND flash, extending device lifespan by lowering write volumes, though it introduces CPU overhead during compression and decompression operations. Mount options like compress_algorithm=lz4 or compress_extension=ext allow fine-tuning, and unused compressed space can be released explicitly with F2FS_IOC_RELEASE_COMPRESS_BLOCKS to reclaim storage. F2FS integrates with the kernel's fscrypt framework for , providing transparent protection for file contents and filenames using per-file keys derived from a master key via a . The primary is AES-256-XTS for file data encryption, with AES-256-CBC-CTS or AES-256-HCTR2 for filenames to handle variable lengths up to the NAME_MAX of 255 bytes; is also supported as a lightweight alternative for hardware without AES acceleration. Encryption support was added in 4.2, enabling per-directory policies that apply to all descendants while maintaining compliance through full filename length preservation and no stacking layers. Inline is available via the blk-crypto framework when mounted with the inlinecrypt option, offloading operations to compatible storage hardware for reduced CPU load, though this remains optional and depends on device capabilities. Encrypted files in F2FS store keys in inode extended attributes, ensuring secure, efficient access without penalties from user-space tools, while supporting features like case-insensitive lookups when combined with other policies. This integration prioritizes for mobile and embedded environments where F2FS is common, without compromising the filesystem's log-structured design.

Additional Capabilities

F2FS includes support for project quotas, introduced in Linux kernel version 4.14, which enable disk usage limits for specific s or user groups to manage efficiently. The prjquota mount option activates plain project disk quota accounting, allowing administrators to enforce limits without affecting standard user or group quotas. Since version 5.4, F2FS has integrated FS-verity, a framework for transparent and authenticity of read-only files, enabling verification of file contents against tampering through Merkle tree-based signatures. This feature requires the filesystem to be formatted with the verity option using f2fs-tools version 1.11.0 or later, and it performs on-demand cryptographic checks during reads to ensure . F2FS provides casefold support starting from Linux kernel version 5.2, facilitating case-insensitive filename handling on otherwise case-sensitive filesystems, particularly useful for compatibility with applications expecting such behavior. The feature is enabled via the casefold option during mkfs.f2fs formatting and relies on normalization for consistent lookups, with mount options like lookup_mode controlling performance modes such as perf or compat. Nanosecond timestamps have been available in F2FS since its introduction in version 3.8, providing high-precision recording of file access, modification, and change times in inode metadata to support applications requiring fine-grained . For crash-safe operations, F2FS implements atomic writes, allowing applications to perform failure-atomic updates to files via ioctls, ensuring that either all changes commit or none do in the event of a power loss. Complementing this, ORPHAN inode handling maintains lists of inodes with open but unlinked files in the checkpoint area, enabling recovery and cleanup during mount to prevent data leaks from incomplete operations. Multi-device support was added in version 4.10, permitting a single F2FS instance to span multiple block devices for enhanced scalability and capacity without relying on external volume managers. Additionally, online resize functionality, available since version 4.14, allows dynamic expansion or shrinking of the filesystem while mounted, using the resize.f2fs tool to adjust segment allocations and metadata structures seamlessly. F2FS also supports standard ACLs and extended attributes (xattrs) by default when the relevant kernel configurations are enabled, providing fine-grained and custom metadata storage.

Adoption

Mobile and Embedded Devices

F2FS gained initial traction in mobile and embedded devices through early adoption by key manufacturers optimizing for flash storage. implemented F2FS in its smartphones starting with the second-generation Moto G in 2015 for the userdata partition, leveraging the file system's log-structured design to enhance performance on NAND flash. , as the original developer of F2FS, integrated it into select devices starting in the mid-2010s, with explicit use confirmed in flagships such as the Galaxy Note 10 in 2019 and subsequent models, where it paired with UFS storage to reduce and improve I/O efficiency. Google adopted F2FS for its tablet in 2014, marking an early endorsement for /data partitions in stock Android hardware. This was followed by the in 2018, where F2FS replaced to capitalize on flash-optimized features like inline data and reduced fragmentation, contributing to faster app loading and system responsiveness. By , F2FS became a recommended option in AOSP for the /data partition, supporting file-based and aligning with the shift toward UFS and eMMC storage in mid-range and flagship devices. Other vendors followed suit, including with the 3T in 2016 for improved sequential read/write speeds, and in the 10 Pro in 2019 as the first device to pair F2FS with SanDisk's iNAND flash for anti-fragmentation benefits. Integration into the Android Project has driven widespread use of F2FS for user data partitions in many and mid-range Android devices with eMMC or UFS storage by 2025, particularly where its log-structured approach minimizes wear and boosts endurance. As of 2025, F2FS is used in a significant portion of Android devices, estimated to cover hundreds of millions of units annually, according to vendor reports. incorporated F2FS starting with the P9 in 2016 to optimize flash I/O patterns. This preference stems from F2FS's ability to handle out-of-place updates efficiently, reducing latency in scenarios common in mobile workloads. F2FS continues to be used in recent and s, enabling superior performance on high-speed UFS storage.

Linux Kernel and Distributions

F2FS was merged into the mainline with version 3.8, released in December 2012, enabling native support for the on compatible hardware. The accompanying user-space tools, including mkfs.f2fs for formatting and .f2fs for consistency checks, are provided by the f2fs-tools package, with initial releases dating back to around 2013. Major distributions offer varying levels of F2FS integration. provides full support through its kernel and f2fs-tools packages, allowing straightforward installation and use for root or data partitions. has included F2FS kernel support since version 8.0 (Jessie) in 2014, with f2fs-tools available in its repositories, though the installer lacks native F2FS partitioning options. Gentoo supports F2FS via kernel configuration and the sys-fs/f2fs-tools ebuild, enabling custom builds for flash-optimized setups. includes F2FS in its kernel and offers f2fs-tools via DNF, though the graphical installer requires terminal commands for creating F2FS partitions. In , F2FS is supported experimentally through manual configuration, as the installer does not natively handle it, requiring post-installation adjustments for root filesystems. On desktop and server systems, F2FS adoption has grown steadily for SSD and NVMe drives due to its optimizations for flash and performance, though and remain dominant for general-purpose use. It is particularly recommended for environments with heavy flash storage workloads, such as high-write databases or virtual machines on NVMe arrays, where its log-structured reduces latency. Recent kernel updates have further enhanced F2FS suitability for modern hardware. Linux 6.18, released in late 2025, introduced improvements including optimized lookup modes, node block readahead, and better inline data handling, benefiting NVMe deployments by reducing overhead in flash-intensive operations. Adoption has extended to embedded variants, such as user-modified images converted via scripts to leverage F2FS for extended SD card lifespan. F2FS configuration in environments relies on mount options to tailor behavior to hardware. The "discard" option enables TRIM commands for efficient garbage collection on SSDs and NVMe drives, issuing discards asynchronously during segment cleaning to maintain without manual intervention. For compression, the "compress_algorithm=" mount option activates transparent zstd-based file compression, configurable with levels for balancing speed and ratio in space-constrained setups.

Performance

Benchmarks and Comparisons

F2FS demonstrates superior random write performance on flash storage compared to , particularly in synthetic workloads. In IOzone tests on a mobile system, F2FS achieved up to 3.1 times higher bandwidth for 4KB random writes by converting them into sequential writes through its log-structured design. On server systems with SSDs, F2FS outperformed by 2.5 times in the varmail benchmark, which involves small file operations with frequent fsync calls. Recent benchmarks on NVMe drives highlight F2FS's strengths in mobile and database workloads. Phoronix tests using 6.11 showed F2FS delivering the fastest results in database operations, making it suitable for small-file database tasks. In Android environments, F2FS reduced application launch times by 20% for the app and 40% for the app compared to , attributed to efficient handling of flash I/O patterns. Post-2023 enhancements, including 16K block size support in 6.7, further improved performance on modern devices with larger page sizes, enabling better alignment with hardware capabilities. Comparisons with other file systems underscore F2FS's optimizations for NAND flash. F2FS exhibits better than on NAND storage due to its low factor (around 1.02 at high utilization), reducing unnecessary erases and extending device lifespan. F2FS's simpler log-structured approach avoids the heavier metadata management of Btrfs's mechanism. In 2024 NVMe benchmarks on 6.10 and later, F2FS achieved performance parity with for sequential reads on PCIe SSDs, though edged ahead by about 20% in some high-throughput scenarios. F2FS excels in workloads involving small-file writes, such as database operations, where its adaptive combines small updates efficiently. However, foreground garbage collection can introduce higher latency in write-intensive scenarios, as the greedy prioritizes minimizing visible delays but may still impact latencies by up to several milliseconds under heavy load. In September 2025 benchmarks on 6.17, F2FS was among the fastest file systems for 4K random reads alongside and on NVMe SSDs.
BenchmarkWorkloadF2FS vs. EXT4Source
IOzone4KB Random Writes (Mobile)3.1× fasterFAST'15 Paper
VarmailSmall Files with fsync (SATA SSD)2.5× fasterFAST'15 Paper
Concurrent Database Writes (NVMe, Linux 6.11)Fastest among tested file systemsPhoronix
App LaunchFacebook/ (Android)20-40% fasterFAST'15 Paper

Limitations and Improvements

Despite its optimizations for flash storage, F2FS exhibits fragmentation issues in long-running mobile devices, primarily due to out-of-place updates that scatter file extents over time, leading to increased read amplification and performance degradation. This critical fragmentation is particularly pronounced in consumer scenarios with frequent small writes, such as app updates and media caching. Research in 2024 proposed a controller co-design approach to mitigate this by coordinating host and storage-level operations for proactive extent coalescing, reducing fragmentation by up to 70% in emulated mobile workloads. F2FS sees limited adoption on desktops compared to , owing to perceptions of lower maturity in handling diverse workloads and potential data integrity risks under heavy use. Unlike filesystems such as , F2FS lacks native support for 5 or 6 configurations, relying instead on underlying software like , which complicates setup for parity-based arrays. In scenarios involving sudden power failures, F2FS's checkpointing mechanism can result in slower recovery times than traditional journaling filesystems like , as it may require replaying extensive log segments to achieve consistency, potentially leading to partial data loss if operations fail. Known bugs in earlier versions include occasional garbage collection (GC) stalls during high-load scenarios, where background cleaning operations block foreground I/O, causing latency spikes; these were addressed through performance optimizations in 6.18 and later. Recent improvements include the introduction of decentralized, epoch-based journaling in F2FS, presented at OSDI 2025, which enables finer-grained consistency guarantees by distributing journal entries across segments, reducing recovery overhead by 40-60% compared to prior checkpointing. Additionally, deduplication extensions via F2DFS, detailed in a 2024 ACM Transactions on Storage paper, integrate hybrid inline and offline deduplication, achieving up to 53% higher space savings on flash workloads without significant performance penalties. Future directions for F2FS emphasize enhanced support for zoned storage, with ongoing kernel updates improving zone-aware allocation to better handle ZNS SSDs and reduce . Inline deduplication is also a priority, building on recent hybrid schemes to enable real-time duplicate detection during writes for consumer devices. Efforts continue to address critical fragmentation through advanced host-storage co-design, aiming for sustained performance in aging mobile environments.

References

  1. https://wiki.gentoo.org/wiki/F2FS
Add your contribution
Related Hubs
User Avatar
No comments yet.