Page 1 of 1

systemd-fsck not working with f2fs

Posted: Wed May 10, 2017 10:47 am
by TarjeiB
I've switched to f2fs on my RP3 Jessie-installation, as it seems I get less mmc corruption with it on my off-grid machine.
However, it seems systemd-fsck passes the wrong arguments to fsck.f2fs, so it can't be run on boot.

The following is from the syslog immediately after startup:

Code: Select all

systemd-fsck[114]: fsck.f2fs: invalid option -- 'y'
systemd-fsck[114]: Error: Unknown option ?
systemd-fsck[114]: Usage: fsck.f2fs [options] device
systemd-fsck[114]: [options]:
systemd-fsck[114]: -a check/fix potential corruption, reported by f2fs
systemd-fsck[114]: -d debug level [default:0]
systemd-fsck[114]: -f check/fix entire partition
systemd-fsck[114]: -t show directory tree [-d -1]
The problem is that systemd-fsck sends -y to fsck.f2fs, but fsck.f2fs does not accept this as a parameter.
Other distributions seems to have fixed this, can anyone suggest me a fix? I've already tried f2fs-tools-git and there's no -y, so it has to be fixed from systemd-fsck.

Re: systemd-fsck not working with f2fs

Posted: Thu May 11, 2017 6:56 am
by DougieLawson

Re: systemd-fsck not working with f2fs

Posted: Sun Jul 22, 2018 7:50 pm
by LeSpocky
I found two Debian bugs on this topic:
The issue is fixed upstream with f2fs-tools 1.10.0 which is already available in buster. I just manually downloaded the availably buster package and the required library from the raspbian package server and installed it on my RPi 2B running on stretch currently. Seems to work at first sight.

Re: systemd-fsck not working with f2fs

Posted: Wed Aug 01, 2018 5:02 pm
by hommar
The entropy increases :o

I make new release Raspbian with f2fs as rootfs for russian users every month.
And every next month fsck.f2fs found more and more errors after make realese.

I can't finish make release last time with out errors. And after reboot it do not work

But befor I make latest release, I update f2fs-tools from sources, And fsck.f2fs found no errors after make realese.

I think after update f2fs kernel part. You need update outside part - f2fs-tools.
(You update kernel from 4.9 as Debian Stretch to 4.14)

PS English is not my native language, so please be kind to my mistakes.

PPS I use Raspberry PI and Raspbian for make it, not cross-platform

Re: systemd-fsck not working with f2fs

Posted: Sun Aug 05, 2018 9:08 am
by hommar
Then we update kernel (from 4.9 to 4.14) need update fs-tools too.
(Old tools can kill system then you use older tools for newer FS)

1) Add next release Raspbian in sources list

Code: Select all

$ cat /etc/apt/sources.list
deb stretch main contrib non-free rpi
deb buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src stretch main contrib non-free rpi
2) Set default release as "stretch"

Code: Select all

$ cat /etc/apt/apt.conf.d/default-release
APT::Default-Release "stretch";
PS this file does not exist in default system.

3) Now we can install newer tools:

Code: Select all

sudo apt-get update
sudo apt-get -t buster install f2fs-tools
Now we have newer f2fs-tools and libs for it always.