# How to format internal storage



## BlackDobe (Sep 2, 2011)

Is there a way to format the internal storage of the device w/o going through the hassle of locking/unlocking again (or returning to stock)? Historically CWR could do it but it appears to be no longer the case.

Edit: I found this whist Googling....

Yes. Reboot your device into fastboot and type the following:
fastboot erase system
fastboot erase userdata
fastboot erase boot
fastboot erase recovery
fastboot erase cache

Device is now wiped. You will need to flash a new ROM afterwards...

So if i don't do the "fastboot erase recovery" it should wipe everything except my recovery so that I can flash a ROM, correct? I don't need to push stock image files for the ones that I erased because flashing a new ROM should put the missing pieces back?


----------



## bmcclure937 (Jun 16, 2011)

AFAIK, none of what you posted will touch the internal storage (/sdcard)...


----------



## BlackDobe (Sep 2, 2011)

bmcclure937 said:


> AFAIK, none of what you posted will touch the internal storage (/sdcard)...


lol oh but it did. Now I can't get anything to flash. At least it's Saturday & I have nothing better to do right now.


----------



## idefiler6 (Sep 3, 2011)

Wouldn't a bootloader relock/unlock wipe it nicely?


----------



## BlackDobe (Sep 2, 2011)

idefiler6 said:


> Wouldn't a bootloader relock/unlock wipe it nicely?


Maybe. That seemed like it would take too long & would be too easy. I chose the panic-inducing, lesson-learning, way to do it.

You MUST download the stock files first from the unroot thread & extract everything in the zips.

What I did:
Backup what I wanted & rebooted into the bootloader
fastboot erase system
fastboot erase userdata
fastboot erase boot
fastboot erase cache

<panic> (you can skip that step)

fastboot flash system /path/to/system.img
fastboot flash userdata /path/to/userdata.img
fastboot flash boot /path/to/boot.img

reboot into recovery
adb push /path/to/rom.zip /sdcard/
flash new ROM

Boot to a clean device.
<panic/>


----------



## MisterEff (Jan 2, 2012)

It should be

Just saying.

Sent from my Galaxy Nexus using Tapatalk 2


----------



## blaineevans (Jul 11, 2011)

idefiler6 said:


> Wouldn't a bootloader relock/unlock wipe it nicely?


Haha. I would say that would have been a lot easier than the above steps. Any particular reason you wanted a "full" wipe dobe?

Sent from my Galaxy Nexus using Tapatalk 2


----------



## DrMacinyasha (Jun 6, 2011)

If you want to do it quickly, just flash a stock recovery and from there do a factory reset. After that, just fastboot your custom recovery and get to work.


----------



## RMarkwald (Oct 19, 2011)

BlackDobe said:


> (you can skip that step)


But that's my favorite step!

Sent from my Galaxy Nexus using RootzWiki


----------



## BlackDobe (Sep 2, 2011)

blaineevans said:


> If you want to do it quickly, just flash a stock recovery and from there do a factory reset. After that, just fastboot your custom recovery and get to work.


I could have done the relock/unlock or flash the stock recovery (saw that was an option) but I thought "what the hay! I'll give it a go this way!" If nothing else it was a learning experience and while I may have taken the long route I think we're all a little better from it. I had a compelling protagonist. Had an obstacle for to overcome. There was a nice little narrative. A beginning, middle, and end. Some friends became enemies, some enemies became friends. At the end I am a little richer from the experience.


----------



## yarly (Jun 22, 2011)

bmcclure937 said:


> AFAIK, none of what you posted will touch the internal storage (/sdcard)...


userdata will format /sdcard* and data

*This is only true on certain devices without an actual sdcard (like the Nexus) as the fake sdcard mount is actually part of the /data partition


----------



## blaineevans (Jul 11, 2011)

BlackDobe said:


> I could have done the relock/unlock or flash the stock recovery (saw that was an option) but I thought "what the hay! I'll give it a go this way!" If nothing else it was a learning experience and while I may have taken the long route I think we're all a little better from it. I had a compelling protagonist. Had an obstacle for to overcome. There was a nice little narrative. A beginning, middle, and end. Some friends became enemies, some enemies became friends. At the end I am a little richer from the experience.


Sounds like you need some time off.

Sent from my Galaxy Nexus using Tapatalk 2


----------



## trueagle (Jul 13, 2011)

Do Odin restore. Wipes it clean

Sent from my Galaxy Nexus using Tapatalk 2


----------



## mcp770 (Jun 11, 2011)

Adb lock then unlock is the easiest way. Droidtheory the developer of the axiom roms has a flashable zip that wipes the sd card partitions as well on his site. That is actually the best method out there. It's a tiny zip and takes ten seconds to flash.


----------

