Android - Corrupted system after security update - General Questions and Answers

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?

Related

[SOLVED] Installed LineageOS with custom LineageOS Recovery then locked bootloader

I got LineageOS installed, restarted to bootloader and locked bootloader.
I can now:
Get into LineageOS Recovery
Boot to LineageOS ROM
I cannot:
Unlock bootloader
Unlock flashing
Unlock OEM from developer options (Option is greyed out)
What I tried, rooting and trying the following adb commands.
HTML:
adb root
adb shell setprop ro.oem_unlock_supported 1
Got the error:
HTML:
setprop: failed to set property 'ro.oem_unlock_supported' to '1'
I can only run LineageOS and go into LineageOS recovery and Adb sideload from recovery and install rooting apps.
Help! Want to 'fastboot flashing unlock'
Video:
https://vimeo.com/304615053
UPDATE:
UPDATE: Solution given by the dev razorloves(https://forum.xda-developers.com/member.php?u=614507) the dev who mantains the LineageOS ROM for Pixel details here:
https://forum.xda-developers.com/showpost.php?p=78361157&postcount=32
I am not sure, and I think someone else can chime in but, I have always heard that you never ever relock the bootloader with anything custom for the Pixel. Have you tried the fastboot flashing unlock critical command? I am not sure the exact command but if you Google it you will see. I think thats about your only hope.
Archangel said:
I am not sure, and I think someone else can chime in but, I have always heard that you never ever relock the bootloader with anything custom for the Pixel. Have you tried the fastboot flashing unlock critical command? I am not sure the exact command but if you Google it you will see. I think thats about your only hope.
Click to expand...
Click to collapse
Yeah, I goofed up.
Tried unlock_critical
HTML:
[email protected]:~$ fastboot flashing unlock
FAILED (remote: 'oem unlock is not allowed')
Finished. Total time: 0.029s
[email protected]:~$ fastboot flashing unlock_critical
FAILED (remote: 'oem unlock is not allowed')
Finished. Total time: 0.013s
[email protected]:~$
What I cannot understand is I have a perfectly working LineageOS ROM and LineageOS Custom Recovery. There should ideally be a way
I guess on the bright side at least you have a working phone and a custom rom. But as far as removing it or going back to stock I am not that sure because I believe you need to be unlocked to do that and the system is locked down tight now. I am sure someone else smarter than me will help with an answer, sorry brother wish I could help more.
tomatosmoothie said:
Yeah, I goofed up.
Tried unlock_critical
HTML:
[email protected]:~$ fastboot flashing unlock
FAILED (remote: 'oem unlock is not allowed')
Finished. Total time: 0.029s
[email protected]:~$ fastboot flashing unlock_critical
FAILED (remote: 'oem unlock is not allowed')
Finished. Total time: 0.013s
[email protected]:~$
What I cannot understand is I have a perfectly working LineageOS ROM and LineageOS Custom Recovery. There should ideally be a way
Click to expand...
Click to collapse
Archangel said:
I guess on the bright side at least you have a working phone and a custom rom. But as far as removing it or going back to stock I am not that sure because I believe you need to be unlocked to do that and the system is locked down tight now. I am sure someone else smarter than me will help with an answer, sorry brother wish I could help more.
Click to expand...
Click to collapse
Nah man, thanks for looking in, sometimes, when your banging your head against a wall, it's nice if at least someone looks in lol, I would feel so alone if no one replied Thank you!
Pondering of flashing the Unofficial LOS 16 which has been created by the same dev as the Official LOS 15 via LOS Recovery. to change things up.
I hearya nothings worse than having a problem and your the only one. Did that on a few phones. I have the Pixel 3 too now and I stay stock with some small edits and my Substratum themes running. I love the custom roms but sometimes they can be a real pain. Yeah I would give LOS 16 a try I guess what do you have to lose.
tomatosmoothie said:
Nah man, thanks for looking in, sometimes, when your banging your head against a wall, it's nice if at least someone looks in lol, I would feel so alone if no one replied Thank you!
Pondering of flashing the Unofficial LOS 16 which has been created by the same dev as the Official LOS 15 via LOS Recovery. to change things up.
Click to expand...
Click to collapse
tomatosmoothie said:
Pondering of flashing the Unofficial LOS 16 which has been created by the same dev as the Official LOS 15 via LOS Recovery. to change things up.
Click to expand...
Click to collapse
Sorry I don't have experience with that situation and hope someone with the knowledge will be able to help you, but in the meantime I just wanted to chime in because you are pretty lucky in your misfortune to have a working phone, usually relocking bootloader while on a custom ROM results in a bootloop 99.9% of the time. So I would advise not tinkering with your ROM but focusing on finding a way either to unlock bootloader or to get back to stock firmware.
bafforosso said:
Sorry I don't have experience with that situation and hope someone with the knowledge will be able to help you, but in the meantime I just wanted to chime in because you are pretty lucky in your misfortune to have a working phone, usually relocking bootloader while on a custom ROM results in a bootloop 99.9% of the time. So I would advise not tinkering with your ROM but focusing on finding a way either to unlock bootloader or to get back to stock firmware.
Click to expand...
Click to collapse
Thanks, I was thinking the same thing, also, the idea was to flash a ROM that would be able to allow OEM unlocking in dev options, but I feel maybe LOS Recovery is not allowing me to unlock.
Also thinking of flashing stock factory image via LOS Recovery.
I will tread carefully though, thanks.
No way your bl is locked.
Sent from my Pixel XL using Tapatalk
lafester said:
No way your bl is locked.
Click to expand...
Click to collapse
Hmm yeah I was wondering the same as it would be a pretty serious security bug if a locked bootloader let's a device with LOS boot. Could it be that only the "unlockability" switch was switched off but it did not really locked your bootloader, just the ability to modify it's status?
Don't you get the "open padlock" / "your device software can't be checked for corruption..." screen when you boot?
I think you really should try flashing stock firmware.
bafforosso said:
Hmm yeah I was wondering the same as it would be a pretty serious security bug if a locked bootloader let's a device with LOS boot. Could it be that only the "unlockability" switch was switched off but it did not really locked your bootloader, just the ability to modify it's status?
Don't you get the "open padlock" / "your device software can't be checked for corruption..." screen when you boot?
I think you really should try flashing stock firmware.
Click to expand...
Click to collapse
"Your device has loaded a different operating system" is what I get at boot and a "OS fingerprint" below that.
No padlock on the google screen.
I'm waiting for a factory image to download and will try flashing.
LOS Recovery is flashing LOS Nightlies so there is some flashing happening, only question is will LOS Recovery flash a Pixel Factory Image.
tomatosmoothie said:
"Your device has loaded a different operating system" is what I get at boot and a "OS fingerprint" below that.
No padlock on the google screen.
I'm waiting for a factory image to download and will try flashing.
LOS Recovery is flashing LOS Nightlies so there is some flashing happening, only question is will LOS Recovery flash a Pixel Factory Image.
Click to expand...
Click to collapse
Sorry I mixed things up : use the flash-all.sh (or flash-all.bat if using Windows) script with your device in fastboot mode as described on the stock firmwares download page.
[Correct but not for flashing stock firmware]
No idea, never used, but you should be able to "fastboot boot" into twrp and flash.
Don't flash twrp afterwards as it is known to cause bootloops under some circumstances with the December update, and as a rule of thumb with A/B partition devices just keep stock recovery and use a computer to "fastboot boot" into TWRP when you need to flash something, it is a lot safer (still talking about stock firmware as I don't know anything about LOS/LOS recovery).
bafforosso said:
No idea, never used, but you should be able to "fastboot boot" into twrp and flash.
Don't flash twrp afterwards as it is known to cause bootloops under some circumstances with the December update, and as a rule of thumb with A/B partition devices just keep stock recovery and use a computer to "fastboot boot" into TWRP when you need to flash something, it is a lot safer (still talking about stock firmware as I don't know anything about LOS/LOS recovery).
Click to expand...
Click to collapse
Tried that earlier, didn't work. Trying now.
Advanced Restart is enabled in Dev options.
Restarted to bootloader.
HTML:
[email protected]:~$ fastboot boot '/media/twrp-3.2.3-1-sailfish.img'
Downloading 'boot.img' OKAY [ 1.064s]
booting (bootloader) Command is not supported.
(bootloader) Please unlock device to enable this command.
FAILED (remote: '')
Finished. Total time: 9.237s
[email protected]:~$
tomatosmoothie said:
Tried that earlier, didn't work. Trying now.
Advanced Restart is enabled in Dev options.
Restarted to bootloader.
HTML:
[email protected]:~$ fastboot boot '/media/twrp-3.2.3-1-sailfish.img'
Downloading 'boot.img' OKAY [ 1.064s]
booting (bootloader) Command is not supported.
(bootloader) Please unlock device to enable this command.
FAILED (remote: '')
Finished. Total time: 9.237s
[email protected]:~$
Click to expand...
Click to collapse
Sorry edited my post because I mixed up things, my bad.
No recovery needed to flash stock firmware, just use instructions from the Stock Firmware Download Page
bafforosso said:
Sorry edited my post because I mixed up things, my bad.
No recovery needed to flash stock firmware, just use instructions from the Stock Firmware Download Page
Click to expand...
Click to collapse
Yeah, that page says flash unlock is required
Hoping, LOS Recovery will flash it, since it's flashing LOS Nightlies.
HTML:
[email protected]:~$ fastboot flashing unlock
FAILED (remote: 'oem unlock is not allowed')
Finished. Total time: 0.025s
[email protected]:~$ fastboot flashing unlock_critical
FAILED (remote: 'oem unlock is not allowed')
Finished. Total time: 0.034s
[email protected]:~$ fastboot oem unlock
FAILED (remote: 'oem unlock is not allowed')
Finished. Total time: 0.027s
[email protected]:~$
tomatosmoothie said:
Yeah, that page says flash unlock is required
Hoping, LOS Recovery will flash it, since it's flashing LOS Nightlies.
Click to expand...
Click to collapse
If what I suspect - that the bootloader is not the original one but a modded one from LOS and in fact it is not really enforcing the locked state but just locks use of the fastboot unlock/lock instructions or some similar behaviour - then you have to try steps 5. and 6. no matter what is the output of the previous commands.
As you wish, it is your phone but if you don't try we'll never know...
bafforosso said:
If what I suspect - that the bootloader is not the original one but a modded one from LOS and in fact it is not really enforcing the locked state but just locks use of the fastboot unlock/lock instructions or some similar behaviour - then you have to try steps 5. and 6. no matter what is the output of the previous commands.
As you wish, it is your phone but if you don't try we'll never know...
Click to expand...
Click to collapse
Yeah, there is one more catch. You cannot choose a file in LOS Recovery, it is encrypted.
So the only choice is "adb sideloar file.zip"
bafforosso said:
If what I suspect - that the bootloader is not the original one but a modded one from LOS and in fact it is not really enforcing the locked state but just locks use of the fastboot unlock/lock instructions or some similar behaviour - then you have to try steps 5. and 6. no matter what is the output of the previous commands.
As you wish, it is your phone but if you don't try we'll never know...
Click to expand...
Click to collapse
Yeah, there is one more catch. You cannot choose a file in LOS Recovery, it is encrypted.
So the only choice is "adb sideload file.zip"
tomatosmoothie said:
Yeah, there is one more catch. You cannot choose a file in LOS Recovery, it is encrypted.
So the only choice is "adb sideloar file.zip"
Click to expand...
Click to collapse
Come on man please, I know you're probably tired of this but I stated that "No recovery needed to flash stock firmware, just use instructions from the Stock Firmware Download Page" and nowhere does it states anything about recovery, adb push, sideload or what not...
Here is a simplification of the part of the instructions on that page you should follow, everything has to be done from your computer with your phone plugged to it in fastboot mode :
On your computer, download stock firmware full image for your device.
Unzip the stock firmware image just downloaded.
Open a terminal and navigate to the unzipped stock firmware image directory.
Execute the flash-all script. This script installs the necessary bootloader, baseband firmware(s), and operating system
P.S.: Forgot to warn but this will delete all your data from your phone.
bafforosso said:
Come on man please, I know you're probably tired of this but I stated that "No recovery needed to flash stock firmware, just use instructions from the Stock Firmware Download Page" and nowhere does it states anything about recovery, adb push, sideload or what not...
Here is a simplification of the part of the instructions on that page you should follow, everything has to be done from your computer with your phone plugged to it in fastboot mode :
On your computer, download stock firmware full image for your device.
Unzip the stock firmware image just downloaded.
Open a terminal and navigate to the unzipped stock firmware image directory.
Execute the flash-all script. This script installs the necessary bootloader, baseband firmware(s), and operating system
P.S.: Forgot to warn but this will delete all your data from your phone.
Click to expand...
Click to collapse
Got a Permission denied.
HTML:
[email protected]:/media/disk2/LineageOS/Pie/Pie_Official_Factory/sailfish-ppr2.181005.003.a1$ ./flash-all.sh
bash: ./flash-all.sh: Permission denied

Does re-locking unlocked bootloader cause data wipe, or do I need to do that manually

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.

[Q] HELP! -> Boot loop / No USB Debug / Encrypted / No Root / Can't Flash or Reset

Hi all,
I have got a N5 that is not booting (infinite boot animation loop). It's bootloader is unlocked and I can push stuff via ADB so I am assuming eMMC is good.
Also, USB debugging is OFF, phone is ENCRYPTED and NOT rooted.
I can't mount or modify /data and /persist partitions.
I tried reformating with ext2 to destroy encryption but it is not working. I also tried dd method but was unsuccessful.
I am not interested in recovering or rescuing anything from the phone.
Currently trying to figure out how to activate download mode so I can reflash everything using LG Flash tool.
Thanks in advance
EDIT: Bootloader is unlocked but I can't root the phone with wugfresh's nexus root toolkit.
The encyption can disable only with command fastboot flash userdata userdata.img
The userdata.img you can find in the Google OEM ROM Google M4B30Z
It requires the SDK Platform Tools is installed SDK Platform Tools
You may give a chance and with this http://www.wugfresh.com/
Hi Sant514,
'fastboot flash userdata userdata.img' returns this error:
target reported max download size of 1073741824 bytes
erasing 'userdata'...
OKAY [ 0.460s]
sending 'userdata' (137318 KB)...
OKAY [ 4.511s]
writing 'userdata'...
FAILED (remote: flash write failure)
finished. total time: 5.151s
also tried to format userdata:
fastboot format userdata
Couldn't parse erase-block-size '0x'.
Couldn't parse logical-block-size '0x'.
mke2fs 1.45.5 (07-Jan-2020)
/tmp/TemporaryFile-GqLE95: Unimplemented ext2 library function while setting up superblock
/usr/lib/android-sdk/platform-tools/mke2fs failed with status 1
mke2fs failed: 1
error: Cannot generate image for userdata
This reformating with ext2, I don't think this helped the situation,
so can you give a chance with tool http://www.wugfresh.com/?
No you do not need to root your device with wugfresh. It has a choice about unbrick... unroot and resτore
in factory condition...
The menu-choice is "Back to Stock / Flash Stock and Unroot" and you will select "Current Status=Soft Bricked/Bootloop"
Nexus Root Toolkit is giving me multiple flash write failures so I think the eMMC is dead.
Thanks for the help...
I had a similar major crash with my D820 (Nexus 5, US version) last month after trying wireless charging with an aftermarket back cover (overheated followed by kernel panic green screen of death). Infinite reboots. Couldn't get past Google logo. Flashed the factory image without the "-w" option which wipes user data, no joy. I figured I was screwed.
So flashed factory image 4.4.4 totally (-w left in the flash-all.bat script). Then flashed the last 2016 factory image (M4B30Z), and it came back. I hate having to reinstall apps (including discontinued ones via the APK borrowed from my other Nexus device), but it's actually good to clean out old cruft.
https://developers.google.com/android/images#hammerhead
As you probably know, you only need to install the Android SDK, Platform-tools (fastboot, adb, etc), boot into bootloader (run "fastboot devices" to see the phone is connected), and the flash-all.bat file will do the rest. Don't interrupt it, the "warning: ... .sig not found" and "sending System.img" steps will take a while. On my phone, the whole script can take 2 mins.
I've never relocked the bootloader after unlocking, but that could resolve the encryption issue .. but IDK, I've never done it.
Good luck.

How to go back from custom rom to factory

files are from current available factory image available. be sure to use latest available fastboot application.
1. reboot to fastboot
2. fastboot erase userdata (all data is deleted, have a backup)
3. fastboot reboot-bootloader
4. fastboot flash bootloader bootloader-sunfish-s5-0.2-6539975.img
5. fastboot reboot-bootloader
6. fastboot flash radio radio-sunfish-g7150-00018-200701-b-6643937.img
7. fastboot reboot-bootloader
8. fastboot update image-sunfish-rp1a.201005.006.zip
9. fastboot reboot-bootloader
10. choose recovery
11. on the android icon with the red warning shield hold power and press volume up
12. Stock recovery appears. Choose wipe data / factory reset
if in any case the fastboot command gets stuck, replug the device and/or restart bootloader. BE CAREFULL WHEN DOING THIS WHILE RUNNING fastboot flash bootloader !!!!BRICK POSSIBLE!!!!!
After that you can boot up and see its working.
if everything is right, you should flash both slots before
relocking bootloader
so repeat above steps and do point 4. and 6. fastboot flash with
fastboot flash --slot all
from above steps. Check phone boots on both slots. Active slot can be switched via
fastboot --set-active=a
verify it boots then
fastboot --set-active=b
verify again it boots
then proceed with
fastboot flashing lock
(data will be wiped)
If you're doing it this way you should flash the images to both slots.
Fastboot flash bootloader --slot all (image)
Reboot bootloader
Fastboot flash radio --slot all (image)
Reboot bootloader
Then
Fastboot update (extracted sunfish folder)
Let it do its thing.
Incase there's any doubt on both slots being stock you can just adb sideload the OTA after you boot
Edmontonchef said:
If you're doing it this way you should flash the images to both slots.
Fastboot flash bootloader --slot all (image)
Reboot bootloader
Fastboot flash radio --slot all (image)
Reboot bootloader
Then
Fastboot update (extracted taimen folder)
Let it do its thing.
Incase there's any doubt on both slots being stock you can just adb sideload the OTA after you boot
Click to expand...
Click to collapse
indeed that is correct , ill add this to the post though in case something goes wrong i normally only affect active slot to reduce brick possibility
Is it safe to downgrade from 11 to 10 this way?
forty-second said:
Is it safe to downgrade from 11 to 10 this way?
Click to expand...
Click to collapse
Yes, just keep in mind whenever rolling back asb or android versions you'll have to format data.
You can do this in a more simple way by flash the stock image via official website from android, just click and follow the instruction
forty-second said:
Is it safe to downgrade from 11 to 10 this way?
Click to expand...
Click to collapse
from stock to stock its easier
I9602283 said:
You can do this in a more simple way by flash the stock image via official website from android, just click and follow the instruction
Click to expand...
Click to collapse
if that would be the case i would not have written this guide
It'll be nice when we have a working TWRP, then you can format data and flash/sideload an OTA if needed.
Edmontonchef said:
It'll be nice when we have a working TWRP, then you can format data and flash/sideload an OTA if needed.
Click to expand...
Click to collapse
Seems unlikely; lots of challenges getting custom recoveries working w/A11+
guide
r0tt0r said:
if that would be the case i would not have written this guide
Click to expand...
Click to collapse
Did you ever look at factory packs? It has flash_all scripts for Linux and Windows and its do all steps as needed.
Or I'm wrong?
boomo15 said:
Did you ever look at factory packs? It has flash_all scripts for Linux and Windows and its do all steps as needed.
Or I'm wrong?
Click to expand...
Click to collapse
go and unlock ur phone, flash superiorOS fe. (that was the one i was on) then go back to stock.
tell me if it was all so easy. this guide is meant if you run into issues like i did and i wanted to not have you struggle through the same.
if you think running "bat" without seeing any output of what is happening and sit for an hour without anything has happened at all cause fastboot is stuck, then do so and skip this thread.
Edmontonchef said:
If you're doing it this way you should flash the images to both slots.
Fastboot flash bootloader --slot all (image)
Reboot bootloader
Fastboot flash radio --slot all (image)
Reboot bootloader
Then
Fastboot update (extracted taimen folder)
Let it do its thing.
Incase there's any doubt on both slots being stock you can just adb sideload the OTA after you boot
Click to expand...
Click to collapse
Im confused when you mentioned "Fastboot update (extracted taimen folder)" taimen?
thanks is advance
mauri311 said:
Im confused when you mentioned "Fastboot update (extracted taimen folder)" taimen?
thanks is advance
Click to expand...
Click to collapse
Sorry I meant sunfish (brainfart)
When you extract the factory image a second folder will show up. It'll say image.sunfish.
You can type in the terminal ( fastboot update ) then drag and drop that folder. Works the same way as flash-all. Just update bootloader and radio first.
Not enough space
Hello,
I end at point 8:
error: failed to load 'image-sunfish-rp1a.201005.006.zip': Not enough space
How can I fix the problem ?
foxxof said:
Hello,
I end at point 8:
error: failed to load 'image-sunfish-rp1a.201005.006.zip': Not enough space
How can I fix the problem ?
Click to expand...
Click to collapse
it should be fixable by
fastboot erase system_a
or
fastboot erase system_b
depending on your current active slot.
r0tt0r said:
it should be fixable by
fastboot erase system_a
or
fastboot erase system_b
depending on your current active slot.
Click to expand...
Click to collapse
fastboot erase system_a
output :
erasing 'system_a' . . .
FAILED (remote: Partition should be erased in fastbootd)
finished. total time: 0.138s
fastboot erase system_b
output :
erasing 'system_b' . . .
FAILED (remote: Partition should be erased in fastbootd)
finished. total time: 0.147s
:crying:
i downloaded the latest sdk. (r30.0.5 not 30.0.4)
now it works!
foxxof said:
fastboot erase system_a
output :
erasing 'system_a' . . .
FAILED (remote: Partition should be erased in fastbootd)
finished. total time: 0.138s
fastboot erase system_b
output :
erasing 'system_b' . . .
FAILED (remote: Partition should be erased in fastbootd)
finished. total time: 0.147s
:crying:
i downloaded the latest sdk. (r30.0.5 not 30.0.4)
now it works!
Click to expand...
Click to collapse
btw the message partition should be erased in fastbootd is as far i know the recovery fastboot not the one coming at first (boot recovery, at little android press power+vol)
Partition should be erased in fastbootd
foxxof said:
fastboot erase system_a
output :
erasing 'system_a' . . .
FAILED (remote: Partition should be erased in fastbootd)
finished. total time: 0.138s
fastboot erase system_b
output :
erasing 'system_b' . . .
FAILED (remote: Partition should be erased in fastbootd)
finished. total time: 0.147s
Click to expand...
Click to collapse
adb reboot bootloader
fastboot reboot fastboot
fastboot erase system_a or system_b
---------- Post added at 02:45 PM ---------- Previous post was at 02:16 PM ----------
r0tt0r said:
go and unlock ur phone, flash superiorOS fe. (that was the one i was on) then go back to stock.
tell me if it was all so easy. this guide is meant if you run into issues like i did and i wanted to not have you struggle through the same.
if you think running "bat" without seeing any output of what is happening and sit for an hour without anything has happened at all cause fastboot is stuck, then do so and skip this thread.
Click to expand...
Click to collapse
Way! Why so much emotions over simple suggestion? You where unlucky and give people a guide in case which is replicate all commands from scripts. Good!
And for record my experience with this device in short!
Received – setup – Android 11 – OTA to 006 – Canary – root – boot – check all stuff – install my apps – check again – pm list for bloatware
flash superiorOS – make notes not working stuff – root – check again – same not working stuff
flash factory android 10 with flash_all – boot – check
flash CalyxOS – check – root – worked – back to stock with flash all Android 10 – check – all good
flash RR – check – root – buggy for me
flash Android 11 with flash_all – flash GrapheOS -- root -- some apps not working
flash SuperiorOS – root – flashed blu-spark kernel – remove unneeded stuff – restore backup – same bugs
flash factory – root – blu-spark – debloat – working on stock now.
All time I used flash-all and no any problems. And thank you for your suggestion to skip this tread!:good:
Awesome guide - Thank you!
FYI - To lock the bootloder, I had to use " fastboot flashing lock "

Unable to reinstall Oxygen OS from custom ROM. FAILED (remote: Flashing is not allowed for Critical Partitions ). Need assistance, details below.

Hello, friends. So I am here following this exact tutorial :
How to Restore OnePlus Nord Back to Stock OxygenOS Software - A Complete Guide
In this guide, we will show you how to restore the stock OxygenOS software on the OnePlus Nord by flashing the factory image/Fastboot ROM. Things like custom ROMs, TWRP, and Magisk root are pretty…
www.thecustomdroid.com
I currently am stuck there
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot flash abl abl.img
target reported max download size of 805306368 bytes
sending 'abl' (1996 KB)...
OKAY [ 0.055s]
writing 'abl'...
FAILED (remote: Flashing is not allowed for Critical Partitions
)
finished. total time: 0.057s
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot flashing unlock_critical
...
FAILED (remote: Device already : unlocked!)
finished. total time: 0.000s
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot flashing unlock
...
FAILED (remote: Device already : unlocked!)
finished. total time: 0.000s
Click to expand...
Click to collapse
I just simply do not understand what could be wrong here.
In fastoot mode I get "device - State unlocked"
As you already saw, it seems the device is completely unlocked. What could be wrong ?
Also, some steps before, I get that :
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot reboot fastboot
fastboot: usage: unknown reboot target fastboot
Click to expand...
Click to collapse
I suspect switching to the automated in Windows won't change much.
It is strange because I am able to perform these steps without problems, ones the ones after seem to not work :
./fastboot flash boot boot.img
./fastboot flash dtbo dtbo.img
./fastboot flash modem modem.img
./fastboot flash recovery recovery.img
./fastboot --disable-verity flash vbmeta vbmeta.img
./fastboot --disable-verity flash vbmeta_system vbmeta_system.img
Click to expand...
Click to collapse
I might be doing something wrong ? Be located in the wrong folder or something ? For instance, when I type these commands it does not work if I write the "./" before fastboot, it tells me
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ ./fastboot flash boot boot.img
bash: ./fastboot: No such file or directory
Click to expand...
Click to collapse
My phone is a Oneplus Nord and I am using the advised Oxygen OS ROM provided in the tutorial I linked at the beginning of my message.
I hope you'll be able to get me out of this as I unfortunately can't figure out how to solve this problem on my own.
Best regards
krakard said:
I might be doing something wrong ? Be located in the wrong folder or something ? For instance, when I type these commands it does not work if I write the "./" before fastboot, it tells me
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ ./fastboot flash boot boot.img
bash: ./fastboot: No such file or directory
Click to expand...
Click to collapse
Yes, that makes sense.
Fastboot should be located at /usr/bin/fastboot. Since you're not in that directory, ./fastboot won't work. (This ./ means: "Look at the current working directory for the command fastboot." If it cannot find fastboot there or it isn't a shell command, it will throw an error.)
However, since you didn't install fastboot globaly, you have to address its exact path inside your platform-tools folder. If fastboot is not in Partition-image folder, ./ won't work.
Can't help you with your main issue though.
Edit: You seem to have fastboot installed globally though:
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot reboot fastboot
fastboot: usage: unknown reboot target fastboot
Click to expand...
Click to collapse
So my first explaination is valid.
Thank you for clarifying that. I understand the issue there. Which is a non-issue indeed since I already installed it globally. But well, it at least teaches me how Linux work.
Of course however, the main issue remains that's for sure.
krakard said:
Thank you for clarifying that. I understand the issue there. Which is a non-issue indeed since I already installed it globally. But well, it at least teaches me how Linux work.
Of course however, the main issue remains that's for sure.
Click to expand...
Click to collapse
You're welcome.
BTW:
krakard said:
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot reboot fastboot
fastboot: usage: unknown reboot target fastboot
Click to expand...
Click to collapse
There is no "fastboot" to boot into. Instead, type
Code:
fastboot reboot bootloader
I didn't mention that yesterday for some reason.
Guys, here is where I am at now. Still struggling but I feel I am very near ! Some help maybe ?
https://forum.xda-developers.com/t/...your-device-to-oxygenos.4148415/post-85022511
best regards
SOLVED
krakard said:
SOLVED
Click to expand...
Click to collapse
How did you fixed this? I'm currently stuck at the same point as you with a oneplus 8
Same here, how did you managed to solve the "Flashing is not allowed for Critical Partitions: error with the fastboot ROM batch file?
mbootsman1 said:
Same here, how did you managed to solve the "Flashing is not allowed for Critical Partitions: error with the fastboot ROM batch file?
Click to expand...
Click to collapse
I found the solution, you have to do fastboot reboot fastboot which reboots you to fastbootd instead of fastboot. There you can flash critical partitions without issue.
Hi,
As the command recommanded everywhere :
Code:
fastboot flashing unlock_critical
had never worked for me in the bootloader environment,
I have to reboot i my rom embedded recovery in order to flash the file (apply update menu) through the :
fastbootD
To sum up :
#From Android (while having all prerequisite done ie bootloader unlocked...)
Code:
adb reboot bootloader
#From the bootloader I choose to boot to recovery and I get to the rom custom recovery
#In the custom recovery, I choose the menu "apply update" that will lead me to the fastbootD mode
#I type the appropriate command to flash the persist partition
Code:
fastboot flash persist "c:\your_path_to_your_persist_file\persist.img"
#Then I simply reboot the phone
Code:
fastboot reboot
PS : Initially flash the OxygenOS (OOS) 11, then apply the CRdroid Android v8 custom rom (based on Android 12)
I did it similar like solid-snake:
In my case I also had no access to fastbootD
The solution came randomly when I flashed back the first part from my lineageOS package:dtbo.img, vbmeta.img and the recovery.img --> after that my phone naturally booted in a fastbootD mode from the lineageOS package.
I modified the flash-all.bat from the stock ROM fastboot flash package:
I removed the line with the reboot command, because I'm already in the fastbootD mode.
Then I ran the modified flash-all.bat and everything went well.
If anyone else struggles (like I did) to get the phone in EDL mode, or the "Flashing is not allowed for Critical Partitions" error ,even if the "fastboot flashing unlock_critical" cmd was executed, here are some hints that might help.
I tried forever on a Linux computer without any luck, so I ended up installing Windows 10 on actual hardware to finally unbrick my One Plus Nord (Avicii). Here are the most important steps, YMMV, execute at own risk:
bcdedit.exe /set nointegritychecks off run this cmd as admin in terminal, toggle to "on"
then install edl drivers as admin, This is where I struggled the most, I finally found an .exe file(QDLoader HS-USB Driver_64bit_Setup.exe) that I just installed and then phone showed up as it should in device manager. ("Qualcomm HS-USB QDLoader 9008," not "QUSB_BULK")
install adb and fastboot. (platform-tools)
install MSM-Download-Tool
download stock OS for use in MSM-Download-Tool program
open msm tool, if phone is not recognised try turning on and holding power pluss both volume, or just one of the volumes.
uncheck the "sha hash check" box
flash
if you get the "Sahara Communication Failed", just try again, it worked for me.
wipe
erase Windows 10 and replace with any Linux distro, tell your PC it will never happen again.
enjoy
Here are link to the EDL-drivers that worked for me. Or just do a web-search for "QDLoader HS-USB Driver_64bit_Setup.exe"
The flashing process will take over 300 seconds, be patient.

Categories

Resources