Help with a fastboot command - Nexus 6P Q&A, Help & Troubleshooting

OK, not help exactly but more info than help. People talk about doing fastboot -w instead if fastboot format userdata. My question is, what's the difference and is it safe?

jamescable said:
OK, not help exactly but more info than help. People talk about doing fastboot -w instead if fastboot format userdata. My question is, what's the difference and is it safe?
Click to expand...
Click to collapse
@hiesenberg, any help with this before I possibly brick my phone lol

jamescable said:
OK, not help exactly but more info than help. People talk about doing fastboot -w instead if fastboot format userdata. My question is, what's the difference and is it safe?
Click to expand...
Click to collapse
The -w flag will erase userdata and cache
http://elinux.org/Android_Fastboot#Erase_an_individual_partition

spunks3 said:
The -w flag will erase userdata and cache
http://elinux.org/Android_Fastboot#Erase_an_individual_partition
Click to expand...
Click to collapse
So, its safe to use that command then...won't **** anything up?

jamescable said:
So, its safe to use that command then...won't **** anything up?
Click to expand...
Click to collapse
So what is your end goal? If you are okay with losing all data (pictures, downloads, etc.) then that command should be okay.
The only time I've had to format is when flashing userdata.img on my 128GB 6P which caused it to only recognize 32GB. I then formatted and it was back to 128.

Well I am a junior ROM dev(personal builds) and have a lot of junk on my internal memory that I wasn't to get ride if. Some say that fastboot format user data technically only hides the data until overwritten and using fastboot erase destroys the data partiton and I have heard mention of fastboot -w but google doesn't show anything when searched

jamescable said:
Well I am a junior ROM dev(personal builds) and have a lot of junk on my internal memory that I wasn't to get ride if. Some say that fastboot format user data technically only hides the data until overwritten and using fastboot erase destroys the data partiton and I have heard mention of fastboot -w but google doesn't show anything when searched
Click to expand...
Click to collapse
In this case the -w flag is the same as erase but does this to both userdata and cache instead of just one by using 'fastboot erase'.
As long as your cool losing data, that command is good to go

spunks3 said:
In this case the -w flag is the same as erase but does this to both userdata and cache instead of just one by using 'fastboot erase'.
As long as your cool losing data, that command is good to go
Click to expand...
Click to collapse
Ah OK, so it basically destroys the partition and recreates it

jamescable said:
Ah OK, so it basically destroys the partition and recreates it
Click to expand...
Click to collapse
The partition should stay, this will instead delete everything on the partition.

spunks3 said:
The partition should stay, this will instead delete everything on the partition.
Click to expand...
Click to collapse
I guess my fear is accidently deleting all partitions lol

jamescable said:
I guess my fear is accidently deleting all partitions lol
Click to expand...
Click to collapse
I would stuck to individual commands then
'fastboot erase userdata'

Related

[Q] - fastboot erase userdata

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

[Q] Sideloading Official 4.4 Kitkat upgrade to stock Nexus 4

Hi everyone. I have a stock locked Nexus 4 with 4.3 Jelly Bean. I wanted to know if at this point is available a signed image to update the stock Nexus 4 to Kitkat via adb sideload without unlocking the phone or wiping the data. Can you answer my question?
Thanks!
No.
That's called OTA update, which is not out yet.
You can flash factory image and relock your bootloader.
eksasol said:
No.
That's called OTA update, which is not out yet.
You can flash factory image and relock your bootloader.
Click to expand...
Click to collapse
Yes, I know I can flash factory image, but unlocking the bootloader would mean wiping my data, which is a thing I prefer avoiding.
Thanks!
Ieracos said:
Yes, I know I can flash factory image, but unlocking the bootloader would mean wiping my data, which is a thing I prefer avoiding.
Thanks!
Click to expand...
Click to collapse
You don't have to, do it manually instead of running the flash-all.bat.
Yse "fastboot erase" to erase radio, boot, system, cache. IE. "fastboot erase system"
But don't erase "userdata". Then extract all the *.img from the image.zip. Then: "fastboot flash boot boot.img"
Do it for all of them, recovery, bootloader, radio and system. Leave "userdata" out and you're good to go.
OTA is coming very soon anyway.
sent from tapatalk
eksasol said:
You don't have to, do it manually instead of running the flash-all.bat.
Yse "fastboot erase" to erase radio, boot, system, cache. IE. "fastboot erase system"
But don't erase "userdata". Then extract all the *.img from the image.zip. Then: "fastboot flash boot boot.img"
Do it for all of them, recovery, bootloader, radio and system. Leave "userdata" out and you're good to go.
OTA is coming very soon anyway.
sent from tapatalk
Click to expand...
Click to collapse
Mmm... I thought that in order to launch "fastboot flash" I had to launch "fastboot oem unlock" first, which wipes all my data. Am I right?
Ieracos said:
Mmm... I thought that in order to launch "fastboot flash" I had to launch "fastboot oem unlock" first, which wipes all my data. Am I right?
Click to expand...
Click to collapse
Yeah I forgot that part, yes. You could sync all your Google stuff and use the Helium app to backup your apps data, it work without root if you run the PC companion app clockworkmod.com/carbon
sent from tapatalk
eksasol said:
Yeah I forgot that part, yes. You could sync all your Google stuff and use the Helium app to backup your apps data, it work without root if you run the PC companion app clockworkmod.com/carbon
sent from tapatalk
Click to expand...
Click to collapse
It seems that the OTA package is out now, so I think I'll sideload it to upgrade my phone. However, thanks for your help

[Tutorial] Restore Nexus 9 to Stock

I have a defective device and in preparing to return it, I locked the bootloader and found a nasty little message at the top of the screen when booting:
Code:
This is a development device not intended for production use.
I was afraid that the N9 was like the N5 & 7 with the "tamper" flag, but after some digging (and advice from others out here), I decided to restore the factory image to see if that would overwrite the image. Yes! No more big fat red "I unlocked my bootloader and may have voided my warranty" message.
I can't take credit for this, but I thought I would consolidate everything I was finding in the Q&A threads into one spot, so I put this little tutorial together. Thank you @Pilz, @jd1639 & @PhilDX for your various posts.
Step 1 - Prepare your system
[Windows]
Since your bootloader is unlocked, you probably already have ADB and fastboot, but if not, grab the SDK from here, unzip and add the "platform-tools" directory to your PATH statement
If your drivers are set up properly and your device has Android debugging enabled, connect USB and execute `adb devices` from a command prompt you should see your device listed
Download the factory image for "volantis" here
The image is double zipped, so unzip, untar, then unzip the image-volantis-lrx21q.zip file into the same directory that contains the bootloader*.img file
Step 2 - Unlock bootloader
If you locked your bootloader, unlock again:
Code:
adb reboot bootloader
fastboot oem unlock
Step 3 - Flash stock image
The flash-all.bat script is broken, so you have to do it by hand:
Open a command prompt
cd into the directory where you unzipped the factory image files
Code:
fastboot flash bootloader bootloader-flounder-3.43.0.0114.img
fastboot reboot-bootloader
fastboot erase system
fastboot erase recovery
fastboot erase cache
fastboot erase boot
fastboot erase userdata
fastboot erase vendor
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash cache cache.img
fastboot flash boot boot.img
fastboot flash vendor vendor.img
Before rebooting, relock the bootloader:
Code:
fastboot oem lock
Your N9 will reboot and do another factory reset (even though an oem lock is not supposed to).
Typo: fastboot oem unlock
hirndurst said:
Typo: fastboot oem unlock
Click to expand...
Click to collapse
Hahaha! Thanks.
always good to know! thanks!
Just a question, I'm still a beginner at adb fastboot flashing.
But doesn't the oem unlocking and subsequent oem lock, erase everything anyway, so are the erase commands still required?
AjunNg said:
Just a question, I'm still a beginner at adb fastboot flashing.
But doesn't the oem unlocking and subsequent oem lock, erase everything anyway, so are the erase commands still required?
Click to expand...
Click to collapse
The erase commands are required. I believe that a factory reset only clears userdata (and probably cache). You need to run the others to clear those partitions to make room for the factory images. Each of those commands run pretty quick anyway.
DarthSudo said:
The erase commands are required. I believe that a factory reset only clears userdata (and probably cache). You need to run the others to clear those partitions to make room for the factory images. Each of those commands run pretty quick anyway.
Click to expand...
Click to collapse
You could also use fastboot -w instead of the erases
Sent from my Nexus 9 using XDA Free mobile app
Thanks for this thread. Great guide.
jd1639 said:
You could also use fastboot -w instead of the erases
Click to expand...
Click to collapse
According to the fastboot "help", -w only formats userdata and cache, does it actually format the other partitions as well? This wouldn't be the first time the documentation is wrong...
Code:
-w erase userdata and cache (and format
if supported by partition type)
Thanks for this. I RMA'd my Nexus 9 and sending it back tomorrow
DarthSudo said:
According to the fastboot "help", -w only formats userdata and cache, does it actually format the other partitions as well? This wouldn't be the first time the documentation is wrong...
Code:
-w erase userdata and cache (and format
if supported by partition type)
Click to expand...
Click to collapse
It only formats userdata and cache. But you don't need to erase the other partitions
Sent from my Nexus 5 using XDA Free mobile app
AjunNg said:
Just a question, I'm still a beginner at adb fastboot flashing.
But doesn't the oem unlocking and subsequent oem lock, erase everything anyway, so are the erase commands still required?
Click to expand...
Click to collapse
jd1639 said:
You could also use fastboot -w instead of the erases
Sent from my Nexus 9 using XDA Free mobile app
Click to expand...
Click to collapse
jd1639 said:
It only formats userdata and cache. But you don't need to erase the other partitions
Sent from my Nexus 5 using XDA Free mobile app
Click to expand...
Click to collapse
You guys are all right. I looked back at some of my notes and I've flashed plenty of devices w/o formatting the other partitions first. Just userdata and cache. Thanks!
Hey guys, just wanted to thank you for the fixed "script". This is now my flash-stock.sh script I use whenever I need to flash a nexus device as the one delivered by google just doesn't work (reboot loop due to crashing apps on startup or "missing system.img").
Works perfect and I always like to not dirty but rather make a clean flash as it just reduces the number of possible faults .
Cheers
Creamy
Just got my N9. First thing I did was to apply all updates, then unlock bootloader, boot into TWRP and make a system image. Then I flashed TWRP and rooted. Now if I want to take an OTA update, all I have to do restore the system image and flash the stock recovery, right? Am I missing anything? Thx.
Sent from my Nexus 6 using Tapatalk
bruce7373 said:
Just got my N9. First thing I did was to apply all updates, then unlock bootloader, boot into TWRP and make a system image. Then I flashed TWRP and rooted. Now if I want to take an OTA update, all I have to do restore the system image and flash the stock recovery, right? Am I missing anything? Thx.
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
The OTA will run a check and will fail if the image isn't basically stock. For you, just do a full unroot in the SuperSU app (under Settings), then you need to replace TWRP with the stock recovery from fastboot:
Code:
fastboot flash recovery recovery.img
Reboot then take the OTA.
Of course, you will need to install TWRP and re-root again after the OTA...
DarthSudo said:
The OTA will run a check and will fail if the image isn't basically stock. For you, just do a full unroot in the SuperSU app (under Settings), then you need to replace TWRP with the stock recovery from fastboot:
Code:
fastboot flash recovery recovery.img
Reboot then take the OTA.
Of course, you will need to install TWRP and re-root again after the OTA...
Click to expand...
Click to collapse
Thx, that seems simple enough. But I made the initial system (stock) backup before I rooted. That's why I was thinking restoring that would work. I just wasn't sure about the recovery, whether the restore would put the stock recovery back or not.
Sent from my Nexus 6 using Tapatalk
DarthSudo said:
I have a defective device and in preparing to return it, I locked to bootloader and found a nasty little message at the top of the screen when booting:
Code:
This is a development device not intended for production use.
Your N9 will reboot and do another factory reset (even though an oem lock is not supposed to).
Click to expand...
Click to collapse
Hi,
is there a way to get rid of that red message if your bootloader is locked and you cannot boot into OS?
Thanks!
EDIT* Nevermind
Hey. Sorry for reviving this thread.
I installed Remix OS on my N9 and (after discovering that performance is horrible, with ~80% RAM usage on idle) after a reboot, Remix OS won't get past it's boot splash. I am attempting to flash my device back to stock.
I never touched the bootloader (never did any 'fastboot flash bootloader ...' or anything), so it it still necessary to flash the bootloader image, or can I just flash the system.img, boot.img, vendor.img etc.?
The bootloader had never changed so there is no reason to flash it.
Sent from my Nexus 9 using XDA Free mobile app

Improper storage size. 128GB model only showing 24GB

I have the 128GB model and I was transferring 32GB worth of music over to my 6P and before it completed I was getting warnings that files couldn't be copied. I stopped it and then looked at the phone on my PC and it was saying it's size was 24.1 GB. It shows the same thing when I look at the storage on the phone. What happened?
If you flashed the factory image, it probably set the partition for userdata to the wrong size. One fix is to go into recovery and perform a factory reset from recovery and it will fix the size. I am not sure if there are other methods that can fix it without doing the reset. Another person may be able to offer a better alternative.
tkoreaper said:
I have the 128GB model and I was transferring 32GB worth of music over to my 6P and before it completed I was getting warnings that files couldn't be copied. I stopped it and then looked at the phone on my PC and it was saying it's size was 24.1 GB. It shows the same thing when I look at the storage on the phone. What happened?
Click to expand...
Click to collapse
Did you flash the userdata.img from the factory images at some point? Doing so always allocates the smallest of the available storage sizes, so it really shouldn't be used. You can fix it by issuing this fastboot command:
Code:
fastboot format userdata
This will wipe your userdata partition so make sure you back up anything important first.
Heisenberg said:
Did you flash the userdata.img from the factory images at some point? Doing so always allocates the smallest of the available storage sizes, so it really shouldn't be used. You can fix it by issuing this fastboot command:
Code:
fastboot format userdata
This will wipe your userdata partition so make sure you back up anything important first.
Click to expand...
Click to collapse
That explains it, thank you. I ended up just starting over so it's all good now.
Heisenberg said:
Did you flash the userdata.img from the factory images at some point? Doing so always allocates the smallest of the available storage sizes, so it really shouldn't be used. You can fix it by issuing this fastboot command:
Code:
fastboot format userdata
This will wipe your userdata partition so make sure you back up anything important first.
Click to expand...
Click to collapse
Hehe that's exactly what I just did (flahsed my own cooked up userdata.img, which cut my size in half), thanks Heisenberg

