Automatic fsck of root filesystem on start/stop

As far as I know FSCKFIX=yes in /etc/default/rcS will not be honoured by systemd as fsck is not run by an /etc/init script but by two systemd services called systemd-fsck-root.service and systemd-fsck.service.

The systemd equivalent is fsck.repair=yes on the kernel command line. (In /boot/cmdline.txt on a Pi or /boot/uEnv.txt on a Vero)

http://www.freedesktop.org/software/systemd/man/systemd-fsck@.service.html

So your fstab change will work and trigger fsck to run on boot, but if there are any errors they will not be automatically fixed and the system will drop to an emergency console. In previous versions of OSMC this would prompt for a non-existent root password and you would be stuck, however with the most recent update you will get a root prompt without a password, where you could manually run fsck with the repair option.

We are working on a proper fsck solution, unfortunately achieving fully automated repairs safely, (on a device that doesn’t typically have a keyboard attached) and without significantly slowing the boot process or contaminating the splash screen with messages when repairs are not needed is not as easy as it appears so we are working to get this right.

1 Like