If you have sufficiently large capacitors in your power supply and a 
power fail warning interrupt, you can quickly unmount/sync your file 
system.  You will have to determine how much time it takes to flush the 
dirty sectors to your media.  Ideally you will be able to calculate an 
upper bound, but you probably will have to determine it empirically 
(reality bites sometimes).

You can mount a file system synchronously (no write buffering allowed), 
but you take a sizable performance hit when you do that.  Use the "-o 
sync" option of mount.

gvb


At 01:25 PM 7/31/01 -0700, David Christensen wrote:
>How are people handling the situation where a user turns off the system
>without executing a proper shutdown?  I have an ext2 file system mounted
>with read/write attributes.  If the user pulls the plug on the system the
>file system will be dirty when the system is restarted.  In this situation
>e2fsck will be run, but how do I know that the file system is still 
>usable?
>I am checking the return value from e2fsck and recreating the file 
>system if
>the exit code is greater than 1, but I have seen cases where e2fsck 
>returns
>the value 1 while many of the files are gone (they apparently end up in
>lost+found).  Short of going to a journaling file system, are there any
>other methods that anyone can recommend?  (And no, I don't have control of
>the hardware so I can't prevent an unexpected shutdown.)
>
>David Christensen





**********************************************************************
This e-mail and any files transmitted with it are confidential and may
be legally privileged or otherwise exempt from disclosure under
applicable law. This e-mail and its files are intended solely for
the individual or entity to whom they are addressed and their content
is the property of Smiths Aerospace.  If you are not the intended
recipient, please do not read, copy, use or disclose this communication.
If you have received this e-mail in error please notify the e-mail 
administrator at [EMAIL PROTECTED] and then delete this e-mail, its
files and any copies.

This footnote also confirms that this e-mail message has been scanned
for the presence of known computer viruses.
***********************************************************************

--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.

Reply via email to