Project

General

Profile

Clean Shutdown

Added by William Fisher about 14 years ago

How do you recommend we handle shutdown of our embedded device in order to ensure the consistency of the Linux file system and anything else needed for a clean reboot?

We're doing a device that can be plugged in and unplugged at will. Although we don't recommend that it be done, we can't stop someone from tripping over the power cord or accidentally hitting the switch on a power bar. So we need to be sure we deal with these sorts of situations.

We've previously discussed making some aspects of the file system write-only, and eliminating caching of data by certain services (as in the "ethernet failure" posting in this forum). What else should we consider doing?


Replies (1)

RE: Clean Shutdown - Added by Michael Williamson about 14 years ago

I think the most important thing is to mount the root filesystem and any filesystem you have your executable on with the noatime option, and then remount it as read only after the processor has booted. Ideally, the startup scripts from the base filesystem should be modified to support mounting the root file system as read only. This would likely speed up boot times as well. For example, you could probably disable udev and use a state /dev directory once you have all your devices installed and are using them as you like.

For non-volatile NAND storage of runtime data (do you have this?), I'd recommend creating 2 separate partitions (and mounting them) and writing your data twice (with a sync in between each write) so that you're sure at least one partition has a valid copy of the data. A simple checksum test could then let the software know that it's working with valid data.

Not sure if this answers your question....

-Mike

    (1-1/1)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)