Please help! Stuck with bootloop after updating SuperSU

Today I got a message saying that SuperSU needs to be updated on my rooted Nexus 10 with stock Android 5.1. Then it booted into TWRP and flashed the zip file, but now it's stuck with the bootloop forever. How can I get out this mess without losing anything? Step-by-step instruction with fastboot would be highly appreciated.
Would reflashing 5.1 with the following commands be good enough to restore the system without losing userdata once I boot into fastboot mode?
fastboot flash bootloader bootloader-manta-mantamf01.img
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash system system.img
Do I need those erase steps such as
fastboot erase boot
fastboot erase cache
fastboot erase system
Thanks in advance!
mj56gt said:
Today I got a message saying that SuperSU needs to be updated on my rooted Nexus 10 with stock Android 5.1. Then it booted into TWRP and flashed the zip file, but now it's stuck with the bootloop forever. How can I get out this mess without losing anything? Step-by-step instruction with fastboot would be highly appreciated.
Would reflashing 5.1 with the following commands be good enough to restore the system without losing userdata once I boot into fastboot mode?
fastboot flash bootloader bootloader-manta-mantamf01.img
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash system system.img
Do I need those erase steps such as
fastboot erase boot
fastboot erase cache
fastboot erase system
Thanks in advance!
Click to expand...
Click to collapse
Don't you have the nandroid backup?
Your steps look right. I check them on here: http://androidforums.com/threads/guide-how-to-flash-a-nexus-factory-image-manually.706533/
See the last part of step 11. It says:
Code:
If going for a complete back to stock using the manual flashing of the zip file, execute the following commands after the above 4:
fastboot erase userdata
fastboot flash userdata userdata.img
So if you DON"T do this step, user data should be there. But I do not own this tablet and not 100% sure about that. Do that on your own risk :fingers-crossed:
Many thanks for checking the steps for me!
nitin.chobhe said:
Don't you have the nandroid backup?
Click to expand...
Click to collapse
No, I don't have a recent nandroid backup. I can still run adb, and have managed to pull out those photos on the tablet. Do you think that I could boot into the recovery mode and perform the nandroid backup?
nitin.chobhe said:
Code:
If going for a complete back to stock using the manual flashing of the zip file, execute the following commands after the above 4:
fastboot erase userdata
fastboot flash userdata userdata.img
So if you DON"T do this step, user data should be there. But I do not own this tablet and not 100% sure about that. Do that on your own risk :fingers-crossed:
Click to expand...
Click to collapse
What's the worst scenario if I don't erase the userdata?
mj56gt said:
Many thanks for checking the steps for me!
No, I don't have a recent nandroid backup. I can still run adb, and have managed to pull out those photos on the tablet. Do you think that I could boot into the recovery mode and perform the nandroid backup?
What's the worst scenario if I don't erase the userdata?
Click to expand...
Click to collapse
1. Even if you do nandroid, it would be exact replica of your current state i.e. boot loop
2. Worst scenario is bootloop
nitin.chobhe said:
1. Even if you do nandroid, it would be exact replica of your current state i.e. boot loop
2. Worst scenario is bootloop
Click to expand...
Click to collapse
I've fully restored the system without losing any data! Really appreciate your help!
mj56gt said:
I've fully restored the system without losing any data! Really appreciate your help!
Click to expand...
Click to collapse
What steps did you follow... Happy that it worked out for you! :good:
mj56gt said:
I've fully restored the system without losing any data! Really appreciate your help!
Click to expand...
Click to collapse
Just the steps in my original post, and also the same steps mentioned in the link you mentioned. Thanks again for your kind help!
mj56gt said:
Just the steps in my original post, and also the same steps mentioned in the link you mentioned. Thanks again for your kind help!
Click to expand...
Click to collapse
You can just press that thanks button ?
Sent from my Nexus 4 using XDA Free mobile app
PIT files
My nexus 10 has the boot loop problem and I think I have been left with the only option of Re-Partition but I need the PIT file. Can anybody help or provide this file?
I have tried everything else (fastboot, adb, temporary custom recoveries, Nexus Root Toolkit) with no success.

Categories

Resources