How to fix and clean your Pixel 2's partitions (should work for other devices too) - Google Pixel 2 Guides, News, & Discussion

I wanted to make this post about my adventure with my old Pixel 2. I was getting non-stop red lines out of the log in TWRP. Many times I would have problems mounting system and vendor partitions as well as vendor partitions needing "to be cleaned".
This led me to believe that I may have a corrupted partition, so I did some research into how the partitions are organized, and what happens when you flash a lot of ROMs. Perhaps you want to go back to the stock firmware? Perhaps - like in my case - you want to install a ROM such as GrapheneOS that's meant to lock the bootloader afterwards, and act more like the stock ROM.
What I didn't understand up until recently is how exactly the A and B slots of phones like the Pixel 2 work. They work because the firmware allows updating OTA to the opposite slot of what's active. That way - in the worst case scenario - you can actually boot into the opposite slot and regain access to your phone. I'm not an expert on this, but that's my basic understanding.
So now that that's covered, another important aspect is flashing ROMs. If you are like me and like testing many different ROMs, you may end up running into issues such as the one I stated above with TWRP.
The only way I was able to avoid these types of issues is to run some commands through fastboot.
One such command is
Code:
fastboot format system
This command will format the system partition and make it easier to install ROMs without running into issues.
Another command is
Code:
fastboot format vendor
This command was very important in my case, because the vendor partition was actually unusable for my slot A. Doing this command finally fixed that issue.
Another thing to note is ROMs can be installed in both slots. A lot of people don't do this, because they leave their bootloader unlocked and probably just run the ROM for half a day, and flash another. In my case, I needed to flash both slots in order to lock the bootloader in GrapheneOS, and allow the OS to update OTA. If you don't flash both slots, that won't work.
Just to clarify further, these are the commands (at the bootloader) I ran (from a command prompt in Windows) in order from start to finish when I was flashing a ROM I wanted to keep:
Code:
fastboot --set-active=a
fastboot format system
fastboot format vendor
fastboot reboot bootloader
fastboot --set-active=b
fastboot format system
fastboot format vendor
fastboot reboot bootloader
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
fastboot update rom.zip
// Let the phone reboot into the new ROM, let it sit for a minute,
// then reboot into bootloader manually and then continue with fastboot:
fastboot --set-active=a
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
fastboot update rom.zip
Once I've done this, and can confirm it successfully loads into the ROM I've installed, I can now say that I have a clean, fresh install in BOTH slots A and B.
I'll update this thread if I can think of anything else that can help newbies like me.
Cheers!

HCFL said:
I wanted to make this post about my adventure with my old Pixel 2. I was getting non-stop red lines out of the log in TWRP. Many times I would have problems mounting system and vendor partitions as well as vendor partitions needing "to be cleaned".
This led me to believe that I may have a corrupted partition, so I did some research into how the partitions are organized, and what happens when you flash a lot of ROMs. Perhaps you want to go back to the stock firmware? Perhaps - like in my case - you want to install a ROM such as GrapheneOS that's meant to lock the bootloader afterwards, and act more like the stock ROM.
What I didn't understand up until recently is how exactly the A and B slots of phones like the Pixel 2 work. They work because the firmware allows updating OTA to the opposite slot of what's active. That way - in the worst case scenario - you can actually boot into the opposite slot and regain access to your phone. I'm not an expert on this, but that's my basic understanding.
So now that that's covered, another important aspect is flashing ROMs. If you are like me and like testing many different ROMs, you may end up running into issues such as the one I stated above with TWRP.
The only way I was able to avoid these types of issues is to run some commands through fastboot.
One such command is
Code:
fastboot format system
This command will format the system partition and make it easier to install ROMs without running into issues.
Another command is
Code:
fastboot format vendor
This command was very important in my case, because the vendor partition was actually unusable for my slot A. Doing this command finally fixed that issue.
Another thing to note is ROMs can be installed in both slots. A lot of people don't do this, because they leave their bootloader unlocked and probably just run the ROM for half a day, and flash another. In my case, I needed to flash both slots in order to lock the bootloader in GrapheneOS, and allow the OS to update OTA. If you don't flash both slots, that won't work.
Just to clarify further, these are the commands (at the bootloader) I ran (from a command prompt in Windows) in order from start to finish when I was flashing a ROM I wanted to keep:
Code:
fastboot --set-active=a
fastboot format system
fastboot format vendor
fastboot reboot bootloader
fastboot --set-active=b
fastboot format system
fastboot format vendor
fastboot reboot bootloader
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
fastboot update rom.zip
// Let the phone reboot into the new ROM, let it sit for a minute,
// then reboot into bootloader manually and then continue with fastboot:
fastboot --set-active=a
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
fastboot update rom.zip
Once I've done this, and can confirm it successfully loads into the ROM I've installed, I can now say that I have a clean, fresh install in BOTH slots A and B.
I'll update this thread if I can think of anything else that can help newbies like me.
Cheers!
Click to expand...
Click to collapse
Would this help in bootloop as well? I have a pixel 1st gen that does. I have flashed and or tried to anyways factory images...OTA and even was able to boot twrp and get lineage to flash, only to get a random reboot and bootloop. I would need to flash the factory image in order to get this phone operable. Should I flash a factory image and then do your steps or should I do the steps first and then flash the factory image?

Nope. Did not work. Seems as if the stock recovery is fubar

Related

Custom recovery results in non-working N7

My N7 is unlocked, I upgraded to 4.2.2 factory stock, rooted, and flashed ClockworkMod Recovery 6.0.2.3 touch recovery. I ran into a very strange issue; if I flash the custom recovery on the tablet, then the tablet boots into a screen that asks me to type my password to decrypt storage not allowing me to enter the homescreen until I do so. Later, I found out that flashing back to stock recovery fixes the problem and my N7 is functional again. I've tried everything while on the custom recovery: erasing, formatting, writing userdata to the device without success.
I'm not really sure what question you are asking. Also, I think you might be leaving something out which ought to be clarified, the way you describe things seems to have some pieces missing. (And, you really should not be starting yet another thread on this)
You shouldn't be able to flash custom ROMs with a stock recovery; so, are you saying that you:
- flash a ROM with a custom recovery
- try and boot it -- but it fails with the "enter password" prompt (you mention "won't let me enter the homescreen")
- flash the stock recovery into place
- perform a factory reset with the stock recovery
- now the ROM boots?
Also, do you get the same result with TWRP?
bftb0 said:
I'm not really sure what question you are asking. Also, I think you might be leaving something out which ought to be clarified, the way you describe things seems to have some pieces missing. (And, you really should not be starting yet another thread on this)
You shouldn't be able to flash custom ROMs with a stock recovery; so, are you saying that you:
- flash a ROM with a custom recovery
- try and boot it -- but it fails with the "enter password" prompt (you mention "won't let me enter the homescreen")
- flash the stock recovery into place
- perform a factory reset with the stock recovery
- now the ROM boots?
Also, do you get the same result with TWRP?
Click to expand...
Click to collapse
It's a help/troubleshooting post. I know it wasn't good to start another thread, but I felt that people that had already browsed my thread the first time wouldn't come back and now I found the reason behind my issue. I didn't flash a custom rom with stock recovery; I used fastboot on my pc to issue commands. My phone has the factory stock rom on it - then if I flash clockworkmod recovery, the next time I reboot, there's a screen that says I need to type a password to decrypt storage and I'm not able to access anything. If I go back into the bootloader and erase and write the stock recovery, I'm able to boot into the homescreen without the issue. Everything I've flashed to the tablet is done through my pc via fastboot. I never tried TWRP, but I don't like that recovery anyways.
UnlockedNand said:
It's a help/troubleshooting post. I know it wasn't good to start another thread, but I felt that people that had already browsed my thread the first time wouldn't come back and now I found the reason behind my issue. I didn't flash a custom rom with stock recovery; I used fastboot on my pc to issue commands. My phone has the factory stock rom on it - then if I flash clockworkmod recovery, the next time I reboot, there's a screen that says I need to type a password to decrypt storage and I'm not able to access anything. If I go back into the bootloader and erase and write the stock recovery, I'm able to boot into the homescreen without the issue. Everything I've flashed to the tablet is done through my pc via fastboot. I never tried TWRP, but I don't like that recovery anyways.
Click to expand...
Click to collapse
OK, read and understood. Very bizzare, however. Almost sounds more like something caused by the bootloader (during the fastboot write) rather than it mattering which custom recovery is sitting there (it's not clear from the above, but it almost sounds like it is not even necessary to have ever booted the custom recovery from the device's recovery partition for the problem to appear)
Are you also saying that you can not flash a custom ROM from the custom recovery without this "enter password" phenomenon happening, or is it only this combo of pure stock ROM + recovery flashed via fastboot that exhibits the problem?
I have a lightly-rooted JDQ39 Stock (4.2.2) ROM with a custom recovery - no such troubles. But mine was installed by using factory-via-fastboot of 4.2.1, followed by a manually-triggered OTA to JDQ39, and then followed in turn by a fastboot flash of the recovery partition (TWRP 2.4.1.0). That last flash was certainly performed by the 4.18 bootloader.
No troubles, but that is certainly a different installation path.
Two more small questions for clarification purposes: when you installed the factory 4.2.2 ROM via fastboot, did you follow the exact sequence of the install-all.sh script:
Code:
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
fastboot flash bootloader bootloader-grouper-4.18.img
fastboot reboot-bootloader
sleep 10
fastboot -w update image-nakasi-jdq39.zip
... or did you omit anything (e.g. one or more of the erases, the bootloader flashing, etc)?
Yeah, it's like the bootloader writes bad information to the userdata partition if the recovery isn't stock. I haven't flashed a custom rom from the custom recovery, but I'm assuming the type your password issue would appear again. Yes, it's a combo of pure stock rom + custom recovery when this problem occurs. No, when I installed the 4.2.2 factory stock rom, I unzipped all the image files and typed these commands.
Code:
fastboot oem lock
fastboot oem unlock
fastboot flash bootloader <bootloader name>.img
fastboot flash boot <boot name>.img
fastboot flash system <system name>.img
fastboot flash userdata <userdata name>.img
fastboot reboot-bootloader
fastboot erase cache
fastboot reboot
I've also gone back and manually erased, formatted, and wrote the userdata partition again. Maybe I should try downgrading the bootloader to 4.2.1, reflash userdata, and flash the custom recovery?
UnlockedNand said:
Yeah, it's like the bootloader writes bad information to the userdata partition if the recovery isn't stock. I haven't flashed a custom rom from the custom recovery, but I'm assuming the type your password issue would appear again. Yes, it's a combo of pure stock rom + custom recovery when this problem occurs. No, when I installed the 4.2.2 factory stock rom, I unzipped all the image files and typed these commands.
Code:
fastboot oem lock
fastboot oem unlock
fastboot flash bootloader <bootloader name>.img
fastboot flash boot <boot name>.img
fastboot flash system <system name>.img
fastboot flash userdata <userdata name>.img
fastboot reboot-bootloader
fastboot erase cache
fastboot reboot
I've also gone back and manually erased, formatted, and wrote the userdata partition again. Maybe I should try downgrading the bootloader to 4.2.1, reflash userdata, and flash the custom recovery?
Click to expand...
Click to collapse
Hmmm. Well, I can't say for sure, but I am willing to gamble that the bootloader relocates itself into a load-offset address so that it runs out of RAM rather than running directly out of Flash Memory. Much quicker that way. The implication of that is that once it is fully loaded into RAM and operational, you could actually erase the bootloader and suffer no ill effects - until you powered off the device. Then you would be in real trouble.
The point is, in the Google factory sequence, all of the partition flashing is done by the new bootloader (4.18), whereas in your case none of it is done that way - except for the custom recovery flash. Here's the Google sequence:
- erase all partitions using currently installed bootloader (4.13)
- flash new bootloader and boot into it ( 4.13 -> 4.18 )
- flash all 4.2.2 ROM partitions using new bootloader
whereas your sequence looks like:
- (no explicit erasures)
- flash partitions with old bootloader (4.13)
- reboot into new bootloader ( 4.13 -> 4.18 )
- erase cache
- flash recovery with new bootloader ( 4.18 )
very different!
Also, the "-w" switch used in the google sequence causes partition erasure and re-formatting (depending on partition type) prior to each partition's flashing.
Without going through the lock/unlock procedure, I suppose it would be possible to reflash all the partitions with 4.18 to see if the problem disappears. But, now that I said that, I realize my tab - which had an OTA upgrade - is sort of similar in that the partitions & files patched by the OTA were all initially flashed by 4.13 (by me), patched by the OTA, and then finally I flashed only the custom recovery with the 4.18 bootloader.
Doing further experimentation might mean attempting a bootloader rollback flash. I can't say that I've seen reports here of anybody trying it. And I can't say I blame them - there could be dragons hiding in that process.
Ah, I see. The sequence I followed flashing the partitions would erase and write the partitions automatically done by the fastboot script. The only instance where I erased, formatted, and flashed the partition was the userdata when I was troubleshooting. From reading other threads before, I believe people have done bootloader rollbacks without consequences to the rest of the partitions. The bootloader updates contain fixes, but aren't explicitly required for the rom to run, am I correct?

Going back to Stock

Hi!
I'm trying to go back to stock+locked rom.
I have seen instructions with a lot of steps, but when I downloaded the rom from googe developers page, i noticed there is a flash-all.sh file that seems to do all the process...
Is this safe?
Code:
fastboot flash bootloader bootloader-mako-makoz10o.img
fastboot reboot-bootloader
sleep 5
fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.48.img
fastboot reboot-bootloader
sleep 5
fastboot -w update image-occam-jdq39.zip
I don't want to brick the phone
Guide by efrant:
D. Type in the commands into the command prompt
1) Make sure your computer recognizes your device by typing: fastboot devices
2) Unlock your bootloader (if you have not already done so): fastboot oem unlock
3) You will see a prompt on your device. This will wipe your entire device (including the /sdcard folder). Accept. Note: you use the volume keys to change the option and the power button to accept. You cannot use the touch screen.
4) Reboot by typing: fastboot reboot-bootloader
5) Flash the bootloader: fastboot flash bootloader bootloader-mako-makoz10l.img (or whatever the name of the bootloader image that you downloaded).
6) Reboot: fastboot reboot-bootloader
7) Flash the radio: fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.33.img (or whatever the name is of the radio image that you downloaded).
8) Reboot: fastboot reboot-bootloader
9) Flash the system partition: fastboot flash system system.img
10) Optional (NOT optional for n00bs) -- Flash the data partition: fastboot flash userdata userdata.img Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked. See note 2 below.
11) Flash the kernel/ramdisk: fastboot flash boot boot.img
12) Optional (NOT optional for n00bs) -- Flash the recovery partition: fastboot flash recovery recovery.img
13) Erase the cache partition: fastboot erase cache
14) Reboot: fastboot reboot
15) Done! The first boot will likely take quite a bit longer than you are used to, as Android builds the Dalvik cache.
Now you have a fully stock image on your device. The only thing that is different from out-of-the-box condition is that your bootloader is unlocked. See the notes section at the end of this post for information on re-locking the bootloader.
You have to unpack the system.image file as you can only flash .img files in fastboot. What`s with the sleep 5?
Good luck.
I've seen some youtube tutos that use that .sh file and it does flash the .zip with fastboot......
That's why I ask, I mean: The previous thread, which i already read before, is like a step-by-step process, when this .sh file would do it all for you!!
The sleep command gives 5 seconds of grace time for the device to reboot.....
GFXi0N said:
I've seen some youtube tutos that use that .sh file and it does flash the .zip with fastboot......
That's why I ask, I mean: The previous thread, which i already read before, is like a step-by-step process, when this .sh file would do it all for you!!
The sleep command gives 5 seconds of grace time for the device to reboot.....
Click to expand...
Click to collapse
Haven`t used that method myself, but if you think it will work go ahead
WOrst case scenario, the console woud throw me out to the command prompt and I would have to do it by hand......

Nexus 7 Bricked??/Broken

