Enable automatic fsck upon booting OSMC (Raspberry Pi3)

With the absence of a small button to wake-up or boot-up the Raspberry Pi3 when running OSMC, being forced instead to cut-off DC power via some switch or leave it permanently on, I felt the need to introduce a more persistent file-system integrity check upon each boot or reboot of the device.

This is where fsck comes in, from the world of Unix; however, I had no idea where to enable it for running during boot-time.

Thanks to the people at the OSMC Support and especially to user DBMandrake (who is an OSMC developer) I, too was able to find the location of the files to edit, as well as the additional changes needed.

Obviously, you need to have SSH installed and know how to connect to your Pi3 device and then log in with the known credentials for OSMC via SSH that are osmc/osmc for username/password, respectively.

According to DBMandrake we need to make 2 specific changes in our system:

For anyone who wants to enable an automated fsck with repair, right now all you need to do is edit file /etc/fstab and change the second number at the end of each line from 0 to 1 (systemd doesn’t make any distinction between 1, 2, 3 etc. so using numbers above 1 makes no difference) then edit the file /boot/cmdline.txt and at the end of the same line, add a space then add fsck.repair=yes option. You should now see a two line fsck scan in the top left corner of the blue splash screen momentarily during boot. When no repairs are needed it only takes a couple of seconds.

So with this solution in hand, I was able to log-in via ssh from Terminal on my Mac OS X, and quickly modify these 2 files as explained. For Windows users, PuTTY is the obvious and straight-forward tool for SSH. Just remember that since it may be the first time ever to connect to your Raspberry Pi3 device, you may be asked to confirm the key fingerprint of the secure connection.

In my screenshot you can see the end-result after connecting to an OSMC system.