Related
Sometimes I completely wipe my device before puting a rom on it, when I got my Gnex obviously because it had no removable sd card I couldnt remove it and format it.
I used this command yesterday to wipe my rooted N4 and it wont boot, I've flashed a stock image to get it up and running again and for testing purposes tried it again but with a different rooted rom, same outcome.
1) Does anyone know why this would be?
2) Is there a better way to completely wipe my device without causing this problem
Thanks in advance
on fastboot erase userdata
Hello.
I think I got into a similar problem as you did.
I wanted to write JOP40D using the google factory images on my Nexus 4, and in the process I also used a combination of fastboot -w as well as fastboot erase userdata. Now my phone won't boot up completely.
I wanted to ask you if/how you managed to recover to stock...
I personally tried using google's stock factory images for Nexus 4 (from developers.google.com), without success.
Thanks in advance.
Re: on fastboot erase userdata
FYI, Nexus 4 Toolkit did it for me.
1) The problem is the google factory image script does not reformat userdata && cache. These stay damaged from the initial fastboot erase operation done within the same script sequence. The Toolkit does 'reformat' them.
Not sure why this happens, may be from a bad erase that does not trigger reformatting, but it probably has to do with the version of fastboot you run on your PC versus the fastboot backend phone daemon. I posted online about this and hope to get some answers.
2) There must be a way to trigger this reformatting of userdata && cache...
boy3dfx said:
FYI, Nexus 4 Toolkit did it for me.
1) The problem is the google factory image script does not reformat userdata && cache. These stay damaged from the initial fastboot erase operation done within the same script sequence. The Toolkit does 'reformat' them.
Not sure why this happens, may be from a bad erase that does not trigger reformatting, but it probably has to do with the version of fastboot you run on your PC versus the fastboot backend phone daemon. I posted online about this and hope to get some answers.
2) There must be a way to trigger this reformatting of userdata && cache...
Click to expand...
Click to collapse
Sorry for the late reply only just seen it, so there's def a problem then and not something im doing wrong...
you might wanna update the sdk, when i used the same commands adb said someting like "you mean format" and processed the command without isssues
Stretlow said:
Sometimes I completely wipe my device before puting a rom on it, when I got my Gnex obviously because it had no removable sd card I couldnt remove it and format it.
I used this command yesterday to wipe my rooted N4 and it wont boot, I've flashed a stock image to get it up and running again and for testing purposes tried it again but with a different rooted rom, same outcome.
1) Does anyone know why this would be?
2) Is there a better way to completely wipe my device without causing this problem
Thanks in advance
Click to expand...
Click to collapse
1) Doing this on my Atrix 2 also causes a bootloop. I'm assuming it's because it is completely erasing the data partition instead of formatting it.
2) Try using fastboot format userdata (this works for me), or use the toolkit/a custom recovery to do your wiping.
Sent from my MB865 using xda premium
boy3dfx said:
FYI, Nexus 4 Toolkit did it for me.
1) The problem is the google factory image script does not reformat userdata && cache. These stay damaged from the initial fastboot erase operation done within the same script sequence. The Toolkit does 'reformat' them.
Not sure why this happens, may be from a bad erase that does not trigger reformatting, but it probably has to do with the version of fastboot you run on your PC versus the fastboot backend phone daemon. I posted online about this and hope to get some answers.
2) There must be a way to trigger this reformatting of userdata && cache...
Click to expand...
Click to collapse
Yes, there is a way to format partitions. The most recent version of fastboot supports this command.
Code:
fastboot format <partition>
So it works like this:
Code:
#format userdata
fastboot format userdata
#format cache
fastboot format cache
comminus said:
Yes, there is a way to format partitions. The most recent version of fastboot supports this command.
Code:
fastboot format <partition>
So it works like this:
Code:
#format userdata
fastboot format userdata
#format cache
fastboot format cache
Click to expand...
Click to collapse
Thanks! I was stuck at the endless boot logo after trying to restore with the factory image via fastboot. This got me back to normal booting.
Ok so I updated my SDk last night and typed (without quotes) "fastboot erase userdata" it gave me a message saying DID YOU MEAN FASTBOOT FORMAT USERDATA" then it completed the action however my phone still didnt boot.
Sorry for my ADB noobness but just to clarify...
I used to type exactly as this "fastboot erase userdata"
And now I have to type this
"fastboot format userdata" which should fix the issue, Erase all userdata (media, pictures etc) and boot the device
Thanks again chaps
boy3dfx said:
FYI, Nexus 4 Toolkit did it for me.
1) The problem is the google factory image script does not reformat userdata && cache. These stay damaged from the initial fastboot erase operation done within the same script sequence. The Toolkit does 'reformat' them.
Not sure why this happens, may be from a bad erase that does not trigger reformatting, but it probably has to do with the version of fastboot you run on your PC versus the fastboot backend phone daemon. I posted online about this and hope to get some answers.
2) There must be a way to trigger this reformatting of userdata && cache...
Click to expand...
Click to collapse
^^^ This, I have been going crazy trying to figure out the issue with the hanging boot. The format makes it boot everytime.
The problems are being caused when fastboot erase is used to delete the contents of the partition.
FASTBOOT ERASE IS NOT NEEDED ON THE NEXUS 4 (only the Nexus 7 uses fastboot erase to wipe the partitions before flashing).
If flashing manually just use the google script supplied with the stock image to flash correctly (from the jop40d build. If flashing jop40c then use the correct image names for that):
fastboot flash bootloader bootloader-mako-makoz10l.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.33.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot -w update image-occam-jop40d.zip
Or use the Nexus 4 Toolkit to do it all automatically and properly
Mark.
[removed].
sdkmanager
android_sdk/tools/bin
Hi all,
My n10 is bootlooping and I tried to flash a factory image from ADB but it fails with the error that there is no space left. Is it possible to erase the SD card through ADB? Thanks!
mlclm- said:
Hi all,
My n10 is bootlooping and I tried to flash a factory image from ADB but it fails with the error that there is no space left. Is it possible to erase the SD card through ADB? Thanks!
Click to expand...
Click to collapse
Yes
fastboot erase data
But when flashing new software its best to
fastboot erase system -w
Side note, I have seen this issue fixed often just by updating fastboot and adb binaries on pc
Hello all,
I left a similar post in a couple other threads, and thought maybe someone here might have some insight into my problem.
Been running AICP rom (no custom kernel except the one that comes with AICP) with f2fs on /data and /cache for several months on 16GB grouper. About a month or so ago, the wife installed a game that wouldn't run on this hardware (King's Paradise Bay), and I uninstalled it. It left a file in /data/data/....etc that couldn't stat in TWRP, so no nandroid backups since then. I figured I'd just backup user data with TiBkp and wipe with fresh install of latest AICP when time permitted.
The other night I noticed the N7 was boot looping, getting to the stage where the boot animation dims. The boot anim would hang and after several seconds the Google unlock splash screen would come up and the N7 would try to boot again.
I can get into TWRP and bootloader with no problem. However, when TWRP comes up, the log shows the red entries for 2 files that can't stat, which has been this way since that game was uninstalled. I cannot seem to wipe *any* partition, and when I attempt to format or wipe userdata in TWRP, the N7 spontaneously reboots. Manually attempting to wipe/format/etc. via FastBoot doesn't work, with error message showing after trying to flash bootloader. Also, I can't change /data or /cache back to ext4. I am able to successfully read, write, and delete files on the N7 via computer USB MTP connection.
If the N7's flash memory has somehow become corrupted, is there a way to completely erase/format/whatever so that this wonderful device can become usable again? Any help would be greatly appreciated.
Thanks in advance.
Hello,
don't flash Bootloader via Fastboot. You should do this commands:
Code:
fastboot erase cache
fastboot erase userdata
fastboot erase system
fastboot erase boot
Trafalgar Square said:
Hello,
don't flash Bootloader via Fastboot. You should do this commands:
Code:
fastboot erase cache
fastboot erase userdata
fastboot erase system
fastboot erase boot
Click to expand...
Click to collapse
Yes, I have attempted all these commands, followed by flashing with either fastboot or TWRP with no success. Fastboot reports success, but partitions are not erased.
I have the same problem. The Nexus Root Toolkit can not flashign. It succeeds only boot TWRP. In TWRP computer sees the files from the tablet.I could not rename and delete. Wipe the TWRP and stock recovery displays the status OK, and the files are deleted. Fastboot shows that uploads, but all files remain unchanged.
Hi,
I have a Nexus 4 which was flashed with Lollipop 5.1.1.
My problem started when, after letting the battery completely drain and then trying to turn the phone on again, I got stuck on the message "Android is starting... optimizing apps" for days. I tried rebooting and factory format with no success.
I also tried formatting it through TWRP, but I got the message "Unable to mount /cache". After that, I tried flashing older factory images but only got my phone to work with the oldest version of jelly bean available by google developers page (4.2.2). After I got it to work, I tried to OTA update it to 4.3, but the same message "Android is starting ... optimizing apps" came back.
I had no other choice but to fastboot format it and flash it again with 4.2.2.
Any ideas on what could possibly be causing this? I thought it might be some problem in the cache partition but haven't found a way to fix it or if it's even possible to. Apparently everything's working with 4.2.2 but I'd love to go back to 5.1.1!
Thanks in advance!
dont dirty flash the factory image. make a clean factory image flash
After flashing stock KK or LP, are you also flashing userdata.img and then booting into stock recovery to format/wipe data before booting the ROM for the first time?
audit13 said:
After flashing stock KK or LP, are you also flashing userdata.img and then booting into stock recovery to format/wipe data before booting the ROM for the first time?
Click to expand...
Click to collapse
Haven't tried that, I'll give it a go and post the results here!
I've also noticed the phone isn't receiving any signal and it doesn't display the IMEI anymore..
The lack of an imei is a definite problem. Try flashing the stock LP or KK ROM and check for the imei.
audit13 said:
The lack of an imei is a definite problem. Try flashing the stock LP or KK ROM and check for the imei.
Click to expand...
Click to collapse
Did a clean factory image flash of Lollipop 5.1.1, booted into twrp recovery (I'm not sure how to go back to stock recovery) to wipe the data and got the following message:
E: UnMount: Unable to find partition for path '/sdcard'
E: Mount: Unable to find partition for path '/sdcard'
Updating partition details...
E: Unable to mount '/cache'
...done
E: Unable to mount '/cache'
Full SELinux support is present
E: Unable to mount '/cache'
E: Unable to mount '/cache'
MTP Enabled
Formatting Data using make_ext4fs function.
Ypu may need to reboot recovery to be able to use /data again.
Updating partition details...
E: Unable to mount '/cache'
...done
After that I rebooted the phone and it's been stuck on bootloop again since then.
When you flash a stock ROM, did you flash the recovery.img? Sometimes, I find that only stock recovery can properly format the cache. When flashing my Nexus 5 to stock from a custom ROM, I get an error message when I boot into stock recovery that the cache has an invalid format. Once I perform a factory wipe, the cache is properly formatted and wiped.
audit13 said:
When you flash a stock ROM, did you flash the recovery.img? Sometimes, I find that only stock recovery can properly format the cache. When flashing my Nexus 5 to stock from a custom ROM, I get an error message when I boot into stock recovery that the cache has an invalid format. Once I perform a factory wipe, the cache is properly formatted and wiped.
Click to expand...
Click to collapse
Yeah, I flashed the images for boot, recovery, system, userdata and cache separately. I'll look up how to get back into stock recovery now and I'll try what you've said!
If recovery.img was flashed, the phone should not have TWRP, it should be a stock recovery. If stock recovery cannot be flashed, this leads to me believe that something is wrong with the memory chip.
audit13 said:
If recovery.img was flashed, the phone should not have TWRP, it should be a stock recovery. If stock recovery cannot be flashed, this leads to me believe that something is wrong with the memory chip.
Click to expand...
Click to collapse
I tried it again, flashed everything including recovery, went into stock recovery mode and wiped the data. Apparently its back to being stuck on bootloop
Use fastbot commands to erase cache and userdata. Then use fastboot to flash the userdata.img file, boot directly to recovery, and wipe again.
audit13 said:
Use fastbot commands to erase cache and userdata. Then use fastboot to flash the userdata.img file, boot directly to recovery, and wipe again.
Click to expand...
Click to collapse
Did it, still stuck on bootloop... Not sure if it can be somehow related but I got this message when I booted into recovery
The recovery screen looks correct because, after flashing userdata.img, you must format in stock recovery.
I am at a loss as to why 4.2.2 works while kk and LP do not.
audit13 said:
The recovery screen looks correct because, after flashing userdata.img, you must format in stock recovery.
I am at a loss as to why 4.2.2 works while kk and LP do not.
Click to expand...
Click to collapse
Ah, thanks for the help, anyway!
If someone else knows what to do.. The phone is now back to the initial message "android is starting... optimizing apps". Kinda of losing hope now
I've done this to my Nexus 5 once, too.
You basically screwed your cache partition.
Boot into the bootloader. Hook the phone up to your pc and open the command prompt.
Enter these commands:
fastboot erase cache
fastboot format cache
fastboot reboot-bootloader
When successful boot into recovery and the errors should be gone.
You should be able to flash a new rom now.
playitlouder said:
I've done this to my Nexus 5 once, too.
You basically screwed your cache partition.
Boot into the bootloader. Hook the phone up to your pc and open the command prompt.
Enter these commands:
fastboot erase cache
fastboot format cache
fastboot reboot-bootloader
When successful boot into recovery and the errors should be gone.
You should be able to flash a new rom now.
Click to expand...
Click to collapse
This got rid of the unable to mount cache error, flashed the rom again but it's still stuck on bootloop :/
thafuchs said:
This got rid of the unable to mount cache error, flashed the rom again but it's still stuck on bootloop :/
Click to expand...
Click to collapse
Okay. Progress
You have probably already nuked all your data. So I would suggest erasing and formatting everything again and then flash the newest factory image.
Enter bootloader again, on your pc do the following:
fastboot erase system
fastboot format system
fastboot erase data
fastboot format data
fastboot reboot-bootloader
Then grab the factory image, open the flash_all.bat file in an text editor (either use windows notepad, or grab notepad++).
You have to "cd" to the directory of your factory image. I would suggest to type "c:" *press enter* then cd *pull the folder that contains the factory image into the command prompt* *press enter*.
If you type "dir" now you should get your factory image directory.
Now just type in every command from the flash_all.bat one by one. Report, if there are any errors.
playitlouder said:
Okay. Progress
You have probably already nuked all your data. So I would suggest erasing and formatting everything again and then flash the newest factory image.
Enter bootloader again, on your pc do the following:
fastboot erase system
fastboot format system
fastboot erase data
fastboot format data
fastboot reboot-bootloader
Then grab the factory image, open the flash_all.bat file in an text editor (either use windows notepad, or grab notepad++).
You have to "cd" to the directory of your factory image. I would suggest to type "c:" *press enter* then cd *pull the folder that contains the factory image into the command prompt* *press enter*.
If you type "dir" now you should get your factory image directory.
Now just type in every command from the flash_all.bat one by one. Report, if there are any errors.
Click to expand...
Click to collapse
Okay, got some errors on the way... trying to erase data failed (Remote: partition table doesnt exist), format data failed too (formatting is not supported for filesystem with type ' '.)
Also, on the last command:
.\fastboot -w update .\image-occam-lmy48t.zip
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
archive does not contain 'vendor.img'
[...]
checking version-bootloader
FAILED
Device version-bootloader is 'MAKOZ10o'
Update requires 'MAKOZ30f'
Rebooted and its now stuck on google logo
Sorry, you should have typed: (it obviously cannot format something that is not there )
fastboot erase userdata
fastboot format userdata
Have you flashed the bootloader?
Have you rebooted after flashing the bootloader?
fastboot flash bootloader bootloader-mako-makoz30f.img
fastboot reboot-bootloader
Don't forget to also flash the radio.
These "does not contain" errors are normal.
playitlouder said:
Sorry, you should have typed: (it obviously cannot format something that is not there )
fastboot erase userdata
fastboot format userdata
Have you flashed the bootloader?
Have you rebooted after flashing the bootloader?
fastboot flash bootloader bootloader-mako-makoz30f.img
fastboot reboot-bootloader
Don't forget to also flash the radio.
These "does not contain" errors are normal.
Click to expand...
Click to collapse
Okay, I've flashed bootloader, rebooted, flashed radio, rebooted, typed the update command but the checking of bootloader version failed again.. rebooted and its back to being stuck on google logo
When I try to wipe internal it says
Code:
Wiping internal storage -- /data/media...
Error opening: '/data/media' (No such file or directory)
When I try to format instead - I get even more errors:
Code:
Formatting Data using make_ext4fs...
Failed to mount '/data' (Device or resource busy)
Failed to mount '/data' (Device or resource busy)
Unable to recreate /data/media folder.
You may need to reboot recovery to be able to use /data again.
Updating partition details...
Failed to mount '/data' (Device or resource busy)
...done
Is this because of encryption? And if so - this is weird because I never encrypted my device. I currently have no OS and just trying to unsoftbrick my phone.
specialk00 said:
...Is this because of encryption? And if so - this is weird because I never encrypted my device. I currently have no OS and just trying to unsoftbrick my phone.
Click to expand...
Click to collapse
Use fastboot and make sure you are using the latest binaries. Format system, userdata and cache. Upon booting for the first time, the 6P automatically defaults to encryption- unless you intervene and stop it from doing so.
v12xke said:
Use fastboot and make sure you are using the latest binaries. Format system, userdata and cache. Upon booting for the first time, the 6P automatically defaults to encryption- unless you intervene and stop it from doing so.
Click to expand...
Click to collapse
Yep, I just fixed it somehow, I think it was related to MTP in TWRP. However now I'm stuck with a different issue. No matter what I flash in fastboot - I get
Code:
C:\Users\Nexusflip\AppData\Local\Android\sdk\platform-tools>fastboot flash recovery D:\Downloads\angler\twrp-3.1.1-0-angler.img
target didn't report max-download-size
sending 'recovery' (16948 KB)...
FAILED (command write failed (No error))
finished. total time: 0.003s
I always get this weird "No error" thing.
specialk00 said:
Yep, I just fixed it somehow, I think it was related to MTP in TWRP. However now I'm stuck with a different issue. No matter what I flash in fastboot - I get
Click to expand...
Click to collapse
Are you sure you are using the latest binaries? Hash checked the TWRP file? Put TWRP img in your fastboot folder? Format/erase recovery partition?
v12xke said:
Are you sure you are using the latest binaries? Hash checked the TWRP file? Put TWRP img in your fastboot folder? Format/erase recovery partition?
Click to expand...
Click to collapse
Yes I'm using the latest binaries - I got them via Android SDK and updated everything. I checked the ones you linked and they are exactly the same.
Regarding the hash check - this has nothing to do with the file being corrupted. This happens with ANY file I try to flash.
I tried putting the TWRP img in my fastboot folder and the results are the same.
Erasing the recovery partition gives the same error.
Code:
C:\Users\username\AppData\Local\Android\sdk\platform-tools>fastboot erase recovery
erasing 'recovery'...
FAILED (command write failed (No error))
finished. total time: 0.009s
specialk00 said:
Yes I'm using the latest binaries - I got them via Android SDK and updated everything. I checked the ones you linked and they are exactly the same. Regarding the hash check - this has nothing to do with the file being corrupted. This happens with ANY file I try to flash. I tried putting the TWRP img in my fastboot folder and the results are the same. Erasing the recovery partition gives the same error.
Click to expand...
Click to collapse
Were you able to successfully fastboot format userdata, system and cache with no errors? Did you get the same error using format as you did erase recovery? Is your phone bootlooping ? If yes, then your phone may have the BLOD. There are a few instances of users still having access to recovery mode, but not being able to flash anything. If you flash a full stock image with flash-all.bat, it finishes but the phone still loops then you likely have the BLOD.
v12xke said:
Were you able to successfully fastboot format userdata, system and cache with no errors? Did you get the same error using format as you did erase recovery? Is your phone bootlooping ? If yes, then your phone may have the BLOD. There are a few instances of users still having access to recovery mode, but not being able to flash anything. If you flash a full stock image with flash-all.bat, it finishes but the phone still loops then you likely have the BLOD.
Click to expand...
Click to collapse
I tried minimal adb & fastboot (bit older version) and got this.
Code:
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery twrp-3.1.1-0-angler.img
target didn't report max-download-size
sending 'recovery' (16948 KB)...
FAILED (command write failed (Unknown error))
finished. total time: 0.007s
Then I tried another old version of fastboot - got one from july 2016 (23.0.1) and nothing happened when executing flash or format commands.
Then I tried normal, latest fastboot and both (new & old) versions of fastboot gave me this error.
Code:
C:\Users\Nexusflip\AppData\Local\Android\sdk\platform-tools>fastboot erase userdata
erasing 'userdata'...
FAILED (command write failed (No error))
finished. total time: 0.023s
Then I tried to format (instead of erase)
Code:
C:\Users\Nexusflip\AppData\Local\Android\sdk\platform-tools>fastboot format userdata
FAILED (command write failed (No error))
I don't know if my phone is bootlooping because I don't have OS installed and my internal storage is squeaky clean. All this crap didn't just start out of nowhere - I flashed 8.0.0 dev preview 2 images through TWRP. I know I'm not the brightest. When I launch flash-all.bat it's just blank and does nothing at all.
specialk00 said:
I don't know if my phone is bootlooping because I don't have OS installed and my internal storage is squeaky clean. All this crap didn't just start out of nowhere - I flashed 8.0.0 dev preview 2 images through TWRP. I know I'm not the brightest. When I launch flash-all.bat it's just blank and does nothing at all.
Click to expand...
Click to collapse
It sounds to me like your internal storage (memory) is bad. Bottom line is that if you can't format your basic partitions successfully, you will not be able to flash a full ROM. If you don't believe your memory is bad, you can search the 6P forums for the Qualcomm Flash Image Loader (QFIL) & EDL mode. There is a rescue binary for the 6P floating around that some people have been successful in using restoring corrupt partitions, presumably because it works at the hardware level.
v12xke said:
It sounds to me like your internal storage (memory) is bad. Bottom line is that if you can't format your basic partitions successfully, you will not be able to flash a full ROM. If you don't believe your memory is bad, you can search the 6P forums for the Qualcomm Flash Image Loader (QFIL) & EDL mode. There is a rescue binary for the 6P floating around that some people have been successful in using restoring corrupt partitions, presumably because it works at the hardware level.
Click to expand...
Click to collapse
What should I do from now on? I have no idea what to do. The device has been bricked for 24 hours now.
This is the closest I've found to my problem. Also on a Nexus 6P. https://forum.xda-developers.com/nexus-6p/help/zip-file-signature-verification-error-t3561054
I tried adb reboot edl and it says error: closed. So not even that works.
specialk00 said:
What should I do from now on? I have no idea what to do. The device has been bricked for 24 hours now. This is the closest I've found to my problem. Also on a Nexus 6P. https://forum.xda-developers.com/nexus-6p/help/zip-file-signature-verification-error-t3561054
I tried adb reboot edl and it says error: closed. So not even that works.
Click to expand...
Click to collapse
Stock fastboot does not support boot to EDL. You need a modified fastboot, BUT getting to EDL mode won't help you until you have all the proper tools and 6P specific files. I don't want to get your hopes up. I think your device is not recoverable due to a hardware issue (bad memory). If you are looking for a learning project to keep you busy with very little hope of success, keep digging. If you need a working phone, you need to buy another one, or a 6P replacement motherboard from a screen damaged parts phone. Unfortunately, there have been many onboard memory failures on the 6P.
I fixed the problem. It turned out to be a faulty USB-C to USB-A cable. The only problems were with file transfer-related commands. I then tried transferring a 1 kb file, then 1 mb (failed) then 200kb, then 300kb (failed). So it turns out the cable is ****ty. Wow. And nothing is corrupted. I'm typing this from my phone now.