Can't flash my recovery to TWRP on LineageOS

Search This thread

derKenny

Member
Apr 9, 2013
9
0
Nexus 7 (2013)
Huawei P20 Pro
Hello dear fellows,
since 2 days i try to fix a problem with my unlocked and rooted Sony Xperia Z C6603. Still not finding any solution via internet, i take my last chance and post it here.

I unlocked and rooted my C6603 2 days ago and installed via fastboot the actual Lineage Custom ROM lineage-14.1-20171027-nightly-yuga-signed.zip.
Everything worked fine.

Bootloader -> fastboot flash boot boot.img (from lineage-14.1-20171027-nightly-yuga-signed.zip) :good:
Restart into Android Recovery :good:
Install via ADB sideload lineage-14.1-20171027-nightly-yuga-signed.zip :good:
Install via ADB sideload LineageOS 14.1 ARM32 SU (for full root access) :good:
Boot into Lineage, activate dev options and enabled Android-Debugging + Root-Access -> Apps and ADB :good:

Now my problem:
The so called "Android Recovery" is rly bad, so i try to override this recovery with TWRP 3.0.2.0 (yuga) but everytime i get the following error:

Code:
fastboot flash recovery twrp.img
target didn't report max-download-size
sending 'recovery' (10656 KB)...
OKAY [  0.351s]
writing 'recovery'...
[B]FAILED (remote: Command not allowed)[/B]
finished. total time: 0.370s

Where is my fffffff problem^^ Yes my phone is unlocked and yes, it is rooted (checked it also via root app).
I cant install gapps (dont work with ADB sideload) and and i want a proper recovery for backups and stuff...

So, what is wrong with me? Maybe someone of you have a good idea and can help me, i would rly appreciate it!
Sry for my not so proper english, hope u understand my problem anyway :)

Phone information:
Sony Xperia Z C6603
Android 7.1.2
LineageOS 14.1-20171020-NIGHTLY-yuga
LineageOS API-Level Guava (7)
Kernel-Version 3.4.113-yuga-gd710842
Build-Number lineage-yuga-userbug 7.2.1 NJH47F f281cb28f4
 
Last edited:

derKenny

Member
Apr 9, 2013
9
0
Nexus 7 (2013)
Huawei P20 Pro
Thanx for all the help^^
I figured it out what to do:

1. fastboot flash boot twrp(actualversion).zip NOT fastboot flash recovery twrp(actualversion).zip
2. reboot into TWRP recovery mode
3. check if u can mount your data folder
3.1 if not, go to wipe -> advanced wipe -> change file system to ext4
4. install via ADB the actual LineageOS (or put the actual LineageOS file on your Sony/SD)
4. install LineageOS 14.1 SU via ADB (or put the actual LineageOS 14.1 SU file on your Sony/SD) -> https://www.lineageosroms.org/forums/topic/how-to-root-lineage-os-13-14-1-marshmallow-nougat-rom/
6. install Open gapps -> http://opengapps.org/
7. reboot and configure LineageOS
7.1 check your developer options -> Debugging + root access for ADB and apps
8. download TWRP apk via PlayStore
8.1 give TWRP apk root access and download the actual TWRP file for yuga
9. flash this TWRP recovery via app
10. DONE

Everything works fine (for now :D )

Topic can be closed!
 
Last edited:

nurps

Senior Member
Dec 8, 2008
902
79
Same problem here, filesystem is ext4, TWRP app says it flashed but after a reboot its not there.

Always have to go via "fastboot flash boot twrp.img" and on the next reboot after flashing lineage its gone again.

After some research I found it it belongs into the fota partition, but I dont seem to have one.
 
Last edited:

silverbluep

Member
Dec 13, 2017
37
7
OnePlus 7 Pro
Same problem here, filesystem is ext4, TWRP app says it flashed but after a reboot its not there.

Always have to go via "fastboot flash boot twrp.img" and on the next reboot after flashing lineage its gone again.

After some research I found it it belongs into the fota partition, but I dont seem to have one.

Did you manage to solve the issue? I have the exact problem. The TWRP says it flashed but recovery is still stock android.
 

silverbluep

Member
Dec 13, 2017
37
7
OnePlus 7 Pro
I have C6602. Someone on reddit gave me the solution; (do note that I had to run
Code:
adb root
for
Code:
su
to work.

You have a Xperia device which deals with recovery kind of weird. Recovery is stored with the kernel, not in a standalone recovery partition. Because of this you need to flash it to a FOTAKernel partition and use a kernel that supports FOTAKernel (the LineageOS one does).

To flash TWRP, first move the recovery image to your device with the adb command
Code:
adb push twrp-3.0.2-0-yuga.img /sdcard
. Then run
Code:
adb shell
to get access to the shell. Then run
Code:
su
and accept any prompts to gain root access. Then to actually flash, run
Code:
dd if=/sdcard/twrp-3.0.2-0-yuga.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel