[TriLUG] Fault-tolerant FS for battery-operated Linux

Igor Partola via TriLUG trilug at trilug.org
Thu Mar 31 16:56:47 EDT 2016


I don't know if any FS that would be tolerant of such a thing in call
cases. For a regular RPi I've had to do things like disable logging to disk
and ensure it's mounted in a journaled mode to reduce the likelihood of FS
corruption.

My suggestions would this would be to get the base system working off a
read-only partition, and have a separate partition for the video. For
example, record 30 seconds of video, then commit write it to a new file,
then fsync() it. Assuming you don't plan on having the system reboot and
continue flying on its own, and doing the fsck offline afterwards, I think
most sane FS's will do fine.

Also, don't forget that it's notoriously difficult to get fsync() to
properly commit a file to disk. I had no idea, for example, that you had to
fsync() the parent directory as well. Take a look at
http://danluu.com/file-consistency/ for more info.

Another approach would be to use the GPIO pins to determine when the
battery is running low, or having a storage mechanism that has a built-in
backup battery, though be careful with the latter: certain drive
controllers start to lie about whether they actually performed fsync() or
not since they assume their power will never go out.

Best of luck. Let us know how you make out.

Igor


More information about the TriLUG mailing list