I plan on using the Raspbian derivative Industrial Perennial Environment or a similar solution to create a blackout-proof headless Raspberry Pi for use with various electronics. Obviously this means persistent storage is impossible and that's fine; however, I would need a reasonable amount of temporary, volatile storage. I anticipate that the Pi's RAM size is not sufficient to solve this problem with an in-memory filesystem. Instead, I'd like to use a thumb drive as volatile storage, without relying on any kind of luck – the file system must always be ready for a fresh usage session after a spontaneous power cycle.
One potential solution I thought of is re-partitioning and re-formatting the drive to a non-journaling file system (not sure which one would be best for this use case) automatically on every boot in an init script. A variant would be to keep the partition table and file system in place and run fsck -y
and rm -rf *
every time instead.
- Are these viable solutions? Do better alternatives exist?
- Any special considerations or side-effects to be aware of?
- Is it safe to assume that the drive won't be physically damaged by the power cycles, or otherwise degraded in a way that can't be undone by re-initializing the drive?