Bug 196192

Summary: failok option in /etc/fstab is not honored by fsck
Product: Base System Reporter: Anton Yuzhaninov <citrin+pr>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: billblake2018
Priority: ---    
Version: 10.0-RELEASE   
Hardware: Any   
OS: Any   

Description Anton Yuzhaninov 2014-12-22 14:58:16 UTC
I have servers with failok option in /etc/fstab, like

/dev/ada3 /spool/3 ufs rw,noatime,noexec,failok 0 2

I expect, that server can boot if ada3 fails.

In practice server fails to boot and drops to single used mode with message like:

THE FOLLOWING FILE SYSTEM HAD AN UNEXPECTED INCONSISTENCY:
        ufs: /dev/ada3 (/spool/3)
Unknown error; help!
ERROR: ABORTING BOOT (sending SIGTERM to parent)!

In fstab(5) failok documented as:

If the option “failok” is specified, the system will ignore any error
which happens during the mount of that filesystem, which would otherwise
cause the system to drop into single user mode.

But this option is not useful without fsck support.

How to fix:

fsck -p should ignore non-existing (non-readable) device for mount points with "failok" option.
Comment 1 Bill Blake 2022-05-23 09:01:37 UTC
The same problem still exists in 13.0.

In my case, I have a single root file system which I share among vm's, some of which have a /home file system and some of which do not.  I had assumed that I could just put failok in my fstab and the vm boot would simply ignore a missing /home.  Not so, since fsck really does want that file system to exist, failok or no.

My workaround is to set passno to 0 in the fstab entry for the /home file system, leaving it to code in rc.local to do the fsck only when the associated device exists.  Kinda klugey, but it solves the problem.

Anyway, there are two reasonable approaches to dealing with this issue.  One is to make fsck honor the failok flag.  The other is to note in the fstab man page that, though mount honors the failok flag, fsck does not, and thus that this flag will not guarantee a proper boot when the file system is unavailable.