Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
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

2 Answers 2

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,

or

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.