fsck.f2fs can not check a mounted filesystem, even if mounted read-only. Thus fsck will never run for root-mounts that are f2fs, unless it is run in initramfs before root is mounted. Reproducible: Always Steps to Reproduce: 1. Install Gentoo on f2fs formatted root partition. 2. Use genkernel to make initramfs. 3. Reboot. Actual Results: fsck fails to run on root-pertition. Expected Results: fsck should run on root partition.
Update: I was wrong about fsck.f2fs not running on a read-only mounted root-fs. The issue was that I've actually never been able too boot with f2fs root-fs mounted ro, I always got kernel-panic. Now I've discovered that this was because f2fs fails with: "Unrecognized mount option "ro" or missing value". I'll be taking that issue to the f2fs mailing list as soon as my joining has been moderator approved. Now back to the issue at hand: Sorry for bad bug-report, I should have checked why my kernel refused to boot f2fs ro before reporting. But, unless I'm quite mistaken again, there is still an issue here: That fsck.f2fs will never fix a f2fs formatted root partition that is mounted ro before fsck.f2fs is run. I admit I have not tested this, but fsck.f2fs says this when run against such partition: "fsck |Info: Check FS only due to RO "
can you try to bisect the problem? https://wiki.gentoo.org/wiki/Kernel_git-bisect
please report this to the f2fs mailing list https://f2fs.wiki.kernel.org/mail
also write back a link to your report to the f2fs mailing list so that we can track it
I'm waiting for moderator approval of my joining in the f2fs mailing list. I will report there, but it might be a while as the PSU of my gentoo box died yesterday and it will be a while before I can afford to replace it.
I just got bitten by this. Had to edit fstab to disable fsck for root filesystem to make my system bootable again.
Perhaps related to: https://bugs.gentoo.org/show_bug.cgi?id=671786
Created attachment 573764 [details, diff] Fix from upstream. I finally got my PC up and running again and reported to f2fs-mailinglist. I got this patch back; it seems to work when fsck is run with "-f" switch.
PS. the patch I just posted fixes only half the issue, fsck.f2fs will still not fix a RO-mounted filesystem, as confirmed by one of the developers here: https://sourceforge.net/p/linux-f2fs/mailman/message/36645996/
(In reply to hagbardcelin from comment #8) > Created attachment 573764 [details, diff] [details, diff] > Fix from upstream. > > I finally got my PC up and running again and reported to f2fs-mailinglist. > I got this patch back; it seems to work when fsck is run with "-f" switch. Sorry, this half of the issue proves to be a user error. After re-testing it seems I ran my first tests without -f. fsck.fo2s does actually open RO partitions with -f and without this patch.
Created attachment 573908 [details, diff] Fix for the real problem from f2fs-ml. This lets "fsck.f2fs -f" actuality fix a RO mounted partition, not only check it.
Not a genkernel issue, assigning to sys-fs/f2fs-tools maintainers. Maybe you will also need to contact openrc maintainers in case fsck service needs special handling ofr f2fs.
*** Bug 681618 has been marked as a duplicate of this bug. ***
I was never in a situation where I could test this. Can anyone let me know what's going on with 1.15.0. The package is being stabilized now and it does work in situations where it was not invoked by rc, so if upstream is not willing to do more on this, my position is we document this limitation.
I added forcefsck to kernel command line and it ran fsck for both my f2fs systems, including root mounted read-only. As far as I can tell, this bug is fixed. sys-apps/openrc-0.45.2-r2 sys-fs/f2fs-tools-1.15.0-r2 kernel 5.18.12