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.
Steps to Reproduce:
1. Install Gentoo on f2fs formatted root partition.
2. Use genkernel to make initramfs.
fsck fails to run on root-pertition.
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?
please report this to the f2fs mailing list
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:
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:
(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.