Nexus 7 was rooted,unlocked bootloader and was running paranoid anroid 3.90+ i think . i plugged it into the computer to get a new rom using nexus root toolkit v1.7.2. i was asked to update a few things, so i clicked yes. i then tried to flash stock + unroot and chose 4.3 cause i wanted to try the new OS. but i guess something happened because when i turned my nexus 7 back on i was stuck on the load screen (GOOGLE image with a unlocked lock) i could cycle thru a few options using volume keys (start,recovery,power off) .all of them seemed useless as they would just bring me back to where i was.when clicking start "booting failed" come up on the upper left side. when trying to flash stock +unroot using NRT i get up to the sending "bootloader" part and my nexus 7 just freezes, how do i fix this. please and thanks
download the factory image from the google factory image and extract the archive.
try flashing the bootloader manualy with fastboot.
locate your fastboot binary and copy the bootloader image to that directory.
open a commandline in that directory and type
fastboot flash bootloader name-of-bootloader.img
after that you can try to flash the whole factory image with the flash-all.sh script.
Simple
dieselmonkeyy said:
i could cycle thru a few options using volume keys (start,recovery,power off) .all of them seemed useless as they would just bring me back to where i was.when clicking start "booting failed" come up on the upper left side.
Click to expand...
Click to collapse
Boot failed??? That's a bad flash of the stock ROM. I had the same problem at my first attempt trying to flash Stock ROM, but don't worry! Let's do this:
WARNING: Before you continue you are accepting that I'm not responsible of anything can happen to your Nexus and your battery is fully charged.
When you download the stock ROM you have to uncompress the zip file. You will find the bootloader and another zip.
Uncompress that zip file, put fastboot program, the bootloader and the files together.
Then start your Nexus into bootloader mode, connect it to your PC, open a console (cmd for Windows, Terminal for Linux and Mac OS X) and type this:
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
WARNING: Your Nexus is FULLY EMPTY!!! Don't reboot it because it can get a full brick (It will not turn on any more).
Now type this:
fastboot flash bootloader bootloader-grouper-X.XX.img
NOTE: Replace X.XX with your version.
Now type:
fastboot reboot-bootloader
Your Nexus will reboot.
Type this:
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash recovery recovery.img
fastboot flash system system.img #Will take a very long time. DON'T INTERRUPT THE PROCESS!!!!!
fastboot flash userdata userdata.img
Now reboot again with:
fastboot reboot-bootloader
Re-unlock bootloader to get a full wipe:
fastboot oem lock
Reboot again:
fastboot reboot-bootloader
And then unlock the bootloader:
fastboot oem unlock
Press "Yes" to the petition screen and reboot:
fastboot reboot
Ready the Nexus!
I had the same problem and I did this.
I hope I can help you.
Sorry for my bad English. I'm from Argentina and I'm learning.
Well,
Good luck!
MlucianoEze said:
Boot failed??? That's a bad flash of the stock ROM. I had the same problem at my first attempt trying to flash Stock ROM, but don't worry! Let's do this:
WARNING: Before you continue you are accepting that I'm not responsible of anything can happen to your Nexus and your battery is fully charged.
When you download the stock ROM you have to uncompress the zip file. You will find the bootloader and another zip.
Uncompress that zip file, put fastboot program, the bootloader and the files together.
Then start your Nexus into bootloader mode, connect it to your PC, open a console (cmd for Windows, Terminal for Linux and Mac OS X) and type this:
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
WARNING: Your Nexus is FULLY EMPTY!!! Don't reboot it because it can get a full brick (It will not turn on any more).
Now type this:
fastboot flash bootloader bootloader-grouper-X.XX.img
NOTE: Replace X.XX with your version.
Now type:
fastboot reboot-bootloader
Your Nexus will reboot.
Type this:
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash recovery recovery.img
fastboot flash system system.img #Will take a very long time. DON'T INTERRUPT THE PROCESS!!!!!
fastboot flash userdata userdata.img
Now reboot again with:
fastboot reboot-bootloader
Re-unlock bootloader to get a full wipe:
fastboot oem lock
Reboot again:
fastboot reboot-bootloader
And then unlock the bootloader:
fastboot oem unlock
Press "Yes" to the petition screen and reboot:
fastboot reboot
Ready the Nexus!
I had the same problem and I did this.
I hope I can help you.
Sorry for my bad English. I'm from Argentina and I'm learning.
Well,
Good luck!
Click to expand...
Click to collapse
what do i type into cmd inorder to be able to type
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
and get it to work. im a noob . thanks in advance
You have to be in the folder with fastboot inside else those commands will not work.
It will be easier if you put the images extracted from the zip into the zip together with the fastboot program.
If you don't understand yet I'll try to be more specific.
Sent from my Nexus 7 using xda app-developers app
dieselmonkeyy said:
what do i type into cmd inorder to be able to type
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
and get it to work. im a noob . thanks in advance
Click to expand...
Click to collapse
It can be intimidating... and the so-called tool-kits don't help you learn
I assume you are using Windows.
follow the unzip instructions from the previous poster. (not quoted here). note the directory.
find the directory containing your android tools... ADB.exe and FASTBOOT.exe.
transfer your unzipped files to this directory. Open your CMD prompt window and change to this directory if necessary.
plug in your Nexus.
type fastboot device at the prompt. MAKE SURE YOUR NEXUS 7 is listed (serial number)
proceed with the complete instructions from the previous poster.
that should do it.
YES!!!
thanks alot for the instructions, it worked!!! i hope people use ur instructions as reference if they have the same problem. THANKS ALOT!!!
dieselmonkeyy said:
thanks alot for the instructions, it worked!!! i hope people use ur instructions as reference if they have the same problem. THANKS ALOT!!!
Click to expand...
Click to collapse
I'm glad the problem is solved. Do not forget to click the THANKS button.
Sent from my Nexus 7 using xda app-developers app
Hello. My brother's Nex 7 is also has this issue. I cannot follow any of the steps as it gets stuck on erasing any of the partitions. I tried erasing those partitions in any order and they still get stuck. His device was stock and bootloader locked too. When I try to unlock the bootloader, it gets stuck as well at the erasing userdata part. I suspect a bad memory chip. Anyone else experience this?
Yes, mine is sticking on the (bootloader) erasing userdata on bootloader unlock as well.
It also sticks on any fastboot ERASE command.
Factory reset had a bunch of errors and no longer comes up. none of the FLASH commands work because the BOOTLOADER is locked.
And since it freezes on the unlocking bootloader commands I believe I am screwed.
This was a factory installed, never flashed, unlocked or rooted Nexus 7 wifi 2nd gen. After installing the 4.4.2 that popped up it loaded once then crashed and never loaded again
I have tried every tool I can find. They all stick on the erase part.
jophisdrazin said:
Yes, mine is sticking on the (bootloader) erasing userdata on bootloader unlock as well.
It also sticks on any fastboot ERASE command.
Factory reset had a bunch of errors and no longer comes up. none of the FLASH commands work because the BOOTLOADER is locked.
And since it freezes on the unlocking bootloader commands I believe I am screwed.
This was a factory installed, never flashed, unlocked or rooted Nexus 7 wifi 2nd gen. After installing the 4.4.2 that popped up it loaded once then crashed and never loaded again
I have tried every tool I can find. They all stick on the erase part.
Click to expand...
Click to collapse
Send your device for repair. My brother did so. My suspicions were correct. A faulty chip. They replaced the whole board, according to my brother.
Sent from my Nexus 7 using Tapatalk

