Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 4264  / 2 Years ago, wed, july 20, 2022, 6:37:42

My company is considering the use of Ubuntu as an OS for use on a hardware device.



It would be installed on compact flash drive - apparently this is not standard flash drive but a specific type of memory that is supposed to "cope" with immediate power shutdown (I am not sure how this is achieved but they are supposedly a "high end" card).



The units that would be run using Ubuntu are the type of units that will not be gracefully shutdown - the power cable would be removed and that is that.



Can anybody give me some advice on the potential problems that can occur? Is Ubuntu a good system that can deal with this kind of power outage and reboot successfully on next startup?



I realise that nothing is unbreakable, but is it a commonly used OS for an embedded setup? Is it asking for trouble to use Ubuntu in this kind of environment?


More From » hardware

 Answers
1

Note: this answer is from the perspective of a production environment where data loss or downtime can lead to loss of money, customers, industrial equipment malfunctioning, etc. If you are just tinkering with a Raspberry Pi at home, I'd say there's no problem... :)




I would not recommend Ubuntu in its default configuration, and the (default) ext4 filesystem by design, for an embedded environment where there would be repetitive "ungraceful" shutdowns like you suggest.



If I'm correct, you're using Ubuntu 8.04, which supports ext3 at best. While both ext3/ext4 use journaling as a way to maintain file (write) integrity and to aid in recovery, these should not be relied on when "pull the power cable" is the rule rather than the exception.




  • The ideal option, assuming that your system will not need dynamic reconfiguration once set up, is to mount its root filesystem read-only and to entirely use a temporary in-memory partition when operational (like the LiveCD does). In this case, the system would return to its "initial" configuration whenever booted up.

  • To store (a limited amount of) user data in a non-volatile way, you could create a secondary partition, perhaps using a filesystem optimized for flash media such as JFFS2 depending on the internal structure of the CF card. To reduce the chances of data corruption by pulling the plug, you could disable hardware write caching for the device, and mount it in synchronous (sync) mode, disabling write caching by the kernel. These options may severely affect throughput and performance, even on a "high-end" CF card, so you would have to take the intended use into consideration too.


[#36788] Wednesday, July 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ravturtl

Total Points: 335
Total Questions: 132
Total Answers: 110

Location: Tanzania
Member since Wed, Feb 24, 2021
3 Years ago
;