Re: [f2fs-dev] Possible issues with fsck of f2fs root
Brought to you by:
kjgkr
From: Michael L. <be...@bi...> - 2020-07-27 15:28:06
|
Am Samstag, den 25.07.2020, 10:06 +0800 schrieb Chao Yu: > On 2020/7/24 16:11, Norbert Lange wrote: > > > > $ fsck.f2fs -a /dev/mmcblk0p5; echo $? > > Info: Fix the reported corruption. > > Info: Mounted device! > > Info: Check FS only on RO mounted device > > Error: Failed to open the device! > > 255 > > I tried ext4, it acts the same as f2fs... except different return > value. > > fsck -t ext4 -a /dev/zram1; echo $? > fsck 1.45.0 (6-Mar-2019) > /dev/zram1 is mounted. > e2fsck: Cannot continue, aborting. > > > 8 > > fsck -t ext4 -a -f /dev/zram1; echo $? > fsck 1.45.0 (6-Mar-2019) > Warning! /dev/zram1 is mounted. > /dev/zram1: 11/1179648 files (0.0% non-contiguous), 118065/4718592 > blocks > 0 > > I'd like to know what behavior of fsck does systemd expect? > fsck -a should work (check & report or check & report & repaire) > on readonly mounted device? I think the return value is exactly the problem here. See fsck(8) ( https://linux.die.net/man/8/fsck) which specifies the return values. Systemd looks at these and decides how to proceed: https://github.com/systemd/systemd/blob/a859abf062cef1511e4879c4ee39c6036ebeaec8/src/fsck/fsck.c#L407 That means, if fsck.f2fs returns 255, then the FSCK_SYSTEM_SHOULD_REBOOT bit is set and systemd will reboot. Best regards, Michael |