Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Gentoo Chat
  • Search

F2FS discussion

Opinions, ideas and thoughts about Gentoo. Anything and everything about Gentoo except support questions.
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
Author
Message
towel1
n00b
n00b
Posts: 12
Joined: Thu Dec 25, 2025 3:45 pm
Location: Brazil

F2FS discussion

  • Quote

Post by towel1 » Sat Jan 10, 2026 3:02 pm

hey guys

I installed Gentoo a few days ago, I formatted my entire SSD (besides EFI and swap) with F2FS.

so. let's talk about F2FS

for instance.

what are your F2FS mount options?

currently mine are:

Code: Select all

defaults,rw,compress_algorithm=lz4:3,compress_chksum,atgc,gc_merge,lazytime,noatime,fsync_mode=strict
but I want to review them eventually.

some links:

https://docs.kernel.org/filesystems/f2f ... nt-options
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2180
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

  • Quote

Post by pingtoo » Sat Jan 10, 2026 3:18 pm

towel1,

May I suggest if you could listing each option you choose with reason in your own words. This way it could reach wider audiences not just only those familiar to F2FS. As I am don't use F2FS but very much want to move to for some of my devices. I know some of the standard options like 'rw', 'noatime' but none of those specific to F2FS.

I guess it will be easier for those experts that understand why you choose these options could make better comments.
Top
towel1
n00b
n00b
Posts: 12
Joined: Thu Dec 25, 2025 3:45 pm
Location: Brazil

  • Quote

Post by towel1 » Sat Jan 10, 2026 5:42 pm

pingtoo wrote:towel1,

May I suggest if you could listing each option you choose with reason in your own words. This way it could reach wider audiences not just only those familiar to F2FS. As I am don't use F2FS but very much want to move to for some of my devices. I know some of the standard options like 'rw', 'noatime' but none of those specific to F2FS.

I guess it will be easier for those experts that understand why you choose these options could make better comments.
yeah I wrote the OP in a hurry to put it out

I don't have a deep rationale for choosing F2FS, and I chose those mount options like I was adding spices to a recipe, looking at the F2FS mount options and adding whatever looked yummy/spicy.

I feel like F2FS needs more documentation. I feel like that besides that link from OP, you gotta read commit messages, mailing list, and reverse engineer its source code to enhance understanding, which is very cumbersome tiresome.

Gentoo's wiki is too much succinct, it doesn't mention flags required to mkfs.f2fs or mount: https://wiki.gentoo.org/wiki/F2FS
but Arch's wiki has additional more mature advice: https://wiki.archlinux.org/title/F2FS

from Arch's wiki, it states to format a partition, among three options, specifically with:

Code: Select all

# mkfs.f2fs -l mylabel -O extra_attr,inode_checksum,sb_checksum,compression /dev/sdxY
additionally, when creating the partition, I added lost_found to the -O option list. man page for mkfs.f2fs mentions casefolding a few times, I have no idea what it means, and I didn't overthink about it, dunno what are their implications.

and recommended mount options:

Code: Select all

# mount -o compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime /dev/sdxY /mnt/mountpoint
so on top of those recommended options explained in wiki.

zstd is kinda slow with high compression gains. but I fear that too much compression, would throw away the benefits of fast SSD, because CPU would be bottleneck compressing and decompressing. I dunno how to measure that. I feel like compression only matters when SSDs are used for cold storage, or to maximize its lifespan. for daily usage, kinda sus?

you see. lz4 is a very fast algorithm with slim compression gains. I chose the lowest compression level for lz4. my idea was the following: do compress a little, if you can save one or two blocks from being written, fine, otherwise, fine. decompression is enormously fast, minimal overhead (but again, I dunno how to measure)

I also added fsync_mode=strict. look at this (emphasis mine):
Control the policy of fsync. Currently supports “posix”, “strict”, and “nobarrier”. In “posix” mode, which is default, fsync will follow POSIX semantics and does a light operation to improve the filesystem performance. In “strict” mode, fsync will be heavy and behaves in line with xfs, ext4 and btrfs, where xfstest generic/342 will pass, but the performance will regress. “nobarrier” is based on “posix”, but doesn’t issue flush command for non-atomic files likewise “nobarrier” mount option.
I didn't verify this claim, but makes you think. F2FS is widely criticized for being unreliable. so I added this out of paranoia. makes you think.

I wanted to add the following mount options in the future: inline_data,inline_dentry. actually, they are already enabled!!! look:

Code: Select all

