To hopefully prevent filesystem corruption I've setup the /boot and / partitions as read-only. For some use cases I still need a writeable partition to store data. If plan to create a 3rd partition on the SD card and mount it at /rw. Does having a writable partition on the SD card reduce or eliminate the benefits of having the /boot and / partitions read-only? Like is there a chance that a power loss while writing to the 3rd partition will corrupt the whole SD card?


For an embedded project of mine, I use ro boot and rootfs, and two rw btrfs mirror raid partitions. I can cut power at anytime I need to, and my device can boot as the boot and root part are not modified. I chose btrfs as it has copy-on-write feature, with synchornization and snashots.

  • Can you explain how you did this?
    – CrabbyPete
    Sep 10 '21 at 18:13

The risk damage due to power loss is greatly exaggerated.

Over 7 years using 9 Pi I have never experienced filesystem corruption due to power loss, although failed upgrades, user error and 2 worn out SD Cards have caused problems.

Attempting to have RO partitions is unlikely to help. The mapping between partition and physical storage is under the control of the SD Card firmware, so there is no guarantee of contiguous storage, and is managed transparently to the OS.

Having partitions on proper Erase Block Boundaries (and not all images do this correctly) may minimise the chance of loss, there is no guarantee that wear levelling will not change actual storage mapping. As the firmware is proprietary it is impossible to know what it does.

  • If you had over 6,000 devices you'd see it. How do you ensure that partitions are on proper Erase Block Boundaries
    – CrabbyPete
    Sep 10 '21 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.