Electronic – Safe shutdown Embedded Linux on Power-Down

linux

I am not very experienced with Embedded Linux, just some projects with the Raspberry Pi.

I would like to know if there are any recommended ways to shutdown the Embedded Linux if the device's power is removed suddenly, or if common-practice is to just ignore it.

Best Answer

A journaling filesystem is less prone to corruption, so ext4 is used, still it is not 100% safe. By default in raspbian you have option flags in fstab, that upon power up, it does a filsystem check and repairs corrupted SD card.

Well there are lot of UPS boards, but many of them are useless, they just invoke sudo shutdown -h nowscript at detected power outage and the capacitors supply the board for few seconds. But if you reconnect the power before the capacitors are drained out, then the board won't start again automatically.

A good UPS has to have an additional MCU that handles the correct sequence. For example the Beaglebone has an standalone PMIC, but they never thought about to use it correctly. Most of these boards are stamped in millions copies, but they lack of very basic functionality, shutdown sequence.