Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing an embedded Linux (it is almost over now). What I'm struggling with is the system goes unstable by cutting power source frequently and it does not boot anymore. It even does not perform fsck.

The system just has a XFCE with a fixed Qt App autoloaded to display some charts.

My question is that how commercial embedded Linux distros (like Wifi AP's management Linux, ...) avoid this problem?

Do you have any idea?

share|improve this question
i'd also look at the hardware side - why is power cutting off? what KIND of hardware is it? is there any way to monior it over serial console? – Journeyman Geek Apr 11 '11 at 23:09
up vote 3 down vote accepted

Most do one of two things:

They either run the main filesystem read-only and have a separate area for storage of data that is mounted read-write,


They have the main filesystem compressed in a file which gets expanded into a ramdisk at bootup time.

This means that the filesystem is always in the same state whatever happens. There is only the small configuration storage area to worry about, and that can have a filesystem that doesn't worry too much about power loss.

Another tip is to disable all caching on the storage partition so all changes are immediately written to disk.

share|improve this answer
Thanks Matt! the first option seems straight forward and actually I was thinking of it. I think I can do it without too much problem. I noticed that some distros like TinyCore follow the second approach. 1 - How can I do this? 2 - How do you compare the effectiveness of the two approaches? – hosm Apr 11 '11 at 23:59

Yes, generally speaking, they don't.

When it comes down to it, everyone probably has failed embedded devices - whether it is network gear, ip devices or other.

Simply put, build your application as best as you can - as a developer, that is all you can do.

Try to make your application as robust as possible - put error checking at the highest/every level. So for example, if you have a configuration file that is needed and your application can not run without, put a beep/feedback if it isn't found - let the user know.

The next level really comes from your hardware manufacturer - redundancy or robustness is key, and again, make sure the hardware vendor follows the above ideas such as error checking/verbose feedback so that if something fails, people know why/what did it.

I have not gone in to that much detail, but I hope this helps and points you in the right direction.

share|improve this answer
Thanks Wil! actually what is important for me is the stability of the OS itself since I'm not in charge with the app :-) However, you're advice is scientifically very good but I need an engineering approach since I'm taking all the enhancement considerations on program, HW, etc. as well but I think what crashes is the OS itself – hosm Apr 12 '11 at 0:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .