Raspberry Pi Recovery Partition

The latest volume of MagPi is out and in addition to a lot of information about the RPi 4, there is a fascinating article about how to set up a recovery partition on your SD card and a script to restore the machine.

Many of us have used a Windows machine where there is a recovery partition on the hard drive. If you run into real trouble you can “factory reset” your hard drive by using that partition to restore your machine to what it looked like when you first got it. This tutorial (starting on page 48) shows how to set up something similar on an RPi. To kick off the recovery you short (with a resistor) two of the RPi’s pins (could probably be wired with a button) and it will recover your SD card to what ever state it was in with the image stored in the recovery partition.

I wonder if this is something that could be incorporated into openHABian. Obviously, with warnings that this will erase everything.

But even if it isn’t, this could be an easier way for those of us who have RPis scattered about as sensors to quickly recover when something goes bad short of the SD card wearing out, in which case replacing the card is the only thing to do.

1 Like

I bought a USB case and use an old laptop SSD. No SD Card needed :smiley:

1 Like

The tutorial above would still apply if you want a way to “factory reset” the RPi. There is nothing that makes it specific to SD cards.

And even with SSD/HDD, stuff can happen that can cause an RPi to become corrupted or unrecoverable (e.g. loss of power without shutting down).

2 Likes