Can one shedule a sudo touch /forcefsck

then reboot sudo shutdown -r now

and automatically accept any fixes when connected to the PI over SSH?

It's the accept any fixes that i'm not sure if its possible over SSH,

but if it is possible, then how do i do it?

Ok ive done some digging and found:

fsck -A -a -y

The first -A indicates check all filesystems. The -a says "Fix it without asking" and the -y similarly will answer "Yes" to any question it wants to ask you.

Is this 1) what i was looking for and 2) safe to do over terminal?


1 Answer 1


You can do that. I have this in /etc/rc.local:

echo "-y" > /forcefsck

So that it happens every reboot (unless I rm /forcefsck first). I think -a and -y are probably redundant if -a means don't ask questions and -y means answer yes to any questions. man fsck refers to -a as supported "for backward compatibility only" (i.e., it's deprecated).

The system does check filesystems at boot anyway, if they weren't cleanly unmounted or have exceeded a certain number of mounts without a check. However, it's not a -y check, which can create a bungle on a headless machine, and it is not guaranteed to happen.

  • so 1) this can do what i was looking for 2) "bungle on a headless machine, and it is not guaranteed to happen" does mean it's not safe/ reliable?
    – reggie
    Feb 28, 2014 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.