F2FS Adds Opt-In Multi-Grain Timestamps With Linux 7.4, Other Improvements
Welcome back to Self-Hosted Tech! If you’re anything like me, you probably spend a lot of time thinking about compute power—whether that’s spinning up a new local AI model in a Docker container or squeezing a few more transcoders out of your media server. But today, we need to talk about the unsung hero of the homelab: storage.
Specifically, we’re diving into the latest updates to the Flash-Friendly File System (F2FS) that are landing with the Linux 7.4 kernel. F2FS has long been a darling for self-hosters running everything from Raspberry Pi clusters to high-end NVMe AI rigs. With Linux 7.4, F2FS is getting a massive quality-of-life upgrade in the form of opt-in multi-grain timestamps, alongside some serious under-the-hood improvements for zoned block devices and garbage collection.
Let’s break down what this means for your hardware, why it matters for your self-hosted stack, and how you can start using it today.
A Quick Refresher: Why F2FS for Homelabs?
Before we get into the juicy new kernel patches, let’s talk about why F2FS exists in the first place.
Traditional filesystems like ext4 and XFS were designed in an era where spinning hard drives were king. They assume that overwriting a file is a simple matter of magnetizing a new sector on a spinning platter. Flash storage—SD cards, eMMC modules, USB drives, and SSDs—works completely differently.
Flash memory cannot overwrite data directly. To write new data to a block, the flash controller must first erase the entire block. Because erase blocks are much larger than write pages, updating a tiny 4KB file can force the drive to erase and rewrite a massive 4MB block. This phenomenon is called write amplification, and it degrades both performance and the lifespan of your flash media.
F2FS was developed by Samsung to work with the quirks of flash storage rather than fighting them. It uses a log-structured approach, writing data sequentially to avoid the erase-block penalty. For homelabbers, this means your Raspberry Pi SD cards survive longer, and your consumer-grade NVMe drives don’t burn through their TBW (Terabytes Written) endurance as quickly when hosting heavy Docker workloads.
The Big News: Opt-In Multi-Grain Timestamps
The headline feature for F2FS in Linux 7.4 is the introduction of opt-in multi-grain timestamps. To understand why this is a big deal, we have to look at how Linux handles file metadata.
Every file on a Linux system has an “inode” that stores metadata about the file. This includes permissions, ownership, and timestamps—specifically mtime (modification time), ctime (change time), and atime (access time).
By default, Linux updates these timestamps with nanosecond precision. While this is great for strict database auditing or complex build systems, it’s absolute murder on flash storage. If a script touches a file three times in a single second, F2FS has to update the inode’s timestamp three times. Each of those updates generates a small write operation. If atime updates are enabled, simply reading a file will trigger a metadata write.
Over millions of files and thousands of operations, these tiny metadata writes add up to significant write amplification.
Enter Multi-Grain Timestamps
Multi-grain timestamps introduce a two-tiered system for handling file times:
- Coarse-Grain: The filesystem only updates the timestamp if the current time (in seconds) differs from the last recorded timestamp. If you write to a file five times in one second, the inode is only updated once.
- Fine-Grain: If an application explicitly requests high-precision timestamps (using specific
statxsystem calls), F2FS will fall back to nanosecond precision for that specific operation.
The beauty of the Linux 7.4 implementation is that it is opt-in. It doesn’t break legacy applications that might rely on exact timestamp behaviors. Instead, you can enable it via a mount flag, instantly reducing the background write noise on your flash drives.
For self-hosters, this is a massive win. If you’re running local AI models that constantly read and write temporary tensor files, or if you have a busy Nextcloud instance, enabling coarse-grain timestamps by default will drastically reduce the number of tiny, unnecessary writes hitting your SSD or SD card. Your drives will run cooler, perform more consistently, and last significantly longer.
Other Improvements in Linux 7.4
Multi-grain timestamps aren’t the only trick F2FS has up its sleeve in Linux 7.4. The maintainers have been hard at work refining the filesystem for modern hardware. Here are a few other notable improvements:
Enhanced Zoned Block Device (ZNS) Support
Zoned Namespace SSDs are the new hotness in enterprise storage, and they are slowly trickling down to prosumer homelabs. ZNS drives divide storage into zones that must be written sequentially. F2FS is uniquely positioned to take advantage of ZNS because its log-structure already writes sequentially. The 7.4 kernel brings better alignment between F2FS garbage collection and ZNS zone resets, meaning less overhead when cleaning up stale data.
Smarter Garbage Collection (GC)
Speaking of garbage collection, F2FS’s GC algorithm has received tweaks to be less aggressive during high-I/O periods. Previously, a background GC process might kick in while you were trying to run a heavy workload (like pulling a massive Docker image or running an AI inference), causing latency spikes. The new logic better balances foreground I/O demands with background cleaning, resulting in smoother performance under load.
Improved Atomic Write Support
F2FS has long supported atomic writes (writing data so it either entirely succeeds or entirely fails, preventing corruption). Linux 7.4 expands this support, making it more robust for databases like PostgreSQL or SQLite, which are common in self-hosted apps like Vaultwarden or Home Assistant.
Practical Walkthrough: Formatting and Mounting with Multi-Grain Timestamps
Ready to try this out on your own homelab hardware? Let’s walk through formatting a drive with F2FS and mounting it with the new multi-grain timestamp feature.
Note: You will need to be running a kernel version 7.4 or higher, and you’ll need an updated version of f2fs-tools.
Step 1: Install the Required Tools
First, ensure you have the F2FS userspace tools installed on your Linux machine. On Debian/Ubuntu-based systems, run:
| |
For Arch Linux or Manjaro:
| |
Step 2: Identify Your Drive
Let’s say you’ve just plugged in a fresh NVMe drive or a high-quality SD card for a new Docker volume. You need to find its device identifier. Run lsblk to list your block devices:
| |
Look for your new drive. For this example, let’s assume it is identified as /dev/sdb. Double-check this! Formatting the wrong drive will destroy your data.
Step 3: Format the Drive
Now, let’s format the drive with F2FS. We’ll use the -f flag to force the format, just in case there’s an old filesystem signature on there.
| |
You should see output confirming the creation of the F2FS filesystem, detailing the sector size, segment count, and other technical parameters.
Step 4: Mount with Multi-Grain Timestamps
Now for the magic. Create a mount point where you want this drive to live in your filesystem. Let’s use /mnt/docker_data as an example.
| |
To mount the drive with the new multi-grain timestamp feature, we use the mgtime mount option.
| |
Step 5: Verify the Mount
To ensure the option took effect, you can check your mounted filesystems:
| |
You should see an output that includes /dev/sdb on /mnt/docker_data type f2fs (rw,relatime,mgtime).
If you want to make this permanent across reboots, you’ll need to add it to your /etc/fstab. Open that file with your favorite text editor (like nano) and add the following line:
| |
Pro-tip: If you are using this for Docker container volumes, consider adding noatime to your mount options as well (defaults,mgtime,noatime). This disables access time updates entirely, saving even more write cycles.
Step 6: Test It Out
To see the impact, you can run a quick test. Let’s create a file and write to it multiple times in a single second:
| |
If you check the stat output, you’ll see the modification and change times. Under the hood, F2FS has optimized these metadata updates, saving your flash memory from unnecessary wear, even if the nanosecond precision looks similar to the naked eye.
Should You Switch Your Homelab to F2FS?
F2FS is fantastic, but it’s not a silver bullet for every use case.
You should use F2FS if:
- You are running a Raspberry Pi or SBC off an SD card or eMMC module.
- You have a dedicated NVMe or SATA SSD for Docker container overlayfs and application data.
- You are hosting local AI models and need fast, sequential write performance for model loading and caching.
- You want to extend the lifespan of consumer-grade flash media in a 24/7 server environment.
You should probably stick to ZFS, Btrfs, or ext4 if:
- You are using spinning rust (HDDs). F2FS works on HDDs, but its log-structure can actually cause fragmentation and performance dips compared to ext4.
- You need advanced features like built-in bit-rot protection, snapshots, or native software RAID (though F2FS pairs well with Linux
mdadm). - You are running a massive database server with highly specific I/O patterns that require strict fine-grain timestamps at all times.
For the vast majority of self-hosted applications—media servers, home automation, local LLM hosting, and web hosting—F2FS with the new multi-grain timestamps enabled is an absolute powerhouse.
Summary
The Linux 7.4 kernel brings some much-needed love to F2FS. By introducing opt-in multi-grain timestamps, the maintainers have given homelabbers a powerful tool to reduce write amplification and extend the life of their flash storage. Combined with smarter garbage collection and better ZNS support, F2FS continues to cement itself as the premier filesystem for flash-based self-hosting.
If you haven’t experimented with F2FS yet, grab a spare SSD or SD card, format it, and mount it with the mgtime flag. Your hardware will thank you.
What do you think? Are you currently using F2FS in your homelab, or are you sticking with ext4 and ZFS? Let us know in the comments below! If you found this article helpful, make sure to subscribe to the Self-Hosted Tech YouTube channel and drop your email on our blog for more practical guides on hardware, homelabs, and local AI. Happy hosting!