Flashing TRWP (or any recovery) fails

Thank you guys, that shed some light on the issue… Yes I mixed up boot and recovery :flushed: It is some years a go that I tried this on a Samsung the last time, and with Samsung tools, so everything felt new to me again…

Nevertheless, flashing still did not work (and feels too quick);

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery c:\twrp-3.1.1-1-fp2.img
target reported max download size of 536870912 bytes
sending 'recovery' (12296 KB)...
OKAY [  0.390s]
writing 'recovery'...
OKAY [  0.148s]
finished. total time: 0.541s

As for an alternative to Minimal ADB, I installed the SDK platform tools as suggested, started sdkmanager, looked at the list of modules and figured it would be the build-tools;27.0.0.0 that might contain adb, but no success here either:

F:\AndroidSdk\tools\bin>sdkmanager build-tools;27.0.0.0
Warning: File C:\Users\myname\.android\repositories.cfg could not be loaded.
Warning: Failed to find package build-tools;27.0.0.0

I really feel stupid today and appreciate your help…

According to your fastboot output flashing TWRP worked fine. What happens when you boot into recovery?

It seems you installed the full SDK Manager. You only need the SDK Platform Tools which don’t require installation. Please read the linked page again, especially the section saying:

:slight_smile:

2 Likes

Thank you @ChuckMorris. I also thought flashing looks good, but booting into recovery showed the little green android with a warning sign and “Kein Befehl” = “no command”. I know a (textual) recovery from my Samsung, but nothing like this.

I now took the platform tools and get the following message:

F:\platform-tools>adb  reboot bootloader
adb server version (36) doesn't match this client (39); killing...
* daemon started successfully *
error: no devices/emulators found

(Trying to make every possible error I guess.) Do I need an older version? There seem to be no links to older versions, and the version history shows that the latest is 26.0.2, so I can’t find a reference to 36 or 39 anywhere.

Some other test that I tried:

F:\platform-tools>adb shell
error: no devices/emulators found

F:\platform-tools>fastboot devices
f8ef69f fastboot

So I think there might be an ADB version mismatch (see the post before) and/or a mssing driver on Windows (although the other SDB seems to work), but my phone is correctly connected. I have still no clue what is going wrong here.

The dead No command Android is the stock recovery, so obviously something went wrong when flashing TWRP.

You don’t need adb for flashing TWRP. Let’s do this step by step:

  • Turn off the phone.
  • Hold Vol- and push the power button. Keep holding Vol- for a few more seconds. Phone boots into bootloader / fastboot mode (shows only Fairphone logo).
  • Connect phone to PC and run fastboot flash recovery twrp-3.1.1-1-fp2.img. It is completely normal that this takes less than a second.
  • Disconnect phone from PC.
  • Hold Vol+. Hold power button until phone vibrates. Keep holding Vol+. Phone should boot into TWRP.
3 Likes

That’s great, @ChuckMorris, it worked!

Here is what I think has happened: I read in some other place that the OS might replace TWRP with the stock recovery, but did not understand that “no command” is the stock recovery (an no error). I relied on this TWRP thread which recommends booting the phone normally first, which might have overridden TWRP again.

I managed to start TWRP now and swiped along the bottom to allow TWRP modifications (which, as I understand it, modifies the OS to not override recovery). Rebooting into the system and then into TWRP again shows it is now installed permanently.

I think this is worth editing the TWRP wiki thread cited above, but this seems to be locked. Or it is worth adding to your own Howto on Magisk, which I will now follow further. Thank you again! :sunglasses:

Glad that it finally worked. The TWRP wiki post actually says that you have to boot right into recovery after flashing TWRP (in section 6.b) so no need to edit it. :slight_smile:

Also, you should not allow TWRP to modify the system partition. This could / will prevent future OTA updates.

Re-reading the TWRP wiki entry, I still understand it as booting into the normal OS first:

  1. Next we will flash the image to the FP2 by typing:
fastboot flash recovery c:\recovery.img

The flashing only takes some seconds and should not produce any errors.

  1. At last we will restart our FP2 by typing:
fastboot reboot

Your phone should start normally and flashing is complete.

6.b Verify that TWRP was permanently installed:

The reboot in step 6 (the second 1 above - citation messes this up) runs the normal OS, and I think this is what might have reinstalled the original recovery for me. But it may of course be just my way of reading it.

Oh well, and I misundertood the TWRP instructions in the other place that I can’t find anymore (not the FP community) in the way that I allowed TWRP to modify the system partition so that it could actually avoid the reinstallation of the original recovery. Not my day obviously. Is there any way to reverse the changes or revoke this decision otherwise?

Thank you again for your help - this is a great experience and for sure a big plus for the Fairphone!

Hi guys!

I m sorry, my english is bad…

I have some problemes with flashing the last TRWP version (twrp-3.2.1-0-FP2.img → Download TWRP for FP2)

I followed the advice of ChuckMorris:

But when I run the command fastboot flash recovery twrp-3.2.1-0-FP2.img the terminal say < waiting for device > and nothing happens…

First question: where should I file the file twrp-3.2.1-0-FP2.img?

My phone is on Debugg mod (? right in english?).

Thanx for your help!

First things first … make sure your phone is being recognized at all.

When your phone is in fastboot mode, then the command “fastboot devices” (Linux: perhaps better as root or using sudo) should output something.
Here’s a generic screenshot.

If the phone isn’t recognized, there will only be an empty line and you’ll be back on the command line.

If you don’t give an additional path to the file, then it has to be in the path where you execute the command from, but that doesn’t seem to be the issue here (would be “file not found” or something similar then).

Hi AnotherElk, tank you for your help!

Return of the order

fastboot devices
no permissions fastboot

But for

sudo fastboot devices
563147b9 fastboot

So yes, my phone is recognized. Right for you?

the ultimate goal is the installation of LineageOS (https://wiki.lineageos.org/devices/FP2/install)

So what does the flashing command say when you sudo fastboot flash … ?

It even says there: “Tip: If you see no permissions fastboot while on Linux or macOS, try running fastboot as root.”

fastboot flash recovery recovery.img
< waiting for device >

sudo fastboot flash recovery recovery.img
error: cannot load ‘recovery.img’

(I just tried to rename the file twrp …img)

OK. But I don’t understand this part… So my first question was: where should I file the file twrp-3.2.1-0-FP2.img? Because I think this is the problem…

I tried:

fastboot flash recovery /storage/emulated/0/twrp-3.2.1-0-fp2.img
< waiting for device >

And

sudo fastboot flash recovery /storage/emulated/0/twrp-3.2.1-0-fp2.img
error: cannot load '/storage/emulated/0/twrp-3.2.1-0-fp2.img'

Still a problem with the path?

You execute the fastboot command on your computer, and the command looks for the TWRP image on your computer.

/storage/emulated/0/ is a path on your phone.

Yes… It’s not correct?..
How do I proceed? Indicate the path to the file that is on my computer? I thought I understood that we had to put the file on the Fairphone…