Linux.com

Home Learn Linux Linux Answers Embedded/Mobile I am building a device that runs Android OS. So is there any way I can prevent the OS from crashing due to frequent power cuts?
Answers
  • If you don't need to keep changes between executions, you can mount the filesystem as ro, with only some temporal folders mounted on RAM. If some configurations have to be keep, a partition in ROM can be mounted only for this end.

    Answered by swans
    2 years ago
    0 0
  • Ideally, you'd have a battery (or supercapacitor) that'd keep you alive long enough to allow you to detect the main power supply cut-off and perform a clean shutdown. In the absence of that, anything else is merely damage limitation.

    That said, some suggestions:-

    * Use different filesystems for data areas of the system (e.g. /data), and mount OS filesystems (e.g. /system) read-only. That should prevent OS components from being corrupted, unless the user is foolish enough to begin an OS upgrade before cutting the power.

    * Mount data filesystems with synchronous writes enabled. This will impair performance, and on reduce the life of flash memory-hosted filesystems by increasing the total number of writes committed.

    * Give the use an obvious "clean shutdown" option.

    * If your device is battery powered, monitor the remaining battery capacity and shutdown at some empirically-determined "safe" minimum level (e.g. 5% remaining).

    Answered by cowbutt
    2 years ago
    0 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category Embedded/Mobile

Upcoming Linux Foundation Courses

  1. LFS230 Linux Network Management
    06 Oct » 09 Oct - Virtual
    Details
  2. LFD331 Developing Linux Device Drivers
    13 Oct » 17 Oct - Virtual
    Details
  3. LFS430 Linux Enterprise Automation
    13 Oct » 16 Oct - Virtual
    Details

View All Upcoming Courses

Community Answers - Search


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board