FYI: recovered G5 XT 1676 to stock and updated. :)

Just an FYI type thing that may save people a bit of digging around sometime.
I tried to get the update that just came out, but as i had TWRP as recovery, no good. Anyhow, in my trying i completely bollixed the phone. Would start, but always booted to TWRP and had various conniptions. Could not even get a TWRP backup to load. Strange not encountered before by me stuff............
Anyhow, recovered by the following method to stock and am back in business.
Boot into bootloader fastboot mode.
Extract .xml.zip format firmware file:
eg: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
to a folder on c drive of the PC that has the ADB and fastboot files in it.
In command prompt cd\ to that directory.
fastboot flash the following in sequence.
fastboot flash partition gpt.bin
fastboot flash motoboot motoboot.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk1
fastboot flash system system.img_sparsechunk2
fastboot flash system system.img_sparsechunk3
fastboot flash system system.img_sparsechunk4
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
boots to stock .
Not my own work, adapted from this thread by t-bon3
https://forum.xda-developers.com/showthread.php?t=2542219
which I found thanks to eens post18 at this thread
https://forum.xda-developers.com/g5/how-to/npp25-137-33-stock-firmware-moto-g5-t3577084/page2
After this, Motorola system update installed. On Australian XT1676 is build number NPP25.137-15-7
Patch level 1-May-2017
Still get the I cant be trusted page on power up as have unlocked bootloader.
Many thanks to all at XDA, its a resource that can certainly get you into trouble, but then out of it again.
where do you get the stock firmware?
Think I worked out what I did wrong. Somehow, I changed the format of the data partition. Fat fingers at some point??
TWRP backups didn’t like that and would not mount or write to the data partition as it was not f2fs format that the backup had been made in??
Anyway, restored data from a TWRP backup after going to ....wipe…format data. All good.
That gave me the passcode lockout issue at next reboot which can deal with.
stock Firmware? http://www.filefactory.com/folder/c6cdedc45a775d27/?sort=created&order=DESC&show=25
for me stock the phone came with is: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
Worked on my XT1676 dual sim, but CHECK if its appropriate for your model. There are files on that page that wont be and flashing some of their components (particularly bootloader), can i have read, be unrecoverable disastrous. Be warned.
Slow, but got it. At first i thought it was corrupt as TWRP wouldn't flash it. My gumby. The .xml.zips apparently need to be extracted and flashed file by file.
We're you able to revert to a locked bootloader after this, I am looking forward to do so
We're you able to revert to a locked bootloader after this, I am looking forward to do so
Click to expand...
Click to collapse
didnt try, didnt need to for taking take the update.
And, from my reading there is no way so far to relock the bootloader. I got it to stock, with stock recovery, and that was enough for me.
astmacca said:
didnt try, didnt need to for taking take the update.
And, from my reading there is no way so far to relock the bootloader. I got it to stock, with stock recovery, and that was enough for me.
Click to expand...
Click to collapse
I can confirm what you said, but I am asking because I am sick of the warning before the device starts
ap4ss3rby said:
I can confirm what you said, but I am asking because I am sick of the warning before the device starts
Click to expand...
Click to collapse
You can get rid of that easily
Put phone in fastboot mode
Download logo from link below
Enter the following in a windows command prompt where you have fastboot files & the logo file
Code:
fastboot.exe flash logo logo-g5-fix.bin
http://drive.google.com/file/d/0B-idWfPYugGvREJaR3B0UFIxUkU/view?usp=sharing
TheFixItMan said:
You can get rid of that easily
Put phone in fastboot mode
Download logo from link below
Enter the following in a windows command prompt where you have fastboot files & the logo file
Code:
fastboot.exe flash logo logo-g5-fix.bin
http://drive.google.com/file/d/0B-idWfPYugGvREJaR3B0UFIxUkU/view?usp=sharing
Click to expand...
Click to collapse
Thanks, but this is why I made a Google pixel themed logo.bin and used a matching boot animation to go with it some time earlier
downgrade
thanks for the guide
- can i use this method to downgrade to this version?
- can i do this without unlocking the bootloader
- if it goes wrong can i unlock the bootloader later (i have an unlock code)
- is there a reason why we don't flash sparsechunk.0 ?
thanks in advance
distclean said:
thanks for the guide
- can i use this method to downgrade to this version?
- can i do this without unlocking the bootloader
- if it goes wrong can i unlock the bootloader later (i have an unlock code)
- is there a reason why we don't flash sparsechunk.0 ?
thanks in advance
Click to expand...
Click to collapse
No you cannot downgrade (same firmware version or newer required)
Yes - unlocked bootloader not required
As long as your phone still goes into the bootloader
You should flash all sparsechunks in number order
Thanks a bunch,
So to be absolutely clear, my phone shipped with NPP25.137-15-7 i can't install the stock rom linked, and the same version isn't out yet,
if i unlock the bootloader, would i be able to downgrade ?
Is the software channel setting preserved across this method?
distclean said:
Thanks a bunch,
So to be absolutely clear, my phone shipped with NPP25.137-15-7 i can't install the stock rom linked, and the same version isn't out yet,
if i unlock the bootloader, would i be able to downgrade ?
Is the software channel setting preserved across this method?
Click to expand...
Click to collapse
You maybe able to - there are different variants of the same phone
As long as the firmware is the same or newer (as in the bootloader and API version) it may flash
It will either flash or error out
There's only one way to find out - if your phone is dead anyway it's not going to make alot of difference
No - generally you can never downgrade firmware - doing so would be dangerous and you may loose the bootloader for good
thanks again,
motoboot.img is the bootloader you talk about? is the partition layout described somewhere? would custom roms use a different one here?
do tell me by the way if i should get this information elsewhere/if i should read something to get started in the whole moto g world.
distclean said:
thanks again,
motoboot.img is the bootloader you talk about? is the partition layout described somewhere? would custom roms use a different one here?
do tell me by the way if i should get this information elsewhere/if i should read something to get started in the whole moto g world.
Click to expand...
Click to collapse
You can write in adb
Code:
adb shell
cat /proc
cat /proc/partitions
Hello,
Does anyone know where can I download the latest firmware for Moto G5 XT1676 baseband Version: m8937_ 8000.122.02.40 R
Thanks
astmacca said:
Boot into bootloader fastboot mode.
Extract .xml.zip format firmware file:
eg: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
to a folder on c drive of the PC that has the ADB and fastboot files in it.
In command prompt cd\ to that directory.
fastboot flash the following in sequence.
fastboot flash partition gpt.bin
fastboot flash motoboot motoboot.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk1
fastboot flash system system.img_sparsechunk2
fastboot flash system system.img_sparsechunk3
fastboot flash system system.img_sparsechunk4
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
boots to stock .
Click to expand...
Click to collapse
You're partially right. These commands won't work for our files. You have to flash the firmware according to the instructions contained within the "flashfile.xml" file within the archive. For example we have no "motoboot" partition
I've flashed every stock package available now (4 I think) and haven't been offered an update once. I've ran a couple of custom ROMs but they're just not right in one way or another. Might be time to move on.
distclean said:
Thanks a bunch,
So to be absolutely clear, my phone shipped with NPP25.137-15-7 i can't install the stock rom linked, and the same version isn't out yet,
if i unlock the bootloader, would i be able to downgrade ?
Is the software channel setting preserved across this method?
Click to expand...
Click to collapse
I upgraded to this and since then can't downgrade the phone to the stock roms available online. From memory trying to flash gpt.bin gave a "Security version downgrade" error. So I wouldn't assume you'll be able to downgrade and until there is a copy of this particular firmware, you won't be able to flash back or relock the bootloader
astmacca said:
Think I worked out what I did wrong. Somehow, I changed the format of the data partition. Fat fingers at some point??
TWRP backups didn’t like that and would not mount or write to the data partition as it was not f2fs format that the backup had been made in??
Anyway, restored data from a TWRP backup after going to ....wipe…format data. All good.
That gave me the passcode lockout issue at next reboot which can deal with.
stock Firmware? http://www.filefactory.com/folder/c6cdedc45a775d27/?sort=created&order=DESC&show=25
for me stock the phone came with is: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
Worked on my XT1676 dual sim, but CHECK if its appropriate for your model. There are files on that page that wont be and flashing some of their components (particularly bootloader), can i have read, be unrecoverable disastrous. Be warned.
Slow, but got it. At first i thought it was corrupt as TWRP wouldn't flash it. My gumby. The .xml.zips apparently need to be extracted and flashed file by file.
Click to expand...
Click to collapse
Is this ROM is good to my XT1676 Baseband: M8937_11.16.02.51R ?
astmacca said:
Think I worked out what I did wrong. Somehow, I changed the format of the data partition. Fat fingers at some point??
TWRP backups didn’t like that and would not mount or write to the data partition as it was not f2fs format that the backup had been made in??
Anyway, restored data from a TWRP backup after going to ....wipe…format data. All good.
That gave me the passcode lockout issue at next reboot which can deal with.
stock Firmware? http://www.filefactory.com/folder/c6cdedc45a775d27/?sort=created&order=DESC&show=25
for me stock the phone came with is: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
Worked on my XT1676 dual sim, but CHECK if its appropriate for your model. There are files on that page that wont be and flashing some of their components (particularly bootloader), can i have read, be unrecoverable disastrous. Be warned.
Slow, but got it. At first i thought it was corrupt as TWRP wouldn't flash it. My gumby. The .xml.zips apparently need to be extracted and flashed file by file.
Click to expand...
Click to collapse
Hi, i own the same model of moto g5, i do this in fastboot window
fastboot erase userdata
now the phone only boot in twrp and show a message "failed to mount /data". i think that delete my userdata partition, how could i fix it?
once i can avoid this loop in twrp, i follow these steps to flash stock rom
thanks in advance
juan

