I'm experiencing frequent power failures in my simple low-cost surveillance system. Making the root partition read-only would be the best choice but I need to store cameras images somewhere.

What would be a better option?

  1. Shrinking the root partition, making it read-only, creating a new one for the camera's data (on the same SD card)
  2. Making whole SD card read-only, using another drive (like an USB stick) for the camera's data

I've read some topics/articles about read-only Raspberries but I didn't find any info about data protection when whole SD card is read-only vs only root partition on it. In other words, may data corruption on read-write partition cause some failure on the read-only root partition

  • @MatsK, actually I did and my current configuration is based on it. The article doesn't say anything about making only the main partition readonly though. In other words, may data corruption on read-write partition cause some failure on the read-only root partition. Sep 17, 2017 at 10:21
  • and where is the url?
    – MatsK
    Sep 17, 2017 at 10:45
  • What's the point of adding it? I'm not asking about fstab, logging, etc. Sep 17, 2017 at 10:50

1 Answer 1


I met almost the same problem a year ago and choose the first option: shrinking the main read-only partition and create a read-write partition for storing datas.

I had no case of SD corruption since, even on the storage partition, as I don't write continuously on it.

Instead of capturing videos on the storage partition, you can use a tmpfs filesystem, capture on it, then copy these chunks of video in the final storage partition. If the power fails, you will only lose the last few seconds of data that were stored in RAM.

To answer the question, I really doubt that a corruption of the storage partition may interfere with the root partition, but with the tmpfs buffer method, you will be safer than safe!

Storing everything on the SD card has some other great advantages: better data transfer speed, no USB reconnection syndrome, more reliability, less power consumption ...
The only bad point is the need to resize your partition, which may be a bit tedious. Don't forget to backup your SD card before shrinking!

  • Thanks for this great answer! :) I thought about storing images on tmpfs partition, but I use Raspberry W with only 512 mb of RAM. The images resolution is pretty low so maybe it's not a bad idea though. Sep 17, 2017 at 16:37
  • If your tmpfs is too small, the default behavior will be to overlap datas in the swap partition (if you still have one !). This lower the write speed, but keep the buffer approach feasible :) Sep 17, 2017 at 23:13
  • Can you share a link to the tutorial you used to make it happen?
    – ralien
    Mar 19, 2018 at 12:57
  • @Alex :I didn't kept the references, sorry:/ Mar 19, 2018 at 17:04

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.