How to force fsck on bootup?

For AlmaLinux 8.8, how to I do a disk check on startup? I tried the touch /forcefsck thing, for shutdown -rF now but I never see it happen on bootup? any idea? is touch /forcefsck supposed to work?

Are you sure about these methods? I’ve searched the manual for “fsck” and there is no mention of “/forcefsck”. I then searched the pages “fsck”, “fsck.xfs” and “fsck.ext3” and again no mention of “/forcefsck”. I then had a look at the man page for “shutdown” and there is no “-F” mentioned. All tests performed on an 8.8 machine.

I’ve had a quick look at the RH documentation (Managing filesystems) and can’t see ant reference to “/forcefsck” there.

Well I’m not sure, thats why I’m asking. how do I force a disk check on startup then?

Sorry, with the old init system it was trivial but with potty startup it’s just black box software that either works or crashes.

wonderful, so there is no way to force a disk check on startup? can that be more ridiculous?

potty startup systemd has a service for that:

grubby --args=fsck.mode=force --copy-default --update-kernel=DEFAULT

Then afterwards, set it back to auto:

grubby --remove-args=fsck.mode --update-kernel=DEFAULT

/forcefsck is the old centos 6 way of doing things.

Thanks, I’ll give it a try. Do I still need to run a “grub2-mkconfig -o /boot/grub2/grub.cfg” after each command?

nope, grubby does it all