2017-03-19
While playing on my PiLab i was confronted to the restore my custom image of Raspbian whithout any physical manipulation on all RPIs. This was achieve with the RPI-mage scripts.
I order to do so I create another custom image with :
The game was to find an light OS and the size of the restore partition to allow the backup to be hosted. The idea of self restore was pretty simple.
On the working partition launch a script that will :
When arriving on the restore partition at the next boot:
After that, the RPI reboot on a the customized image like the first day.
The advantage of this method is that you don't need to touch the devices.
I expected some performance issue doing the backup/restore on the same microSD but not that much.
The first tests was around 100-150 ko/s to create or write the backup. So i inspire me with the rpi-clone project by adding an extra device (other microSD or HDD) on one of the Usb port.
Again some poor performances but this time for another reason. The light linux distribution is used (Moebius), use the busybox to emulate some usual tools like (dd, fsdik and so on). All these tools where also in light mod with some missing options i need. I change all the binaries that i need:
* dd
* fdisk
* sfdisk
* netcat
With these new tools i reach the 30 mo/s to backup and to restore the backup.
With these functionnalities, you will be able to backup a set of RPIs to keep your working lab in a secure place.