Answer the question
In order to leave comments, you need to log in
Is it possible to remotely overwrite a memory card?
There is a Raspberry Pi 3, installed in a place that is not easily accessible, on the memory card of which Ubuntu Server is installed. Is it possible in any way (by a script/command) to "reset" the installed OS (in case, for example, of an incorrect OS/software setup, when it is easier to reinstall the entire OS than to clean out the tails, or replace Ubuntu Server with some other distribution) ? And if possible, how?
The following script (or commands separately) comes to mind for installing MikroTik CHR on any VPS:
CHR_VERSION=6.37
INSTALLPATH=/dev/vda
apt-get update &&
apt-get install -y unzip wget pv &&
wget http://download2.mikrotik.com/routeros/${CHR_VERSION}/chr-${CHR_VERSION}.img.zip &&
unzip chr-${CHR_VERSION}.img.zip &&
echo u > /proc/sysrq-trigger &&
pv chr-${CHR_VERSION}.img | dd of=$INSTALLPATH &&
reboot
Answer the question
In order to leave comments, you need to log in
Putting rpi in an hard-to-reach place is a shitty undertaking. Memory cards under the axis - consumables. Once it was required to roll up the controller under unify as a temporary crutch. The card died in 4 months.
I do not understand the situation in which you are going to use the OS reset. Modern computers are made in such a way that the operating system can be damaged so that it does not boot at all - damage the bootloader, and that's it. And access via the network appears only after loading the kernel and working out a significant number of scripts.
The following seems like a reasonable option:
well, you can try the following option -
either booting via PXE in case of failure to boot from the card,
or booting with option 2 from a USB flash drive on which some kind of liveCD is already raised
Your output is Docker.
Install the OS on the raspberry, docker on this OS and create a container (roughly speaking a virtual machine) with the OS you need. Do not touch the main OS under any circumstances, but with the one that is spinning in the container, you can do whatever you want, and when you decide to rearrange, delete the old container, and raise the new container from the image and that's it.
There is nothing complicated here. The docker documentation is good, there are a lot of videos about it on YouTube.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question