I am required to write some software to run on Linux installed on an x86 based embedded setup that has a 8GB compact flash drive for data storage. The critical requirements are logging measurement data to file every 30 seconds, and robustness to power loss (my system MUST be able to reboot successfully every time and logging data must not get corrupted). I have used buildroot to generate my kernel, crosstools and file system. Currently I have tried 2 things

  1. Booting up using only the .cpio file system provided by buildroot.
  2. Copying the file system to an ext3 partition and telling syslinux that the root file system is located there.

If I use option 1. and have my root file system in RAM I will lose my data at power down. If I use option 2. then I run the risk of system files getting corrupted on power down. The answer to this question Is using a read only root file system a good idea for embedded setup? lead me to consider using a read only file system, but the only answer I have received is currently too advanced for my level of Linux expertise. This has lead me to consider using a RAM based file system. In the case of a RAM file system using the .cpio file to boot from, how could I possibly operate things so that I can ensure power down safety AND get persistent data storage for my data logging requirements ?

  1. Run your system off RAM (faster, read only, will come up in known good state, etc.)
  2. Log your data to a separate partition on the USB stick. Might try mounting it with sync if your writes are not too frequent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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