$ head -1 /proc/mounts
/dev/nvme0n1p3 / f2fs rw,lazytime,noatime,background_gc=on,gc_merge,discard,discard_unit=block,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,barrier,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,checkpoint_merge,fsync_mode=strict,compress_algorithm=lz4:3,compress_log_size=2,compress_chksum,compress_mode=fs,atgc,memory=normal,errors=continue 0 0
I also wanted to know the following: you can mount F2FS without passing any options, and I think it sets a bunch of options by itself. are they defaults? if not, where they come from? who decided they are best? best for what? so many mysteries.
Top
pa4wdh
Veteran
Veteran
Posts: 1015
Joined: Fri Dec 16, 2005 6:55 pm

  • Quote

Post by pa4wdh » Sat Jan 10, 2026 6:08 pm

I'm using F2FS on my RPi2B which runs as my NTP server. I actually only have the noatime option, nothing more.
Reasoning is that most fancy features consume CPU cycles, something the RPi2B doesn't have too much of. It also has a 128GB SDCard for /, so i don't need compression for extra capacity.

It has been running since somewhere 2014-ish, in this period i changed the SD Card 3 times, it never actually failed, but cards are cheap so every now and then i buy a new one and migrate. I never had any reliability issues. Of course NTP is not heavy on the disk, but it runs gentoo and i compile everything on the Pi itself, so thay will probably wear the SD Card most.
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2402
Joined: Wed Mar 07, 2007 6:41 pm

  • Quote

Post by Goverp » Sat Jan 10, 2026 6:41 pm

I've been using F2FS for five years on my desktop machine (NVMe for most stuff, F2FS, spinning rust for /home ext4), and that was created and is formatted using only the default options. I've also used if for some lesser time on my laptop since I replaced the hard drive with an SSD, that one has the checksums recommended by Arch. No problems with either machine.

I recently replaced the hard drive on a 17-year old PC with an SSD to speed it up (it's still very slow), and again I included the Arch checksums when formatting. Just defaults in /etc/fstab. There may be advantages to the other options, but I've never found the need to try.

I've not tried compression - I'm not keen on mangling my data unnecessarily. AFAIK compression on F2FS doesn't save space, just I/O operations - i.e. the same amount of "space" is reserved, but fewer blocks are written (and read), which reduces wear.

I think F2FS's reputation suffered from a few early problems that are still listed all over the web as if they were current, and a separate issue with using it on SD cards. F2FS seems to work OK on an SD card - I use it on a couple of Raspberry Pi's. However, it can't fix the problem that using an SD card for volatile storage on a Pi is a recipe for disaster. If you make the mistake of sending syslog or systemd journals to an SD card it will rapidly wear out, and typically the card goes into R/O mode (to preserve your photos, or whatever the manufacturer assumed you were putting on it). That of course locks up your Pi, and I think F2FS got blamed early on. That said, I have a Pi on my network that has run as a print/WebDAV/dnsmasq server 24x7 for the last 8 years, with an F2FS SD card as storage - but with memory-only systemd journalling.

There was an issue with F2FS boot-time fsck that I've never quite understood. AFAIK like all filesystems, you can only fix things during fsck if the partition is not mounted. For some reason, Arch and I think Raspbian didn't handle this correctly, and tried to run the fsck after mounting. My solution was to use an initramfs that does an fsck -f before any mounts. I suspect this problem is ancient history - I've not seen any howls of anguish of that sort recently.

F2FS is actually a journalling filesystem - i.e. every I/O is journalled because effectively the filesystem is the journal, so it should be very resilient in the face of unscheduled power-offs. Maybe it got a bad rep. as a result of early problems here too.

I use F2FS fscrypt support for the home directories on my laptop. Seems to work well, but with some unexpected (though logical) behaviour (the encryption goes with the file, so moving something from a ~user/foo directory to an unencrypted such as /usr/local/bin leaves you with a file that can only be read when "user" is logged on...) - that's all about fscrypt, not F2FS.

One problem with F2FS full disk and booting is that while GRUB supports this, it's only if you have the vanilla options - it can't handle the extended attributes for the checksums. I guess you are using some other boot manager. My solution is a small /boot formatted as ext4. Other solutions include using the Linux EFI stub support and putting the kernel in the EFI partition (which of course is some FAT variety).
Greybeard
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2402
Joined: Wed Mar 07, 2007 6:41 pm

  • Quote

Post by Goverp » Sat Jan 10, 2026 6:46 pm

Forgot to add: "casefolding" is support for case-independent filenames - so "My fanCy FiLeNaMe' (and all variants) is treated as 'MY FANCY FILENAME'. That worked very well for IBM mainframes for decades, but they used 128-character locales such as iso8859-1. In the land of UTF8 filenames and support for a humongous range of character-sets, it's not so much of a good idea - see Linus Torvald's rants for more details. Various filesystems started adding it so they can suffer the same problems as FAT :-)
Greybeard
Top
Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “Gentoo Chat”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic