Does re-locking unlocked bootloader cause data wipe, or do I need to do that manually - Google Pixel 3 Questions & Answers

I unlocked my bootloader in order to flash the latest factory image...the factory image flash failed, fastboot was able to write the bootloader but nothing else got written. Until I figure out what went wrong, I want to re-lock the bootloader, which I know involves a data wipe (just like unlocking it). Do I need to wipe the data before I can re-lock the bootloader, or does the data just get wiped automatically when I re-lock it. I don't want to brick my phone because I re-lock it when it isn't stock, but if the re-lock is going to wipe the data automatically without a problem, then I'll just let it do that.
Any help here? Thanks!

RogerSC said:
I unlocked my bootloader in order to flash the latest factory image...the factory image flash failed, fastboot was able to write the bootloader but nothing else got written. Until I figure out what went wrong, I want to re-lock the bootloader, which I know involves a data wipe (just like unlocking it). Do I need to wipe the data before I can re-lock the bootloader, or does the data just get wiped automatically when I re-lock it. I don't want to brick my phone because I re-lock it when it isn't stock, but if the re-lock is going to wipe the data automatically without a problem, then I'll just let it do that.
Any help here? Thanks!
Click to expand...
Click to collapse
Relocking the bootloader DOES do a factory reset, but there are still risks with a relock since it sounds like at least some non-stock data got written. I would advise you figure out why the image failed instead of trying to use relock for a factory reset. Without seeing a screen capture or anything else, my 1st guess is that you didn't use the latest adb/fastboot platform tools. If so, that's an easy fix.

RogerSC said:
I unlocked my bootloader in order to flash the latest factory image...the factory image flash failed, fastboot was able to write the bootloader but nothing else got written. Until I figure out what went wrong, I want to re-lock the bootloader, which I know involves a data wipe (just like unlocking it). Do I need to wipe the data before I can re-lock the bootloader, or does the data just get wiped automatically when I re-lock it. I don't want to brick my phone because I re-lock it when it isn't stock, but if the re-lock is going to wipe the data automatically without a problem, then I'll just let it do that.
Any help here? Thanks!
Click to expand...
Click to collapse
Why did you want to flash the factory image and not sideload the OTA file or simply do a factory reset? What are you trying to do?

RogerSC said:
I unlocked my bootloader in order to flash the latest factory image...the factory image flash failed, fastboot was able to write the bootloader but nothing else got written. Until I figure out what went wrong, I want to re-lock the bootloader, which I know involves a data wipe (just like unlocking it). Do I need to wipe the data before I can re-lock the bootloader, or does the data just get wiped automatically when I re-lock it. I don't want to brick my phone because I re-lock it when it isn't stock, but if the re-lock is going to wipe the data automatically without a problem, then I'll just let it do that.
Any help here? Thanks!
Click to expand...
Click to collapse
I would highly recommend that you DO NOT lock the bootloader until you get this sorted and completely stock. If you lock it you may never get the device running. It sounds to me like you don't not have the latest sdk platform tools (adb & fastboot). Things don't flash properly or at all without them. You need r28.
Sent from my [device_name] using XDA-Developers Legacy app

Here are the versions of adb and fastboot that I have (Minimal ADB and Fastboot):
C:\Program Files (x86)\Minimal ADB and Fastboot>adb --version
Android Debug Bridge version 1.0.39
Version 0.0.1-4500957
Installed as C:\Program Files (x86)\Minimal ADB and Fastboot\adb.exe
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot --version
fastboot version 0.0.1-4500957
Installed as C:\Program Files (x86)\Minimal ADB and Fastboot\fastboot.exe
Click to expand...
Click to collapse
Thanks for the thoughts about not re-locking the bootloader until I get the factory image flashed correctly, that was my original intent. But I'm not sure how long it will take me to figure that out, and how many more runs at this that I want to take.
As to how I got here, I noticed a few days ago that my idle battery usage had jumped up to over 2% per hour from about 0.5% per hour. I try to keep minimal apps on my phone, no reason that I could see for this jump. So I fiddled with settings for some time, and couldn't get the battery consumption back to where it was. I got rid of a few apps that I was carrying around for when I was traveling, and that didn't help. So I did a full factory reset to defaults, and reconfigured the phone manually, without using a backup. No difference. So I tried a factory default reset one more time, and made a really minimal configuration, not including even the Nova Launcher that I had switched to shortly after getting the phone. That didn't help the idle battery usage. At this point I figured I'd try sideloading the latest OTA, which I did. That really did help, but still not back to where I knew I the phone could be. I waited a day to see where things ended up, since I'm aware of the process of a new OS having to do a bunch of work to feel at home on a phone *smile*.
So here's where my thinking went off the rails, it would seem *smile*...I decided to unlock the boot loader to flash the latest full factory image and wipe my data. As I've done before with other phones. And then basically start from ground 0. That should give me the "best" results, in my mind. So I did that, unlocked the bootloader, but writing the factory image failed. In retrospect, I most likely should have given the OTA image more time to settle out, and have learned from jumping to the "best" solution before exhausting the potential of what should be an equivalent solution (an OTA with a factory reset to defaults).
At any rate, yes, I'll spend some time trying to figure out what I'm missing here, how to get the factory image flash to work. I'm not paranoid about having my bootloader unlocked, I just don't like the idea *smile*.
Thanks.

RogerSC said:
Here are the versions of adb and fastboot that I have (Minimal ADB and Fastboot):
Thanks for the thoughts about not re-locking the bootloader until I get the factory image flashed correctly, that was my original intent. But I'm not sure how long it will take me to figure that out, and how many more runs at this that I want to take.
As to how I got here, I noticed a few days ago that my idle battery usage had jumped up to over 2% per hour from about 0.5% per hour. I try to keep minimal apps on my phone, no reason that I could see for this jump. So I fiddled with settings for some time, and couldn't get the battery consumption back to where it was. I got rid of a few apps that I was carrying around for when I was traveling, and that didn't help. So I did a full factory reset to defaults, and reconfigured the phone manually, without using a backup. No difference. So I tried a factory default reset one more time, and made a really minimal configuration, not including even the Nova Launcher that I had switched to shortly after getting the phone. That didn't help the idle battery usage. At this point I figured I'd try sideloading the latest OTA, which I did. That really did help, but still not back to where I knew I the phone could be. I waited a day to see where things ended up, since I'm aware of the process of a new OS having to do a bunch of work to feel at home on a phone *smile*.
So here's where my thinking went off the rails, it would seem *smile*...I decided to unlock the boot loader to flash the latest full factory image and wipe my data. As I've done before with other phones. And then basically start from ground 0. That should give me the "best" results, in my mind. So I did that, unlocked the bootloader, but writing the factory image failed. In retrospect, I most likely should have given the OTA image more time to settle out, and have learned from jumping to the "best" solution before exhausting the potential of what should be an equivalent solution (an OTA with a factory reset to defaults).
At any rate, yes, I'll spend some time trying to figure out what I'm missing here, how to get the factory image flash to work. I'm not paranoid about having my bootloader unlocked, I just don't like the idea *smile*.
Thanks.
Click to expand...
Click to collapse
I'm 90% sure that the problem is you don't have the latest fastboot. So make sure you download the r28 revision of the sdk tools. With the older version somethings will flash, like the bootloader, but the rest will fail.
Sent from my [device_name] using XDA-Developers Legacy app

jd1639 said:
I'm 90% sure that the problem is you don't have the latest fastboot. So make sure you download the r28 revision of the sdk tools. With the older version somethings will flash, like the bootloader, but the rest will fail.
Sent from my [device_name] using XDA-Developers Legacy app
Click to expand...
Click to collapse
Can you or someone else please point me at a download of the r28 revision of the sdk tools? Or should I try the latest version of Android Studio rather than the latest Minimal ADB and Fastboot that's worked for me in the past? I should be able to find these tools myself, but I'm not connecting with this version...must not be using the right google search strings *smile*.
Update: Never mind:
https://developer.android.com/studio/releases/platform-tools

RogerSC said:
Can you or someone else please point me at a download of the r28 revision of the sdk tools? Or should I try the latest version of Android Studio rather than the latest Minimal ADB and Fastboot that's worked for me in the past? I should be able to find these tools myself, but I'm not connecting with this version...must not be using the right google search strings *smile*.
Click to expand...
Click to collapse
Minimal adb is not updated. Just Google sdk platform tools. It's a zip file. Just extract it and put it all where ever your fastboot is now and over write your existing fastboot and adb.
Sent from my [device_name] using XDA-Developers Legacy app

RogerSC said:
Can you or someone else please point me at a download of the r28 revision of the sdk tools? Or should I try the latest version of Android Studio rather than the latest Minimal ADB and Fastboot that's worked for me in the past? I should be able to find these tools myself, but I'm not connecting with this version...must not be using the right google search strings *smile*.
Update: Never mind:
https://developer.android.com/studio/releases/platform-tools
Click to expand...
Click to collapse
https://developer.android.com/studio/releases/platform-tools

jd1639 said:
Minimal adb is not updated. Just Google sdk platform tools. It's a zip file. Just extract it and put it all where ever your fastboot is now and over write your existing fastboot and adb.
Sent from my [device_name] using XDA-Developers Legacy app
Click to expand...
Click to collapse
Okay, did that, and re-flashed...seemed to go all the way through, but I see that my data was not wiped by "flash-all". That doesn't seem right. So I tried to run flash-all again to get the messages, but got this instead:
Code:
C:\adb>adb reboot bootloader
C:\adb>fastboot devices
89UX0H5VY fastboot
C:\adb>flash-all
Sending 'bootloader_a' (8489 KB) FAILED (Write to device failed in SendBuffer() (Too many links))
Finished. Total time: 0.312s
rebooting into bootloader FAILED (Write to device failed (Unknown error))
Finished. Total time: 5.000s
Sending 'radio' (71148 KB) FAILED (Write to device failed (Unknown error))
Finished. Total time: 15.015s
rebooting into bootloader FAILED (Write to device failed (Unknown error))
Finished. Total time: 5.029s
extracting android-info.txt (0 MB) to RAM...
fastboot: error: device doesn't have required partition product!
Press any key to exit...
So now I'm wondering:
1. What happened to the partitions, and how can I restore them?
2. How can I tell if the factory flash worked, despite not wiping my data?
Luckily my phone is still working as it was. And I still have the dream of getting it back to stock *smile*.
Thanks.

RogerSC said:
Okay, did that, and re-flashed...seemed to go all the way through, but I see that my data was not wiped by "flash-all". That doesn't seem right. So I tried to run flash-all again to get the messages, but got this instead:
Code:
C:\adb>adb reboot bootloader
C:\adb>fastboot devices
89UX0H5VY fastboot
C:\adb>flash-all
Sending 'bootloader_a' (8489 KB) FAILED (Write to device failed in SendBuffer() (Too many links))
Finished. Total time: 0.312s
rebooting into bootloader FAILED (Write to device failed (Unknown error))
Finished. Total time: 5.000s
Sending 'radio' (71148 KB) FAILED (Write to device failed (Unknown error))
Finished. Total time: 15.015s
rebooting into bootloader FAILED (Write to device failed (Unknown error))
Finished. Total time: 5.029s
extracting android-info.txt (0 MB) to RAM...
fastboot: error: device doesn't have required partition product!
Press any key to exit...
So now I'm wondering:
1. What happened to the partitions, and how can I restore them?
2. How can I tell if the factory flash worked, despite not wiping my data?
Luckily my phone is still working as it was. And I still have the dream of getting it back to stock *smile*.
Thanks.
Click to expand...
Click to collapse
I'm sure all your partitions are still there. Did you edit the flash all to remove the -w? If you didn't I'm very surprised that it didn't wipe your device. I don't know what happened the second time you flashed. Possibly a bad USB cable, I don't know. But your device boots up ok?
Sent from my [device_name] using XDA-Developers Legacy app

