I'm looking for systemd's equivalent to the shutdown -F
command.
I know that I can force fsck by adding fsck.mode=force
to kernel options or tweak mount count for disks.
I have tried touch /forcefsck
but it doesn't work with latest systemd versions.
Linux – Force fsck check after reboot with single command
arch linuxfscksystemd
Best Answer
When I want to force fsck, I just use the following command:
It simply sets the mount counter to 50, but I also have set:
So as you can see, when I set 50 in mount count, kernel thinks it should fsck the partition.
This solution works always, no matter what you use sysvinit/systemd or whatever else.