Hi B&R community,
I’m working with a customer on X20 Edge (X20EDS410) who runs containerized databases in a production environment. We’re concerned about filesystem corruption and database data loss during unexpected power failures, and we’re exploring protection strategies.
Before we implement anything, I’d like to get community feedback on our current thinking and learn about any pitfalls or better approaches we might be missing.
Our Current Idea: (AI supported)
-
Immutable OS (Read-Only ROOTFS)
- Mount
/dev/mmcblk1p2(ROOTFS) as read-only to prevent system corruption - Use OverlayFS or tmpfs for runtime changes (logs, caches, systemd temp dirs)
- This protects against accidental/corruption writes during power loss
- Mount
-
Dedicated Writable Data Partition
- Create or repurpose a partition for
/datamounted withnoatime,errors=remount-ro - Move Docker
data-rootto/data/dockerto store volumes on the safe partition - Database files live in Docker volumes on this partition, not in container writable layers
- Filesystem-Level Durability
- Use ext4 journaling and barrier writes to prevent metadata corruption.
- Database-Level Durability (PostgreSQL)
- Configure with
fsync=onandsynchronous_commit=onfor durability guarantees.
What We’d Like to Know:
- Has anyone tried read-only root on X20 Edge? Any unexpected issues?
- Are there simpler, proven approaches for power-fail protection on X20 Edge?
- What real-world power-fail scenarios have you experienced? How did ext4 journaling handle them?
Goal: Minimize data loss and filesystem corruption during power failures without re-flashing the system.
Thanks for any insights!