Have been configuring some filesystems to run fsck during every boot…
tune2fs -c 1 -i 1d /dev/sdb1
…so that if anything is wrong with it, it’ll be fixed sooner by proactive fsck, instead of risking further corruption.
Some such filesystems are of considerable size and thus might take awhile for fsck to finish. This would prolong the boot time while the system waits for its completion, but that’s fine and not a disruption.
However, about six weeks ago, the behavior suddenly changed, probably after a system update, and now the boot process does not wait for the fsck/mounting to finish, and so the boot completes and the filesystem is not mounted for a little while longer.
This is a problem, as there are some things that expect the filesystem to be mounted and available almost right upon initial login.
Have tried looking at various service/unit files to see if their configuration might shed light on this, but haven’t found anything telling so far.
What’s the easiest way to determine the change that’s causing this, so can restore the prior behavior?
Naturally, the root filesystem is not subject to the problem since it must be mounted in order for booting to complete. Home is perhaps also not subject to the problem for similar reason, and also that it is on a device that’s faster than the external, problem filesystem.
The last line is the one with the issue. Nothing of this was changed leading up to the problem first occurring.
As user does not care whether this filesystem is available or not, systemd does not attempt to wait for this filesystem to become available. Either remove nofail or explicitly order services that needs it after this mount point (e.g. using RequiresMountsFor).
Would not have figured that removing the nofail fstab option would help, since man fstab describes it only as…
do not report errors for this device if it does not exist
Yet it does solve the issue. Thanks.
This is a simple solution. Also, from discussion on the web, nofail supposedly thwarts failure in situations beyond just device absence, thereby proceeding on arbitrary errors and resulting in filesystem risk. So, decided to abolish all use of it indefinitely. However, doing without it leaves the caveat that absence of the pertaining storage device will disrupt the boot process, since it now is expected to be present. Tried the nobootwait option in place of nofail, but it had no discerned effect, and is perhaps only for other distros. Checked man fstab mount ext4 for something to alleviate this caveat, but didn’t see anything pertinent.
Although it’s not a critical matter, do you have any recommendations?
As usual, it depends. If you can guarantee that device is either present on power on or not and do not consider hot plugging after initial boot - you can simply write a trivial generator that adds mount unit when device is present. After all, that is exactly what happens with /etc/fstab - on systemd start it invokes generator that creates (transient) mount units using /etc/fstab as input.