Bulletproof OSMC Pi & the read-only boot partition

Hi everybody,

as suggested by the nice support orientation page, I am starting a conversation to pick people’s brain before opening a GitHub issue.

I have been using OSMC since the beginning and I had my fare share of time where the Pi got unplugged without a proper shutdown (TV stand with a on/off power strip). And more often that I liked, I got a Pi with a blinking cry for help due to a corrupted partition and re-imaging was necessary.

As I checked the disk layout through SSH, I noticed that the /boot has been separated from the /.
Going full-embedded paranoid, I updated my fstab to mount the /boot in read-only mode and remounted it read-only for the current day. Ever since, I got again days with brutal power off and not once I had a problem rebooting the next day (it was not every time before that but from time to time).

To make this change perfectly transparent, the only thing missing is the deb packages that provide any update to /boot (so mainly grub & kernel packages) require a pre-install command (mount -o remount,rw /boot) and post-install command (mount -o remount,ro /boot) to be able to install unattended.

As of now, I am applying updates and if they fail (like one recently), I need to do the remount myself, call apt and then remount.

I thought it would be a low-impact/high-gain idea as I am sure not 100% of users perfectly stop their Pi (especially when you use it for a video, then do something else and at the end of the day do not remember) and nobody like to pull the SD for a re-imaging or to try a repair on the current FS.

If nobody point out a big gap in this idea (or if some people think it can be beneficial and say so here), I will open eventually a GitHub issue with this idea (default fstab + pre/post for some packages).

Thanks for reading :slight_smile:

You would also need to ensure that My OSMC’s offline logging can accommodate this, but remounting boot as RW from Python could have security implications.

/boot is rarely written to. I don’t think mounting it RO is going to make it any more robust.

If you’re frequently having to fixup the boot partition, I’d check your card and power supply.