I am wondering if it is possible to:
- Partition an SD card into two (or three including boot partition)
- Install PiOS on one partition that it boots on
- Boot the Pi and make various software adjustments on that main partition
- Backup the main partition to the other partition on the SAME SD card
- Make further changes to The main partition that results in undesired results
- Trigger some process that re-flashes the main partition from the backup partition
To be clear I do not want to make just a normal backup, I want it to be on the same SD card. Think of it as a factory reset.
The answer to this other question is NOT what I want to do (although the question itself seems the same/similar)
sudo dd if=/dev/mmcblk0 of=/some/file/name/here
if the /some directory is on a second partition that'll work. But I don't know how useful that willl be as when the SDCard fails the back will also fail.