I am running a small embedded system. Because the system will never be gracefully shutdown and will just have the power cable unplugged, I am running an initramfs but mounting an
ext3 partition on a compact flash drive where critical logging data is recorded (at approximately 1 second intervals). The data integrity is crucial and this is why I have chosen
ext3. My current understanding (possibly incorrect) of how this works is that somehow a backup of file information is kept whenever a new write is attempted, so that in the event of a power loss in the middle of a write, that old data can be retrieved instead of leaving the file containing corrupt data.
My question is this: do I have to do anything explicitly to make the system check for these events and if necessary restore the old file image? I have done some reading about
fsck but must I really run this every time the system starts up? From what I have read the
fsck utility seems targeted at actually repairing a corrupt file system rather than restoring specific files. What must I do check for and to restore any potentially corrupt data on the
ext3 partition at every system startup?