Feature | Read-Only RootFS To Increase MicroSD Longevity

springfielddatarecovery asked for this feature 5 months ago — 2 comments

springfielddatarecovery commented 5 months ago

Problem: MicroSD cards have a limited number of read/write cycles. While DietPi does an astounding job at minimizing the total number of reads and writes, it is not zero. Additionally, if power is lost during a write, the filesystem can become corrupted and the device will be "bricked" or silently lose data/functionality (or do so not so silently). This is especially important for people developing embedded devices which are difficult to get to physically or sold to end users who lack the expertise to re-flash their MicroSD card.

Requested solution: Option for a read-only rootfs in dietpi-manager. Once the user has configured their dietpi exactly as they like, they select the read-only rootfs option, and future boots mount / as read-only.

MichaIng commented 5 months ago Admin

A read-only root file system breaks most services and system tasks, not only DietPi's but Debian core ones as well. It requires much customisation to get this done properly.

But once an mount a RAM filesystem on top of the root filesystem and fake read-write that way while all changes are kept in RAM. Of course this means all changes are lost on reboot, but all services will run normally. Check out these instructions about how to set it up via overlayfs: https://dietpi.com/phpbb/viewtopic.php?p=24920#p24920

Join the discussion!

with GitHub to comment