Update Error 7 On Twrp


alkeshgamer

Members
Jul 10, 2016
5
11
Hello everyone,

I've been trying to flash the 6.6.30 rom on my Mi4 but everytime I do that I get error 7 on twrp.
I've been using latest TWRP 3.0.2.0 and the same also occurs on sMiui rom also.
But no error comes when I flash any CM based ROM.
So further I went into the updater-script to check the differences and found that miui roms has command
package_extract_dir while there is no such command in CM Roms.(Problem is not caused by the assert commands usually found)
I've been trying to figure the solution but no success.
No one else is getting such problems only me.

Please guide/help me on this.
 
Hey, I get a similar problem when trying to install stable 7.1.5.0 (kitkat). But only that version, while 7.1.3.0 installs fine. I also compared both updater scripts and found only little differences that shouldn't affect installation. Tried using 7.1.3.0 script with 7.1.5.0 and still got error 7. I'm leaning towards the possibility that there is not enough space in "system" to extract the rom because 7.1.5.0 is much bigger compared to 7.1.3.0.. no idea :)

Maybe your problem is something similar and has something to do with partitions. If you have data backed up and don't have a problem wiping everything I suggest you do advanced wipe in twrp and first try flashing an official china developer MM rom via fastboot with miflash tool so the partitions get rebuilt. Then wipe everythign again and install the 6.6.30.

Another way is to add this line before "flash tz..." in the flash_all.bat script of the developer rom:
Code:
fastboot %* flash partition %~dp0images\gpt_both0.bin
fastboot %* flash tz %~dp0images\tz.mbn
This is a sure way for the partitions to get rebuilt but this could brick your phone if something goes wrong.

And another clean way is to go to emergency mode via "adb reboot edl" command and flash the developer rom that way.
 
Hey, thanks for the help.
But I am getting the same error after flashing official ROM with fastboot and wiping everything.(Actually I posted this after the official ROM flashing and then wiping)
I'll be backing up everything and wiping the whole phone out, then perform the procedure again.
About that code I'll keep it as a last resort.
Thanks for the help
 
Install diskinfo app after flashing official rom to see if your partitions are good. In advanced options of diskinfo check more options so it shows stuff like unmounted partitions etc. There should only be one system partition and should be about 1.2gb if they were merged correctly (otherwise it will show two system partitions one of them probably unmounted). Then complete wipe and installation of 6.6.30 should work.

For my problem I mentioned it was exactly what I thought the system didn't have enough space to extract 7.1.5.0 (weird because it's kitkat) so I used last official MM global via fastboot. Also that flash partition line was already in the .bat file so didn't need to add it. Check if the line is present in your official version you flashed. It's still possible your partitions weren't built correctly.

In the end it's also possible that the 6.6.30 has something in update script... Did you check if it tries to flash custom twrp recovery too? One time I got insufficient arguments errors when the script was trying to install it so I deleted out those lines of code. You can flash the recovery separately afterwards anyway.
 
Currently flashing latest 6.7.7 Official China beta rom via fastboot. And yea that line is already present in it.
I'll install that app and check it afterwards.
Yes both ROMs tries to install the latest twrp image but it does that at then end of ROM installation so that might not be the issue maybe, but still I'll lookout for that.
Thanks for all the help till now, I'll let you know further
 
OK,
I checked with the app and partition is 1.2gb. Wiped everything but still getting error 7. The exact lines are like-
mount: no partition named "/dev/block/platform/msm_sdcc.1/by-name/userdata"
Target...release-keys
mount: no partition named "/dev/block/platform/msm_sdcc.1/by-name/system"
Failed to extract dir from "system" to "/system"
Updater process ended with ERROR: 7
 
Hey,
The sMiUi ROM worked nicely now, it's installed and running fine.
Thank you for all your help!!
 
This is what I do for the Error 7:

1) Wipe all from TWRP including system.
2) Install the rom .zip file
3) Error 7 comes up.
4) Reboot phone and go straight back into twrp
5) Flash the same .zip rom without wiping anything this time.

It should now work.