We’ve been using embedded Windows for some years on Colibri PXA270 and iMX6 in an environment where the power can be cut without warning, and we’ve never had a problem with the system coming back up when the power is restored. We’re looking at Linux as an alternative Embedded OS, and are wondering if it is as tolerant of loss of power as embedded Windows has been? What potential problems might we have?
Thanks for using Toradex Products.
In general, Powerloss can lead to corrupt file system on every OS especially, if the powerloss is during write operations and if the system files are corrupt, the OS won’t boot up.
If the power loss will lead to corrupt file system will depend on file system you are using. In the past, we were using ext3 and now ext4 for our Linux Images. Both uses Journaling to track changes in the filesystem, which helps to bring back the system after some crashes.
Without knowing much about your special use case, I would say Linux is as tolerant to power loss as Windows Embedded. You should know that in Linux keeps most of the data in cache and write it to the disk in the background. If you want to save files every time on the disk, then you should use fsync..
There is also the possibility to have read-only rootfs on linux, so you are sure that no files could be corrupted due to powerloss. For saving files a different partition can be created.
Best regards, Jaski
Thanks for the response. Our situation is that the Toradex platform is powered by a 24V output from a piece of machinery, and is running headless so we cannot perform any controlled shutdown. The machinery providing the 24V may be switched off at any time so the embedded platform needs to be really resilient to power loss. We could run Linux with read-only rootfs as data is stored on an SD card but would also need to be able to update the running software on the Colibri module.
Hi, As I wrote, Linux should be stable to sudden powerloss but if you want to have much safer solution, then you should go for a read-only rootfs.