Project

General

Profile

Mistakenly flashed the recovery image to a working Replicant device. How to recover the system?

Added by Dmitriy Dmitriev over 3 years ago

I have a fully operational GT-N7100 with Replicant 6.0-0004-rc2 onboard (not encrypted) and I accidentally flashed a recovery image (Replicant 6.0-0004-rc3) by executing this in recovery mode:

heimdall flash --BOOT recovery-n7100.img --RECOVERY recovery-n7100.img

Now it only boots into recovery mode. Is there any chance I can get my system recovered or at least restore my data?


Replies (6)

RE: Mistakenly flashed the recovery image to a working Replicant device. How to recover the system? - Added by Kurtis Hanna over 3 years ago

Hello Dmitriy,

Sorry to hear about your situation. Hopefully we can help you out.

As a first step, can you let us know whether or not you are able to obtain root shell access via adb on your Replicant device when you boot into the recovery OS? You would have already needed to have set up ADB on your computer so that you can access a root shell on your device. Potentially you took that step when Replicant was working correctly for you and also checked "Always allow from this computer" when prompted after connecting your phone to your laptop or desktop. Here are the steps you would have already needed to have taken, perhaps it will help you remember if you did them or not: https://redmine.replicant.us/projects/replicant/wiki/ADB

If you are able to obtain root shell access via adb while in recovery, you should proceed to this step in our guide to Backing up the Data Partition: https://redmine.replicant.us/projects/replicant/wiki/BackupTheDataPartition#Making-sure-that-the-data-partition-isnt-mounted

From there, you should be able to move on to the step in that guide that lets you back up the data partition to your laptop. You can then see if your system and data can be recovered from the data partition you recovered from your phone.

There are other steps that can be taken to try to recover your system if the method laid out above doesn't work, but I figured I'd start here since it provides you with a local backup of your phone's data partition on your laptop or desktop, which is always nice to have in case issues like this happen again in the future.

In Solidarity,
Kurtis

RE: Mistakenly flashed the recovery image to a working Replicant device. How to recover the system? - Added by Dmitriy Dmitriev about 3 years ago

Hi Kurtis,

Thank you for your detailed response. I'm afraid, I've never checked that "Always allow from this computer" option, so the device I run adb on is unauthorized. Perhaps you could give me a clue if there is some workaround?

Sincerely,
Dmitry

RE: Mistakenly flashed the recovery image to a working Replicant device. How to recover the system? - Added by Kurtis Hanna about 3 years ago

Hello Dmitry,

While we have not thoroughly tested it yet for the two specific versions you are in between, it is expected that the data partition from 0004-rc2, which you have installed, is compatible with 0004-rc3, which you have the recovery installed for. This is articulated here: https://redmine.replicant.us/projects/replicant/wiki/MinorVersionUpgrade

I believe that you will need to use the microSD method to do the upgrade due to your particular situation. You can read our documentation on this method here: https://redmine.replicant.us/projects/replicant/wiki/InstallOrUpgradeFromMicroSD

We can not offer a guarantee, hence the reason why we always as people to backup their data partition first, but you should be able to install the replicant-6.0-0004-rc3-n7100.zip file while you are within the recovery image, using your microSD method, in order to return to a properly working and updated device that has all of your settings and data still intact.

Cordially,
Kurtis

RE: Mistakenly flashed the recovery image to a working Replicant device. How to recover the system? - Added by Denis 'GNUtoo' Carikli about 3 years ago

What Kurtis suggested should work though the upgrade between the RC has not been tested extensively yet.

Alternatively, there is a much more simple way that is safer:

The boot.img is actually in the replicant-6.0-0004-rc2-n7100.zip file, so you could simply unzip it and flash the boot.img with heimdall:

heimdall flash --BOOT boot.img --RECOVERY recovery-n7100.img

edit1: fixed typo

Denis.

RE: Mistakenly flashed the recovery image to a working Replicant device. How to recover the system? - Added by Dmitriy Dmitriev about 3 years ago

I successfully installed Replicant 6.0-0004-rc3 from an SD card, as Kurtis suggested. All my data seems to be intact. Thanks so much for your help guys.

RE: Mistakenly flashed the recovery image to a working Replicant device. How to recover the system? - Added by Kurtis Hanna about 3 years ago

Very happy to hear that your data seems to be intact. You're welcome for the help.

    (1-6/6)