We use 50 and more RPi's in our company and now we are in difficult situation because we have to write new image of system to each of those devices. From Raspbian to Docker system where is easy to manage; for example Raspbian.

This is one interesting question. Is there some option to rewrite the SD card on a running Pi over the network since the RPi will work from RAM ?

  • 1
    Possible duplicate of How to update multiple Pis at once?
    – goobering
    Aug 18, 2016 at 16:04
  • Yes, it's possible but not easy. Why do you need to write a new image? Can't you just upgrade the existing with apt-get etc? Aug 22, 2016 at 20:21
  • we want to upgrade all system under Docker => it is easy to manage all migrates etc... Aug 22, 2016 at 20:56

3 Answers 3


Likely you need a different distro to achieve this, one that runs from RAM. Otherwise you can't rewrite the entire SD card at once. My Nard SDK might be an option for this type of problem:

  • Yes it looks fine, but firstly I would have to change image of each rpi to Nard image :D. So it would not help. I looging for some solution when there is not need to unplug sd card from RPI Aug 23, 2016 at 12:30
  • You do not need to unplug your SD card. It's possible to migrate from Raspbian to Nard from a remote location. :) I can give you the instructions if you're interested. Aug 23, 2016 at 17:44
  • This information sounds great! I'm interested about it ;) Aug 24, 2016 at 6:53
  • Contact me via the email address at the Nard project website and I'll give you further info. Aug 24, 2016 at 9:01

The answer to your specific question, is NO.

It is possible to do however, I just said with your situation using stock Raspbian it is not possible. Sorry it has to come out like that but in your situation you are pretty much, in a situation that needs some thought now.

In order to rewrite the SD card you need to be able to boot the device into a "bootloader" type pre-environment. This pre environment can be something very simple like busy box, that would normally daisy chain loading the next OS on the SD card.

But when you need to upgrade your OS you trigger the bootloader to download a new image (so it needs networking too) and then a script to specifically overwrite a specific partition, with the correct config....

Yes.. its a load to take in but maybe your company should dedicate some time and think about this situation now before it gets worse.

Good Luck! :)

  • "In order to rewrite the SD card you need to be able to boot the device into a "bootloader" type pre-environment." -> This is not true at all. If you used a root filesystem on a USB device, you could unmount any/all partitions on the SD card and do whatever you want to it, including completely overwrite the entire thing with a new image, etc. However, you better make sure you do it properly or you won't be able to get it to reboot. Sans a USB based rootfs, you could use something RAM based as the other answer suggests.
    – goldilocks
    Oct 31, 2016 at 18:31
  • Sure, there are many ways to skin a cat :D (Happy Halloween) but end of the day, with his current setup the answer is NO. :( His company needs to do more R&D and sort it out them selves. There are a ton of other great ways of doing it without overwriting the entire OS.
    – Piotr Kula
    Oct 31, 2016 at 18:33
  • 1
    I agree the OP would probably be playing with fire and some more thinking or expertise is needed ;)
    – goldilocks
    Oct 31, 2016 at 18:35

Upgrading raspbian from jessie to buster.

Stop all processes you can without locking yourself out of the pi.

Use rsync --delete-before --delete -aHAXx to replace all files on the running system (one partition at a time). Replace files on the root partition last.

Remount filesystems read-only and reboot the pi:

echo u >/proc/sysrq-trigger

echo b >/proc/sysrq-trigger

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.