There are many applications where it is possible use temporary overlay over root filesystem and left root read-only for (allmost) whole operation.
In the fact, I would not believe in read-write SDcard root-fs without automatic second device boot replacement for serious/industrial application when standard consumer grade cards are used.
We have been contracted to enhance reliability of such application build on Raspbian image and we propose to use Aufs to build overlay in RAM/tmpfs to ensure reliable operation. Raspbian and generally any other distribution can be used with our scripts without noticing that SD card root is in the fact read-only.
The separate partition is allocated to keep persistent data of target application. That partition is cleaned/formated in the case of that partition FS corruption.
Kernel with Aufs patches included is available there
The QEMU ARMv6/ARM1176 versatile patches are included as well to allow Raspbian image testing on PC.
The scripts to setup overlay based on Aufs and replace init are part of another repository
- init-overlay contains key parts of Raspbian filesytem which has been modified/added
* sbin/init-overlay - contains standard init replacement which setup overlay
and then executes original init
* sbin/overlayctl - provides command to install, uninstall, enable and disable
overlay feature for next boot
* etc/init.d/mountpersistent.sh - rc script to check and mount persistent data partition
- WIP material for now
The preliminary experimental setup has been tested by company using RPi in industrial application. They randomly cycled RPi power and root file-system has survived 3 weeks. They have problems with SDcards corruptions and wearing in the field before. Some probably caused by Flash device not bearing well power lost during write - even that ext4 is journaled, there seems to be working no transaction barriers on standard grade SDcards and file-system cannot reconstruct state for next boot.
The other cards seems to really experience wear/tear problems.
We provide all above mentioned enhancements in open-source form same as all future enhancements of this project. We would be glad if Aufs or OverlayFS is included in official Raspbian kernels. Aufs is/was standard part of Debian kernels. Our scripts are prepared for OverlayFS and UnionFS as well.
I hope we find time to prepare better documentation in future but I hope that code can be already for some use and experimenting for others so I am providing this notice and public offer to use our work. Some basic little dated documentation is there
https://github.com/ppisa/rpi-utils/blob ... verlay.txt
overlayctl can be used for most of management tasks now.