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?
  • 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. LFS201 Essentials of System Administration
    12 Jan » 30 Mar - Online Self-Paced
  2. LFS220 Linux System Administration
    18 May » 21 May - Virtual (GUARANTEED TO RUN)
  3. LFS230 Linux Network Management
    25 May » 28 May - Virtual

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