jd1639 said:
I'm sure all your partitions are still there. Did you edit the flash all to remove the -w? If you didn't I'm very surprised that it didn't wipe your device. I don't know what happened the second time you flashed. Possibly a bad USB cable, I don't know. But your device boots up ok?
Sent from my [device_name] using XDA-Developers Legacy app
Click to expand...
Click to collapse
Yes, my phone still boots fine, and looks good. I tried flash-all again (haven't removed the "-w"), and got the same output as the above. So I'm really wondering what's going on here. I did reboot my phone between getting the quoted output above and then getting the same output with a second try.
Okay, just tried again, and this time different results, but still failures after a certain point. Got more output the first time, but again, no data wipe, so I don't think that worked, either. Seems like this should just work, but no:
Code:
C:\adb>fastboot devices
89UX0H5VY fastboot
C:\adb>flash-all
Sending 'bootloader_a' (8489 KB) OKAY [ 0.297s]
Writing 'bootloader_a' (bootloader) Flashing Pack version b1c1-0.1-5034669
(bootloader) Flashing partition table for Lun = 0
(bootloader) Flashing partition table for Lun = 1
(bootloader) Flashing partition table for Lun = 2
(bootloader) Flashing partition table for Lun = 4
(bootloader) Flashing partition table for Lun = 5
(bootloader) Flashing partition msadp_a
(bootloader) Flashing partition xbl_a
(bootloader) Flashing partition xbl_config_a
(bootloader) Flashing partition aop_a
(bootloader) Flashing partition tz_a
(bootloader) Flashing partition hyp_a
(bootloader) Flashing partition abl_a
(bootloader) Flashing partition keymaster_a
(bootloader) Flashing partition cmnlib_a
(bootloader) Flashing partition cmnlib64_a
(bootloader) Flashing partition devcfg_a
(bootloader) Flashing partition qupfw_a
(bootloader) Flashing partition storsec_a
(bootloader) Flashing partition logfs
OKAY [ 0.284s]
Finished. Total time: 0.774s
rebooting into bootloader OKAY [ 0.062s]
Finished. Total time: 0.062s
Sending 'radio_a' (71148 KB) FAILED (Write to device failed in SendBuffer() (Too many links))
Finished. Total time: 0.871s
rebooting into bootloader FAILED (Write to device failed (Unknown error))
Finished. Total time: 5.027s
extracting android-info.txt (0 MB) to RAM...
fastboot: error: device doesn't have required partition product!
Press any key to exit...
No idea where to go from here with these failures, and then that final message about partitions...

RogerSC said:
Yes, my phone still boots fine, and looks good. I tried flash-all again (haven't removed the "-w"), and got the same output as the above. So I'm really wondering what's going on here. I did reboot my phone between getting the quoted output above and then getting the same output with a second try.
Okay, just tried again, and this time different results, but still failures after a certain point. Got more output the first time, but again, no data wipe, so I don't think that worked, either. Seems like this should just work, but no:
Code:
C:\adb>fastboot devices
89UX0H5VY fastboot
C:\adb>flash-all
Sending 'bootloader_a' (8489 KB) OKAY [ 0.297s]
Writing 'bootloader_a' (bootloader) Flashing Pack version b1c1-0.1-5034669
(bootloader) Flashing partition table for Lun = 0
(bootloader) Flashing partition table for Lun = 1
(bootloader) Flashing partition table for Lun = 2
(bootloader) Flashing partition table for Lun = 4
(bootloader) Flashing partition table for Lun = 5
(bootloader) Flashing partition msadp_a
(bootloader) Flashing partition xbl_a
(bootloader) Flashing partition xbl_config_a
(bootloader) Flashing partition aop_a
(bootloader) Flashing partition tz_a
(bootloader) Flashing partition hyp_a
(bootloader) Flashing partition abl_a
(bootloader) Flashing partition keymaster_a
(bootloader) Flashing partition cmnlib_a
(bootloader) Flashing partition cmnlib64_a
(bootloader) Flashing partition devcfg_a
(bootloader) Flashing partition qupfw_a
(bootloader) Flashing partition storsec_a
(bootloader) Flashing partition logfs
OKAY [ 0.284s]
Finished. Total time: 0.774s
rebooting into bootloader OKAY [ 0.062s]
Finished. Total time: 0.062s
Sending 'radio_a' (71148 KB) FAILED (Write to device failed in SendBuffer() (Too many links))
Finished. Total time: 0.871s
rebooting into bootloader FAILED (Write to device failed (Unknown error))
Finished. Total time: 5.027s
extracting android-info.txt (0 MB) to RAM...
fastboot: error: device doesn't have required partition product!
Press any key to exit...
No idea where to go from here with these failures, and then that final message about partitions...
Click to expand...
Click to collapse
Something is not right at all with the flash. The output you posted is not close to what it should be. Are you sure you downloaded the right factory image? There's one that's domco, or something like that, which is not the correct one. That's for the Japanese pixel 3. I'm not sure if this will post correctly but the latest pixel 3 factory image is, Link
Edit, https://dl.google.com/dl/android/aosp/blueline-pq1a.181205.006-factory-af1829a6.zip
Sent from my [device_name] using XDA-Developers Legacy app

jd1639 said:
Something is not right at all with the flash. The output you posted is not close to what it should be. Are you sure you downloaded the right factory image? There's one that's domco, or something like that, which is not the correct one. That's for the Japanese pixel 3. I'm not sure if this will post correctly but the latest pixel 3 factory image is, Link
Edit, https://dl.google.com/dl/android/aosp/blueline-pq1a.181205.006-factory-af1829a6.zip
Sent from my [device_name] using XDA-Developers Legacy app
Click to expand...
Click to collapse
Okay, did only two things:
1. Moved USB cable to a USB 2.0 port instead of USB 3.0 port.
2. Re-extracted the above .zip file (I did have the right one, by the way *smile*).
Not sure which one was the determining factor, but neither should have been a problem, by all rights.
The short story is that the full factory image flashed fine this time, and I've re-locked the bootloader on my phone.
Now, all I have to do is re-configure my phone, since data was wiped as expected this time around...I'm fine with that *smile*.
Now that was easy...great illustration of how dangerous a little knowledge can be in my hands *smile*.
Thanks for your patience, appreciate it.

Related

Encryption Unsuccessful - after Fastboot Flash of MZ600_HRI39

Okay so I seem to be bricked in some way. I've tried fastboot flash a couple times using OEM images "MZ600-HRI39" I have the MZ600 so that should be correct. Attached is my log of what I did, I eventually tried erasing each partition and rebooting to see if that changes anything, theoretically I thought I should be stuck since everything should be erased. However, I still get the Encryption Unsuccessful screen. Went back to recovery and tried wipe/user data and cache get BP fail with user data wipe and tried e: dev a few times before it stops. Then reboot and same. Any help or suggestions would be great. Thanks in advance.
P.S. I just want to get a stock IMG in so I can OTA to current; trying to keep stock so I can exchange at BB for newer tablet.
I just kept the log short only showing I erased each partition, but pretty much same result with flashes. All performed and got OKAY.
I think I got it. So you erased all the partitions... No problems when erasing data and cache, but the worst error you did was erasing "boot" and "recovery", so what I recommend you to do is:
1 - (easier way) download LordAIOTool for LINUX! (Windows is outdated...) and use Stock Install tool
2 - (harder way) follow this guide:
- Open cmd
- Plug your Xoom on fastboot
- go to Stock Files folder
- type fastboot flash (not sure if it's flash or install, anyway, I think it's flash ) boot boot.img (if downloaded from Motorola)
- type fastboot flash system system.img
- type fastboot continue
- Pray lol
Now all I wish to you is Good Luck
Sent from my 3g JB Xoom - By the 1st Xoom RC
XxLordxX said:
I think I got it. So you erased all the partitions... No problems when erasing data and cache, but the worst error you did was erasing "boot" and "recovery", so what I recommend you to do is:
1 - (easier way) download LordAIOTool for LINUX! (Windows is outdated...) and use Stock Install tool
2 - (harder way) follow this guide:
- Open cmd
- Plug your Xoom on fastboot
- go to Stock Files folder
- type fastboot flash (not sure if it's flash or install, anyway, I think it's flash ) boot boot.img (if downloaded from Motorola)
- type fastboot flash system system.img
- type fastboot continue
- Pray lol
Now all I wish to you is Good Luck
Sent from my 3g JB Xoom - By the 1st Xoom RC
Click to expand...
Click to collapse
Okay I used CMD since I have more experience with DOS than Linux:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\>fastboot devices
161c10c9434122d7 fastboot
C:\>fastboot flash boot boot.img
sending 'boot' (8192 KB)...
OKAY [ 0.731s]
writing 'boot'...
OKAY [ 0.587s]
finished. total time: 1.323s
C:\>fastboot flash system system.img
sending 'system' (262144 KB)...
OKAY [ 19.190s]
writing 'system'...
OKAY [ 6.427s]
finished. total time: 25.621s
C:\>fastboot continue
resuming boot...
FAILED (remote: (00120000))
finished. total time: 0.126s
C:\>fastboot continue
resuming boot...
FAILED (remote: (00120000))
finished. total time: 0.120s
C:\>fastboot reboot
rebooting...
finished. total time: 0.117s
***I still get to Encryption Unsuccessful screen.....my thing is I don't even feel like it's flashing over anything, but not sure if that's possible. Almost like some write protection to the partitions.
Any other suggestions or does anyone need a paper weight?
not sure if this means anything either or gives a better ideal of the state of the device, but when I try wipes i get.."E:format_volume: make_extf4fs failed on /dev/block/platform/sdhci-tegra.3/by-name/cache" yet it states cache wipe complete. Then a bunch of failed to mount and can't open.
Try reflashing a custom recovery and with it try formating everything... Then try again everything from my other post again good luck
Sent from my 3g JB Xoom - By the 1st Xoom RC
I've tried custom recovery, via fastboot flash recovery "recovery".img with no luck. It doesn't stick. Do you have any experience with RSD?
g14life said:
I've tried custom recovery, via fastboot flash recovery "recovery".img with no luck. It doesn't stick. Do you have any experience with RSD?
Click to expand...
Click to collapse
What do you mean with It doesn't stick?
Can you get into the recovery menu?
You could also do a oem lock and oem ulock again.
Then reflash everything again (boot, system, recovery if needed).
I go to flash with fastboot and when I try to access via power button, then volume down button I just back to OEM recovery. Was thinking if I try to rebuild system from bottom up that should clear everything out (bootloader, then IMG files). Was wondering if RSD would do that?
just noticed this in recovery when I perform wipe cache partition I get this message "E: format_volume: make_extf4fs failed on /dev/block/platform/sdhci-tegra.3/by-name/cache cache wipe complete".
So frustrated right now.....REALLY appreciate all the help!
Lord do you know how to enable USB debugging from fastboot, RSD, or OEM recovery? Found a forum mentioning a lock if OTA updates performed.
http://www.arvydas.co.uk/2012/05/installing-android-4-0-3-ice-cream-sandwich-ics-on-motorola-xoom/

Bootloop! Unable to flash stock rom or lock bootloader (Help)

Hi. I can't get passed the google splash screen on a Nexus 5 D821 and could use some help.
Here are the facts:
* The owner of the device told me it bricked after an update.
* The Bootloader is unlocked. When i tried to lock i got the following message:
Code:
fastboot oem lock
...
OKAY [ 0.041s]
finished. total time: 0.041s
But it wasnt persistent. When given reboot comand the phone switched OFF instead. I turned it on to bootloader again and it was still unlocked.
* I tried flashing stock rom LRX22c manually after a failed attempt with the flash-all script. I got the following error for bootloader, radio, boot and recovery:
Code:
FAILED (remote: flash write failure)
* I tried erasing cache and flashing userdata but the after over 60 minutes waiting i came to the conclusion that i wasnt going anywhere and just rebooted the phone.
*The only thing im actually able to flash without an error message is system.img:
Code:
fastboot flash system ~/Downloads/hammerhead-lrx22c/image-hammerhead-lrx22c/system.img
target reported max download size of 1073741824 bytes
erasing 'system'...
OKAY [ 0.127s]
sending 'system' (981472 KB)...
OKAY [ 30.934s]
writing 'system'...
OKAY [ 62.705s]
finished. total time: 93.767s
* I tried booting TWRP, but i was unable to mount the file system (perhaps because i wasnt able to flash it. i used "fastboot boot twrp.img").
Are phones technically able to get to splash screen or bootloader with a damaged NAND or EEMC chip? Im starting to consider the possibility of a hardbrick. Why would i be able to write system.img if that was the case though? Any help is welcome
===============================================
alright so im pretty sure its a hard brick. The emmc is dead. its a shame :/ guess ill just try to sell it for parts. I would delete this thread because its pretty useless, but i have created my account a few days ago, and i ddont know how to.
You've only flashed the system img?
Do all the img's one by one. Recovery, boot, system, radio, userdata. Then fastboot reboot
Sent from my Nexus 5 using Tapatalk
Ben36 said:
You've only flashed the system img?
Do all the img's one by one. Recovery, boot, system, radio, userdata. Then fastboot reboot
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
I have tried all of the imgs in their respective order. they all failed. i got the error
Code:
FAILED (remote: flash write failure)
. system.img was the only .img i was able to write, and i was wondering why. Also, when i try fastboot reboot the phone switches off. It doesnt reboot.

Phone bootlooping on Mi logo after updating firmware, unable to go into recovery

I was using official Lineage 14.1 on Lollipop bootloader with firmware libra_miui_v8120_fw_patch, then today stupidly decided to update firmware with libra-firmware_miui9-7.8.21_7.0.zip which is probably for Nougat bootloader. Now I am unable to go into recovery and also when trying to flash recovery through fastboot I end up with this:
Code:
fastboot flash recovery twrp.img
target reported max download size of 536870912 bytes
sending 'recovery' (40704 KB)...
OKAY [ 1.343s]
writing 'recovery'...
FAILED (remote: Partition flashing is not allowed)
finished. total time: 1.362s
So can't even flash recovery. Fastboot oem unlock ends up with this:
Code:
FAILED (remote: Token verification failed, reboot the device)
finished. total time: 0.031s
tried also flashing logo.bin into bk2 just to verify if partition is logged and end up with same issue as with recovery, apparently bootloader locked:
Code:
fastboot flash bk2 logo.bin
target reported max download size of 536870912 bytes
sending 'bk2' (9591 KB)...
OKAY [ 0.329s]
writing 'bk2'...
FAILED (remote: Partition flashing is not allowed)
finished. total time: 0.341s
Is there any way to flash through fastboot just firmware and get back to where I was before screwed update so I don't need to go through flashing fastboot MIUI ROM, losing all my data in phone and setting up phone from scratch? At least in worst case I hope that's an option and it would work just to flash old libra_images_6.1.7_20151221.0000.11_5.1_cn_b09dac70a0, then do oem unlock flash TWRP and the go to lineage, as i did without official unlocking before, but I would rather avoid this since I have still some data not backed up in the phone (luckily i backed up photos just before flashing).
EDIT: Or is there a way to at least back up my data out of phone through fastboot?
EDIT 2: according google results not possible to do backup through fastboot and according fastboot oem device-info it's locked bootloader, so back to square one, losing files, grr and start from scratch
https://www.google.ro/amp/s/forum.x...-unlocking-mi4c-bl-verification-t3336779/amp/
Steps 2 to 9. It should work.
Might be another way to save your data but I didn't found one. Maybe your pc will se your folders in fastboot so you can save the data.
Sent from my Mi-4c using Tapatalk
You can also try to unlock the bootloader the official way, then install TWRP and flash a lollipop firmware zip with the lollipop bootloader and try to boot your ROM that way. The zip floats around in one of the ROM threads.
cezarmed2 said:
https://www.google.ro/amp/s/forum.x...-unlocking-mi4c-bl-verification-t3336779/amp/
Steps 2 to 9. It should work.
Might be another way to save your data but I didn't found one. Maybe your pc will se your folders in fastboot so you can save the data.
Sent from my Mi-4c using Tapatalk
Click to expand...
Click to collapse
yeah, I did that as usual when unlocking unofficially, but there is no way to see your data, though in miflash it says in bottom "save user data" but nothing was saved, I looked through all phone, can't find it anywhere
OK, I noticed another issue, my available space significantly shrank. I guess it's because during fastboot oem edl flashing fastboot MIUI dev ROM through miflash I left "keep user data" checked instead erase, hoping I can recover them somehow.
Now Settings/Storage shows me that my System takes 21GB out of all 29GB, which is nonsense, since it's pretty much fresh system with few apps and little data used.
So my question is, can I somewhere find my original user data taking all this space and manage them? Or is user data partition (internal storage) somehow corrupted and I should just format it and this should hopefully fix problem with lack of free space (although Settings are showing System is taking all the 21GB)? In Mixplorer Internal storage is showing capacity 7.75GB and Root 1.82GB, so I would think it's corrupted internal storage which should be formatted, although best would be if original data would be somewhere hidden and I could just delete them manually.
EDIT: SOLVED - go to TWRP / Wipe / select Data / Repair button / Resize / and partition was properly resized from 7900MB back to 26136MB without loss of current data, of course original data from before are gone, but I am already over it.

Trying to root with Android 8.0

So I've been using this guide to finally try and root my Pixel on 8.0: {apparently I can't post links yet, but google "how to root google pixel droidviews" and it's the first link}
I'm able to get adb to recognize the phone, however, when I go to use the command "fastboot boot recovery twrpOreo.img", the console says "cannot boot 'recovery': No such file or directory". So then I did some googling and tried the command "fastboot flash recovery twrpOreo.img" to which the console spits out:
C:\adb>fastboot flash recovery twrpOreo.img
target reported max download size of 536870912 bytes
sending 'recovery' (26029 KB)...
OKAY [ 0.701s]
writing 'recovery'...
(bootloader) Command is not supported.
(bootloader) Please unlock device to enable this command.
FAILED (remote failure)
finished. total time: 0.802s
All the while the screen on the phone says:
Console: DISABLED
Secure Boot: PRODUCTION
Device is LOCKED
So it says the device is locked but I triple checked, and I unlocked the bootloader under developer settings? Can anyone help me out here?
Kew01 said:
So I've been using this guide to finally try and root my Pixel on 8.0: {apparently I can't post links yet, but google "how to root google pixel droidviews" and it's the first link}
I'm able to get adb to recognize the phone, however, when I go to use the command "fastboot boot recovery twrpOreo.img", the console says "cannot boot 'recovery': No such file or directory". So then I did some googling and tried the command "fastboot flash recovery twrpOreo.img" to which the console spits out:
C:\adb>fastboot flash recovery twrpOreo.img
target reported max download size of 536870912 bytes
sending 'recovery' (26029 KB)...
OKAY [ 0.701s]
writing 'recovery'...
(bootloader) Command is not supported.
(bootloader) Please unlock device to enable this command.
FAILED (remote failure)
finished. total time: 0.802s
All the while the screen on the phone says:
Console: DISABLED
Secure Boot: PRODUCTION
Device is LOCKED
So it says the device is locked but I triple checked, and I unlocked the bootloader under developer settings? Can anyone help me out here?
Click to expand...
Click to collapse
There is no recovery partition on a Pixel. It's now part of the boot partition. Make sure unlock is toggled in Dev settings. Remember, it will wipe your data. Then
fastboot flashing unlock
Follow the real directions here
https://developers.google.com/android/images
Kew01 said:
So I've been using this guide to finally try and root my Pixel on 8.0: {apparently I can't post links yet, but google "how to root google pixel droidviews" and it's the first link}
I'm able to get adb to recognize the phone, however, when I go to use the command "fastboot boot recovery twrpOreo.img", the console says "cannot boot 'recovery': No such file or directory". So then I did some googling and tried the command "fastboot flash recovery twrpOreo.img" to which the console spits out:
C:\adb>fastboot flash recovery twrpOreo.img
target reported max download size of 536870912 bytes
sending 'recovery' (26029 KB)...
OKAY [ 0.701s]
writing 'recovery'...
(bootloader) Command is not supported.
(bootloader) Please unlock device to enable this command.
FAILED (remote failure)
finished. total time: 0.802s
All the while the screen on the phone says:
Console: DISABLED
Secure Boot: PRODUCTION
Device is LOCKED
So it says the device is locked but I triple checked, and I unlocked the bootloader under developer settings? Can anyone help me out here?
Click to expand...
Click to collapse
You skipped a step. You also need to issue the fastboot command to unlock it.
This will WIPE your phone. No way around that.
fastboot flashing unlock
TonikJDK said:
You skipped a step. You also need to issue the fastboot command to unlock it.
This will WIPE your phone. No way around that.
fastboot flashing unlock
Click to expand...
Click to collapse
Damn, really? There's no way to preserve my data? I know I can back up my photos/docs and **** but I'd sacrifice a lot of app data/preferences by wiping.
Kew01 said:
Damn, really? There's no way to preserve my data? I know I can back up my photos/docs and **** but I'd sacrifice a lot of app data/preferences by wiping.
Click to expand...
Click to collapse
This is why you should unlock the phone as soon as you buy it.
So maybe a dumb question but I'm new to all this. Is there any way I could completely backup a clone of my phone's data, and then restore it after root, so that everything is just as it was, except now I have root privileges?
Kew01 said:
So maybe a dumb question but I'm new to all this. Is there any way I could completely backup a clone of my phone's data, and then restore it after root, so that everything is just as it was, except now I have root privileges?
Click to expand...
Click to collapse
No. You can do this once you are rooted and have TWRP but not before. Just back up your important data and go for it.
Kew01 said:
Damn, really? There's no way to preserve my data? I know I can back up my photos/docs and **** but I'd sacrifice a lot of app data/preferences by wiping.
Click to expand...
Click to collapse
Isn't app data automatically backed up on Google servers? Or am I recalling it wrongly?
Golf c said:
There is no recovery partition on a Pixel. It's now part of the boot partition. Make sure unlock is toggled in Dev settings. Remember, it will wipe your data. Then
fastboot flashing unlock
Follow the real directions here
https://developers.google.com/android/images
Click to expand...
Click to collapse
Whenever I click "Acknowledge" on the page, the page just reloads?
Golf c said:
There is no recovery partition on a Pixel. It's now part of the boot partition. Make sure unlock is toggled in Dev settings. Remember, it will wipe your data. Then
fastboot flashing unlock
Follow the real directions here
https://developers.google.com/android/images
Click to expand...
Click to collapse
Kew01 said:
Whenever I click "Acknowledge" on the page, the page just reloads?
Click to expand...
Click to collapse
**** nevermind I figured it out.
Golf c said:
There is no recovery partition on a Pixel. It's now part of the boot partition. Make sure unlock is toggled in Dev settings. Remember, it will wipe your data. Then
fastboot flashing unlock
Follow the real directions here
https://developers.google.com/android/images
Click to expand...
Click to collapse
Sorry for spamming you, but it looks like the official instructions only show you how to re-flash the system OS without root privileges? My goal is to re-flash with root.
Kew01 said:
Sorry for spamming you, but it looks like the official instructions only show you how to re-flash the system OS without root privileges? My goal is to re-flash with root.
Click to expand...
Click to collapse
1. Flash factory image
2. Boot system
3. Reboot bootloader
4. Fastboot Twrp 3.1.1.1
5. Flash Twrp 3.1.1.1 installer zip or not if you don't want permanent Twrp
6. Flash SuperSU or Magisk
7. Reboot system

Android - Corrupted system after security update

After installing a security update, my device won’t boot. Is there a way out of this without losing my data?
In more details:
My device is a Moto e7 XT2095-2 with Android 10.
Today I got a notification for the latest security update. I downloaded it. My phone tried to restart but failed, and looped several times.
In the end it displayed a black screen with a barcode and “fastboot mode ...”.
After trying to reboot again, now I’m getting this message:
Android Recovery
motorola/malta_reteu/malta
10/QOFS30.569-36-31/095c7
user/release-keys
Use volume up/down and power
Can’t load Android system. Your data may be corrupt. If you continue to get this message, you may need to perform a factory data reset and erase all user data stored on this device.
If I select “Try again”, I’m getting an “Error!” screen then the device reboots (tries to, I mean).
The device is not rooted. I haven’t unlocked the bootloader, installed a custom ROM, or a custom recovery.
Developer options are enabled – that’s the only difference from the average person’s smartphone.
I have no backup of my data.
I know very little about Android, but as a developer I’m comfortable enough learning about it.
I searched online what I could do, and tried to ADB sideload the stock OTA as described here:
https://www.droidwin.com/fix-cant-load-android-system-your-data-may-be-corrupt-without-reset/
with the 2 latest files from here https://mirrors.lolinet.com/firmware/moto/malta/official/RETEU/
On my laptop terminal, I got this:
serving: 'update.zip' (~0%) adb: failed to read command: Undefined error: 0
And on the device:
Finding update package…
Opening update package…
Verifying update package…
E:footer is wrong
Update package verification took 0.2s (result 1)
E:Signature verification failed
E:error: 21
Install from ADB completed with status 2.
Installation aborted.
I’m a bit confused from reading a lot of contradictory information. Is this method supposed to work or is it failing because my bootloader is locked or because I’m using the stock recovery?
Is there a way to fix this bootloop without losing my data? Is there any way to backup the device’s data before a factory reset?
I would really appreciate if someone could point me to things worth trying!
Thanks
you will find lot of contradictory information, also on xda. so please handle my information with care, too
1) no problem for official OTAs, stock recovery is intented to flash (proper signed) update.zip on locked bootloader. have a look into zip META-INF/com/google/android/updater-script and figure out where the error 21 comes from, or search for it...
2) it is A/B device so you might be able to switch slot from fastboot and boot into other working slot (if not flagged as invalid)
3) you can backup (encrypted) userdata partition from mtkclient. unfortunately this won't help on factory reset, as every android device run several proprietary OS (which can't backed up) so factory reset will destroy encryption regardless of your backup
(replied to the wrong post)
aIecxs said:
you will find lot of contradictory information, also on xda. so please handle my information with care, too
1) no problem for official OTAs, stock recovery is intented to flash (proper signed) update.zip on locked bootloader. have a look into zip META-INF/com/google/android/updater-script and figure out where the error 21 comes from, or search for it...
2) it is A/B device so you might be able to switch slot from fastboot and boot into other working slot (if not flagged as invalid)
3) you can backup (encrypted) userdata partition from mtkclient. unfortunately this won't help on factory reset, as every android device run several proprietary OS (which can't backed up) so factory reset will destroy encryption regardless of your backup
Click to expand...
Click to collapse
Thanks for the suggestions!
2) I had never heard of A/B slots before, I will read a bit about it and try
1) Error 21 seems to be caused by a ROM that isn’t signed by the manufacturer. https://gossipfunda.com/android-update-error-21/
All the ROMS on https://mirrors.lolinet.com/firmware/moto/malta/official/RETEU/ seem to be “user signed”, the 2 I tried have these filenames:
XT2095-2_MALTA_RETEU_10_QOFS30.569-36-29_2201_220222_user_SIGN_008_SVC.zip
XT2095-2_MALTA_RETEU_10_QOFS30.569-36-31_2203_220331_user_SIGN_008_SVC.zip
I read that the signature verification can be bypassed using a custom recovery, but this requires unlocking the bootloader and erasing all data.
I will try to find a signed ROM.
please double check maybe it's zip in zip
aIecxs said:
please double check maybe it's zip in zip
Click to expand...
Click to collapse
It's not, the zip contains a few dozen files, mostly .img
aIecxs said:
you will find lot of contradictory information, also on xda. so please handle my information with care, too
1) no problem for official OTAs, stock recovery is intented to flash (proper signed) update.zip on locked bootloader. have a look into zip META-INF/com/google/android/updater-script and figure out where the error 21 comes from, or search for it...
2) it is A/B device so you might be able to switch slot from fastboot and boot into other working slot (if not flagged as invalid)
3) you can backup (encrypted) userdata partition from mtkclient. unfortunately this won't help on factory reset, as every android device run several proprietary OS (which can't backed up) so factory reset will destroy encryption regardless of your backup
Click to expand...
Click to collapse
I tried to change the slot, but no luck. It's only possible with an unlocked device.
That's a pity. If it's meant to help average users who just get into a bootloop caused by a faulty update, they're unlikely to have unlocked their device, why would they?
$ ./fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.003s
$ ./fastboot --set-active=b
Setting current slot to 'b' FAILED (remote: 'set_active command is not allowed on locked devices')
fastboot: error: Command failed
$
Also found this: https://www.droidwin.com/fix-failed-remote-slot-change-is-not-allowed-in-lock-state/
too bad. you can backup seccfg, unlock with mtkclient (no fastboot flashing unlock needed) switch slots and restore seccfg. it's a bit dangerous as accidentially booting into android while in unlocked state will make encryption invalid, so make sure you boot into fastboot mode only (maybe use hair tie for volume key?)
unlocking with mtkclient does not factory reset, but do not erase metadata, userdata or md_udc (backup recommended)
aIecxs said:
too bad. you can backup seccfg, unlock with mtkclient (no fastboot flashing unlock needed) switch slots and restore seccfg. it's a bit dangerous as accidentially booting into android while in unlocked state will make encryption invalid, so make sure you boot into fastboot mode only (maybe use hair tie for volume key?)
unlocking with mtkclient does not factory reset, but do not erase metadata, userdata or md_udc (backup recommended)
Click to expand...
Click to collapse
Thanks! I'll read more about this, to be sure I understand what I'm doing, then give it a go.
Is there a step to relock with mtkclient at some point, or should I leave it unlocked and boot normally at the end?
as mentioned, do not try to boot in unlocked state you will lose all data. re-lock bootloader by restoring (locked) seccfg first!
aIecxs said:
as mentioned, do not try to boot in unlocked state you will lose all data. re-lock bootloader by restoring (locked) seccfg first!
Click to expand...
Click to collapse
Ok, I didn't know that would restore the locked state as well.
aIecxs said:
too bad. you can backup seccfg, unlock with mtkclient (no fastboot flashing unlock needed) switch slots and restore seccfg. it's a bit dangerous as accidentially booting into android while in unlocked state will make encryption invalid, so make sure you boot into fastboot mode only (maybe use hair tie for volume key?)
unlocking with mtkclient does not factory reset, but do not erase metadata, userdata or md_udc (backup recommended)
Click to expand...
Click to collapse
I'm delayed by other issues while trying to get a win10 virtualbox running so that I can run mtkclient... Am I right to assume it can run in virtualbox, and doesn't require a non-virtual win OS?
virtalbox requires usb passthrough. why not use native OS all platform supported. or just try the Live DVD V4 provided?
aIecxs said:
virtalbox requires usb passthrough. why not use native OS all platform supported. or just try the Live DVD V4 provided?
Click to expand...
Click to collapse
You're right. I think I had seen only Win and Linux, not MacOS. I was probably confused with some other tool I came across in my search!
tom353 said:
You're right. I think I had seen only Win and Linux, not MacOS. I was probably confused with some other tool I came across in my search!
Click to expand...
Click to collapse
Actually that was for SP Flash Tool, not mtkclient. So that I can backup seccfg.
mtkclient is replacement for SP Flash Tool, you can backup all partitions at once into directory out (rl = read all)
Code:
python3 mtk rl out
aIecxs said:
mtkclient is replacement for SP Flash Tool, you can backup all partitions at once into directory out (rl = read all)
Code:
python3 mtk rl out
Click to expand...
Click to collapse
Ah, great. Thanks!
In following the steps in https://github.com/bkerler/mtkclient I'm reading this:
If the device has a vendor interface 0xFF (like LG), make sure to add "blacklist qcaux" to the "/etc/modprobe.d/blacklist.conf".
How can I find out whether my device "has a vendor interface 0xFF"?
check bDeviceClass on lsusb -vv
https://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors
It’s been a while (life happens...), but I haven’t given up on this!
I couldn’t get MTKClient to run on MacOSX, but I eventually got my hands on an old PC and used the liveDVD.
So, I did what you suggested. Backup up seccfg, unlocked bootloader with MTKClient, switched slots with fastboot, then restored seccfg.
Unfortunately, the device is still stuck in the same bootloop. Then after maybe 5 tries it goes into either fastboot, or that “Can’t load Android system. Your data may be corrupt.” screen from my first post.
Also, it switches back to slot A during that bootloop.
I could verify that after a ./fastboot reboot (into fastboot again) , the current-slot was indeed changed to B.
$ ./fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.003s
$ ./fastboot --set-active=b
Setting current slot to 'b' OKAY [ 0.011s]
Finished. Total time: 0.014s
$ ./fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.003s
$ ./fastboot set_active b
Setting current slot to 'b' OKAY [ 0.008s]
Finished. Total time: 0.011s
$ ./fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.003s
$ ./fastboot reboot
Rebooting OKAY [ 0.003s]
Finished. Total time: 0.003s
$ ./fastboot getvar current-slot
current-slot: b
Finished. Total time: 0.003s
During the bootloop , I also diverted it into fastboot to verify, after 2 or 3 boot attempts, it was still on B. But later on it switched back to A.
Actually, I noticed that I could change the slot without unlocking the bootloader.
There are 2 ways to access fastboot on that device. One way is from within recovery mode, which I had been using initially, and in this fastboot I’m getting this message “set_active command is not allowed on locked devices”. But the other way is to access fastboot from the first menu, and that fastboot lets me use set_active.
This restriction that applies to one fastboot and not the other made me wonder whether the “OKAY” message actually did the job, but the different responses from getvar current-slot seem to confirm that.
Anyway, the short conclusion is that switching slots didn’t make the device to boot, and it sets itself back to slot A after trying to boot on B.
Another observation I made is that I’m not sure MTKClient effectively unlocked my device. It reported that it unlocked it, but then when I used it the second time to restore seccfg, it said “Device is protected”.
[09:56:23]: Loading payload from mt6765_payload.bin, 0x264 bytes
[09:56:23]: Kamakiri / DA Run
[09:56:23]: Trying kamakiri2..
[09:56:23]: Done sending payload...
[09:56:24]: Successfully sent payload: /opt/mtkclient/mtkclient/payloads/mt6765_payload.bin
[09:56:24]: Device is protected.
[09:56:24]: Device is in BROM mode. Trying to dump preloader.
[09:56:58]: Bootloader: unlock
[10:05:07]: Loading payload from mt6765_payload.bin, 0x264 bytes
[10:05:07]: Kamakiri / DA Run
[10:05:07]: Trying kamakiri2..
[10:05:07]: Done sending payload...
[10:05:07]: Successfully sent paylad: /opt/mtkclient/mtkclient/payloads/mt6765_payload.bin
[10:05:07]: Device is protected.
[10:05:07]: Device is in BROM mode. Trying to dump preloader.
[10:07:25]: test
[10:07:35]: write done!
I also went to see what fastboot was reporting after unlocking with MTKClient:
$ ./fastboot getvar unlocked
unlocked: no
Finished. Total time: 0.003s
However, that doesn’t necessarily matters, as I didn’t need to unlock it to switch slots.
Now, is there anything else I could try?
I was thinking of retrying to ADB sideload the stock OTA while the device is “maybe unlocked”.
I mean, by the look of it, it’s still locked, but I have limited trust in what my 2 inconsistent fastboot report.
So, assuming it is unlocked, is it safe to try ADB sideload while unlocked, or could this cause data loss?

Categories

Resources