[ROM][STOCK][FASTBOOT][OP8] Stock Fastboot ROMs for OnePlus 8

Things are changing with the advent of project treble and seamless updates. OnePlus will no longer release ROMs flashable via recovery (either stock) because is no more needed. The updates will be done on the slot not used for example if you are using slot a the update will be installed on slot b and the slot b will be set as default. If you brick and you are in bootloop how you can restore the rom? You can't with Stock ROM you have, because the zip can be only installed via Update Engine, so what can you do? Flash a stock rom via fastboot. I have extracted all images from the stock zip and i have made a new zip with the Fastboot ROM with a flash-all.bat included. This will work only if your bootloader is unlocked. This will erase all your data and will wipe your internal storage.
HOW TO FLASH
This version is only for not branded devices
Download the zip;
Unpack the zip in a folder;
Reboot the OnePlus 8 in fastboot-bootloader mode (Power and volume + and volume-);
Connect the OnePlus 8 to PC;
Run flash-all.bat flasher you need;
Wait until the process end;
The phone will automatically reboot.
DOWNLOAD
All roms on Sourceforge: https://sourceforge.net/projects/fastbootroms/files/OnePlus 8
BRANDED PHONE
For now branded device are not supported
MANUAL FLASH: Windows - OSX - Linux
If you want to manual flash these roms these are the commands (You need the latest sdk platform tools, you can find it here
Is reccomended to format data or the rom cannot boot:
Code:
fastboot -w
Others Commands to flash a fastboot rom
Code:
fastboot flash aop aop.img
fastboot flash bluetooth bluetooth.img
fastboot flash boot boot.img
fastboot flash dsp dsp.img
fastboot flash dtbo dtbo.img
fastboot flash LOGO LOGO.img
fastboot flash modem modem.img
fastboot flash oem_stanvbk oem_stanvbk.img
fastboot flash qupfw qupfw.img
fastboot flash storsec storsec.img
fastboot flash multiimgoem multiimgoem.img
fastboot flash uefisecapp uefisecapp.img
fastboot flash recovery recovery.img
fastboot --disable-verity flash vbmeta vbmeta.img
fastboot --disable-verity flash vbmeta_system vbmeta_system.img
fastboot flash opproduct opproduct.img
fastboot reboot fastboot
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash product product.img
fastboot reboot
REMEMBER
"Invalid sparce file format at header magic" is not an error, you need to wait a bit when you see that string, just wait.
If the device automatically reboot in Stock Recovery mode don't reboot it and wait the flash end.
These ROMs can't be used to update or downgrade your phone but just to restore your phone.
If the rom seems doesn't start go in recovery stock and follow this guideline: English -> Wipe data and cache -> Erase everything.
If you want to rebrand your phone from HydrogenOS to OxygenOS you can follow this guide: Rebrand Guide
If you want you can use also my tool to flash Factory Images, unlock bootloader, flash twrp or to understand if the device is recognized: https://toolaio.tk/
If you got some problems like write error or no partition, check this: https://forum.xda-developers.com/showpost.php?p=76658555&postcount=34
DONATE LINK
If you want to support this and others my projects please consider making a donation, thanks.
​
Branded devices is for example a Chinese version with HydrogenOS to which OxigenOS has been installed? If so, how can a branded device be recovered?
Thanks
Hi guys, i'm here again to ask for your support, actually with android 10 Google introduced a lot of changing, from dynamic partitions to the new keymaster 4 encryption/decryption. Teamwin is working hard to update TWRP but they will still take some time. Currently some things already work but there are difficulties in bringing them to the OnePlus 8/8 Pro, for example decryption already works but creates some problems on the OnePlus devices. That's why I decided to create a Paypal moneybox to be able to bring you the latest updates in the shortest time possible. As I have previously done, I assure you of a support of at least 2 years (within the limits of my possibilities). In addition to the TWRP I will improve the fastboot roms and add OnePlus 8/8 Pro to my TOOL ALL IN ONE (and maybe I will also bring the RevengeOS). By getting hold of a OnePlus 8 or 8 Pro I will also be able to improve the TWRP for OnePlus 7T and 7T Pro.
OnePlus 8/8 Pro PayPal MoneyBox: https://www.paypal.com/pools/c/8pfrIOL3Qa
If you are unable to participate in the PayPal moneybox, you can make a normal donation (perhaps specifying that it is for the moneybox), however all private donations that I will receive for this or other projects will be included in the moneybox.
Private PayPal Donations: https://www.paypal.me/MauronofrioTool
Why after flash it, it boot up to Qualcomm crashdump mode and how to fix?
sakun-ice said:
Branded devices is for example a Chinese version with HydrogenOS to which OxigenOS has been installed? If so, how can a branded device be recovered?
Thanks
Click to expand...
Click to collapse
I think unbranded devices mean the device bought from T-Mobile or Verizon. Nothing to do with chinese versiion flash oxygenOS, if I'm not wrong.
Can't seem to get this to work. I'm trying to flash a stock rom for my OnePlus 8 after bricking it during a rooting process.
The device' bootloader is obviously unlocked and i can get the phone into Fastboot mode and connected to my PC.
The only issue is when i execute the flash-all.bat file, it can't seem to flash any of the files and gives an error consisting of the message "FAILED (remote: 'Flashing is not allowed for Critical Partitions').
What to do guys? Can anyone help me out.
Does anyone know where to find mobile oneplus 8 5g tmobile from mine is bricked I had same error as post above
KJStar said:
Can't seem to get this to work. I'm trying to flash a stock rom for my OnePlus 8 after bricking it during a rooting process.
The device' bootloader is obviously unlocked and i can get the phone into Fastboot mode and connected to my PC.
The only issue is when i execute the flash-all.bat file, it can't seem to flash any of the files and gives an error consisting of the message "FAILED (remote: 'Flashing is not allowed for Critical Partitions').
What to do guys? Can anyone help me out.
Click to expand...
Click to collapse
Try to flash fastboot rom with "tool all in one),It worked for me.
I needed modem I forgot to fastboot reboot fastboot guy in post 6 that's all you need to do is reboot fastboot then flash all I was looking for different file
Never mind I fixed it by downloading ota and going to system updates in settings because fastboot won't flash to modem right
I am having issues flashing. flashing not allowed on critical partition. please help I tried to use the large address aware program but nothing has changed.
bluemoel said:
I am having issues flashing. flashing not allowed on critical partition. please help I tried to use the large address aware program but nothing has changed.
Click to expand...
Click to collapse
Make sure your on the latest update: 10.5.8
mauronofrio said:
Things are changing with the advent of project treble and seamless updates. OnePlus will no longer release ROMs flashable via recovery (either stock) because is no more needed. The updates will be done on the slot not used for example if you are using slot a the update will be installed on slot b and the slot b will be set as default. If you brick and you are in bootloop how you can restore the rom? You can't with Stock ROM you have, because the zip can be only installed via Update Engine, so what can you do? Flash a stock rom via fastboot. I have extracted all images from the stock zip and i have made a new zip with the Fastboot ROM with a flash-all.bat included. This will work only if your bootloader is unlocked. This will erase all your data and will wipe your internal storage.
HOW TO FLASH
This version is only for not branded devices
Download the zip;
Unpack the zip in a folder;
Reboot the OnePlus 8 in fastboot-bootloader mode (Power and volume + and volume-);
Connect the OnePlus 8 to PC;
Run flash-all.bat flasher you need;
Wait until the process end;
The phone will automatically reboot.
DOWNLOAD
All roms on Sourceforge: https://sourceforge.net/projects/fastbootroms/files/OnePlus 8
BRANDED PHONE
For now branded device are not supported
MANUAL FLASH: Windows - OSX - Linux
If you want to manual flash these roms these are the commands (You need the latest sdk platform tools, you can find it here
Is reccomended to format data or the rom cannot boot:
Code:
fastboot -w
Others Commands to flash a fastboot rom
Code:
fastboot flash aop aop.img
fastboot flash bluetooth bluetooth.img
fastboot flash boot boot.img
fastboot flash dsp dsp.img
fastboot flash dtbo dtbo.img
fastboot flash LOGO LOGO.img
fastboot flash modem modem.img
fastboot flash oem_stanvbk oem_stanvbk.img
fastboot flash qupfw qupfw.img
fastboot flash storsec storsec.img
fastboot flash multiimgoem multiimgoem.img
fastboot flash uefisecapp uefisecapp.img
fastboot flash recovery recovery.img
fastboot --disable-verity flash vbmeta vbmeta.img
fastboot --disable-verity flash vbmeta_system vbmeta_system.img
fastboot flash opproduct opproduct.img
fastboot reboot fastboot
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash product product.img
fastboot reboot
REMEMBER
"Invalid sparce file format at header magic" is not an error, you need to wait a bit when you see that string, just wait.
If the device automatically reboot in Stock Recovery mode don't reboot it and wait the flash end.
These ROMs can't be used to update or downgrade your phone but just to restore your phone.
If the rom seems doesn't start go in recovery stock and follow this guideline: English -> Wipe data and cache -> Erase everything.
If you want to rebrand your phone from HydrogenOS to OxygenOS you can follow this guide: Rebrand Guide
If you want you can use also my tool to flash Factory Images, unlock bootloader, flash twrp or to understand if the device is recognized: https://toolaio.tk/
If you got some problems like write error or no partition, check this: https://forum.xda-developers.com/showpost.php?p=76658555&postcount=34
DONATE LINK
If you want to support this and others my projects please consider making a donation, thanks.
​
Click to expand...
Click to collapse
Hi, do you know if patching with local update a Oxygen OS Europe release from a Global release may cause problems to the fingerprint? I have a IN2010 with the Global OxygenOS but I would like to switch to the European versione becasue I live in Italy like you
Why not flash reserve.img?
nnyd said:
Why not flash reserve.img?
Click to expand...
Click to collapse
Because it is placed in userdata and not in a dedicated partition
I have an issue trying to flash on fastboot. It's says I can't flash on critical partitions. Yes I know alot of people are saying that but what I haven't seen is this:
This is my problem:
Fastboot get device-info
(Bootloader) device unlocked:true
(Bootloader) device critical unlock: false
(Bootloader) charger screen enabled: true
I have already tried "fastboot flashing unlock_critical"
It says bootloader already unlocked. I then re lock bootloader which I know is not a good idea( reflash stock with msm tool) and it lock then I try unlock critical command again and it still says device critical unlock: false
i need help please ..
i tried this method not the latest version i tried the 10.5.4 global
so it gave me all failed and error to foramt and others
then it restart my phone to show me crashdump
what should i do ?
should i use latest version ?
i hope you replay fast .. thank you
Alucardo1 said:
i tried this method not the latest version i tried the 10.5.4 global
so it gave me all failed and error to foramt and others
then it restart my phone to show me crashdump
what should i do ?
should i use latest version ?
i hope you replay fast .. thank you
Click to expand...
Click to collapse
Try again with 10.5.7. When it reboot to recovery, let it continue to run till it reboots on its own.
Unbrick from fastboot method
I hope I can help someone since I spent the whole night trying various methods to unbrick my Oneplus 8 and only this one worked for me JUST FOR INTERNATIONAL VERSION
You must have the drivers installed (Adb & Fastboot)
You must have your phone with the bootloader unlocked
1.- Download the file
2.-Unzip it
inside you will find Flash-all.bat
3.-Enter Fastboot mode
4.-Double click on the Flash-all.bat command
5.-It will direct you to the recovery, select the English language and restart in fastboot mode so that the process continues, wait for it to finish flashing everything and ready, the phone restarts on the latest version
https://mega.nz/folder/8tpUSSrR#7wH4NX_ccr2a6Ub8LXpsEA
Donate Link to support my work
https://paypal.me/pakomorales?locale.x=es_XC
cannot relock bootloader on oneplus 8
bro thanks for fastboot room for oneplus 8,i flash your fastboot room 10.5.9 everthing ok,but i relocked to boot loader it the phone be correpted. what should i do ,
please help me.

Categories

Resources