0
\$\begingroup\$

I have a project that uses a raspberry pi zero where the power will be cycled unexpectedly, so I configured the filesystem as Read Only. I also have a small amount of data that I want to update every few minutes, which I don't mind losing if it doesn't happen often.

I would like to create another partition on the SD card that is Read/Write for this extra non-critical data, with the expectation that if power fails during a write it will only corrupt the one partition.

I know that SD cards have their own controller build in that remaps addresses to the actual flash cells. So, are partitions on an SD card treated independently at the card level or is there some internal process on the card will cause data from both partitions to be modified, thus allowing potential corruption of a read-only filesystem?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

So, are partitions on an SD card treated independently at the card level…?

No.

The partition table on an SD card is just a specific piece of data written to the first sector. It doesn't have any implications for the hardware, and most flash controllers on SD cards will ignore it.

There are essentially no bounds on what a buggy flash controller can do if the card is powered down while a write is in progress -- in a worst-case scenario, internal flash translation data could be corrupted, "bricking" the card. Even in less dramatic scenarios, data can potentially be corrupted in any location on the card.

In practical terms, keeping your read-only data isolated to a separate partition will usually be safer than keeping it on the same partition. But there are no guarantees, especially if you're using cheap cards.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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