Superwipe script for the T-Mobile HTC One.
Disclaimer: I've tested the hell out of this but I am not perfect. This should not cause any data loss aside from what's involved in a normal wipe. However you use this at your own risk.
I just came over from Sprint and I didn't see a Superwipe script available for TMO, so since I use it before ROM flashes, I decided to port it over.
What this script does:
This will wipe /data, /devlog, /cache, /system, /boot to prepare your phone for installation of a new ROM. It will also optimally format all of the above (except /data) for speed.
After MUCH testing and nuking of my internal storage (SD Card), I have now fixed this script so that no harm will come to any data on your internal storage. It will wipe everything else. As always I recommend backing things up (including external storage) before running any kind of wipe, whether it be within TWRP/Clockwork, this script, or any other script.
Please report any issues or errors to me and I'll fix them asap.
Original thread (Sprint Forums):
http://forum.xda-developers.com/showpost.php?p=40346656&postcount=1
Related
Ok hear me out. I have an idea. We need a "rom" that fills the phone with garbage, sort of like you would do a secure wipe, but one that leaves the recovery partition alone so it isn't truly bricked.
My reasoning is the seeming strange ability for parts of roms to linger. Such as when I went from KF to KGB and back to KF, it somehow merged some settings from KGB despite me doing a complete wipe between flashes. Now we have people who for some reason are griping about FC'ing constantly with Tazz GB.
What the rom could consist of is 128MB of /dev/urandom or something (or one huge file per partition however it is layed out.) And make sure it is signed so it will flash. With this rom, we could just download it once and leave it on our SD card and flash the phone with it between rom changes. We'd need to make sure that it overwrote /system /data and the dalvik cache partitions.
Plus it would be an interesting way to securely wipe a phone prior to running flashback and selling it or returning it to Verizon.
I'm sure the rom would take all of 5 minutes to make, we'd just have to make sure that it didn't touch recovery.
Then when someone is having all sorts of problems, recommend they flash BrickRom on it and then reflash back to what rom they had issues with.
adb is available when Amon_RA is running.
It's pretty trivial to go in there and mount /data after you have done a "wipe data/factory recovery". You should see nothing but the lost+found directories in both /data and /cache, and in /cache the /cache/recovery folder (which will contain the log file). Nothing else.
If you mount /system, you will see that it is still fully populated prior to flashing a ROM - that's intentional, so that if someone tries to flash a corrupted ROM, it will not pass verification (in Amon_RA, anyway) and so the phone should still boot into a FR'ed ROM. It is the ROM developer's responsibility to insert a "format SYSTEM:" directive in his/her ROM installer script; if that fails to happen, they could end up with a mixture of things in the /system mount from the new ROM and the prior ROM. I don't know if that has ever happened, though.
There are other possibilities revolving around the SD card - for instance if you moved apps to the SD card (/sdcard/.android_secure) for Froyo/GB, or the ext partition for Eclair ROM users. Amon_RA does not clean either of those up (whereas ClockworkMod does). If you install a ROM that has apps2sd installed by default, and you haven't manually cleaned up the ext partition... well, that's not really Amon_RA's fault.
If you can reliably repeat the behavior you are describing, then do a wipe (in Amon_RA), and then prior to flashing the new ROM, use adb (wth Amon_RA still booted, of course) to:
Code:
mount /system
cd /system
rm -rf /system/*
cd /
sync
umount /system
If the symptoms you are describing still persist (and you are using Amon_RA), then the problem most certainly results from stuff stored on the SD card.
I think a rom like that would be great, Stonent. I have had the same issue with certain roms. Are you thinking of some sort of rom that just contains format commands in the update script that doesn't actually flash a rom (a wiping rom)? I like that idea, but I have no idea how it could be made or if its possible, and I don't have much experience with things like that. Maybe someone could cook something like that up, I think its a good idea.
It's probably files on the SD card with identical names. Like if an app saves a config file to the SD and then KF looks for that same config file it'll carry over between ROMs.
Beginning with Froyo, Android keeps some files linked to your Google account (such as the wallpaper for example) I don't know if that is the same as this behavior but lots of apps store their data to SD (but not same as apps2sd)
Disclaimer: this could be complete coincidence, and I just finally found the perfect ROM for my phone, but thought it worth mentioning nonetheless.
SECOND DISCLAIMER: if you try this method, understand that it will delete EVERYTHING on your phone's storage, including pictures, videos, and anything else you may have stored on there.
Brief History: I had tried just about every single JB ROM under the sun, and I still got at least one reboot per day.
Solution (for me): In addition to wiping all the usual things, I wiped internal storage (using TWRP). If you watch the console, you can see that this is different than all the other wipes, as instead of just formatting the existing folder/partition, this rm's the partition entirely then recreates it.
This could all be placebo, but I thought I'd mention it because it appears to have solved the problem for me. I've been running Gubment Cheese ROM for around a week+ now and have not experienced a single reboot.
Again, this might not work for a single other person, but it did for me, so if you experience random reboots like I did, this might just do the trick.
Do u do a clean install on the rom then also do u hace to format sd card too
I do all the normal wipes, but also wipe internal storage. Then I install the Rom from my external sd card
Sent from my SAMSUNG-SGH-I717 using xda premium
I do a complete wipe on every rom flash !!
never had a problem with random reboot... and when I heard that people do... I just chalk it up to devices are different even when it's the same model and add user errors on top of things... LOL
My rule of thumb on all rom flash:
/wipe cache
/wipe data/factory reset
go into mount & storage menu and mount EVERYTHING !
then proceed to wipe EVERYTHING on the list from top to bottom!! and I meant EVERYTHING !!! with the exception of your external SD card as you need to have new rom.zip and other things about to be flashed...etc
Then...
/advance menu
/wipe dalvik
/fix permission
these steps might seem redundant but it sure eliminate the error on user's part... anything else after this is "partly" to be blamed on the ROM... LOL
How much of the ritual of rom management is actually necessary and how much is just passed on wisdom based ultimately on nothing? Is there really any benefit to wiping a partition more than once, fo example? Some people suggest all sorts of voodoo to make sure a rom gets installed right and everyone is quick to blame a failure to follow the ritual perfectly for any shortcomings of the rom.
Just curious. Either way - it is interesting to have these flashing rituals. The ritual is different for each device.
Steps to flashing ROM -
1. Wipe all partitions ONCE (but make sure you wipe them all).
2. Flash ROM first, flash gapps if not included, then flash any other zips of apps/mods/whatever else that you need.
3. Done.
A lot of the tips that people give are misleading. You DO NOT need to wipe more than once. When you format a flash drive on your computer, do you format it 2-3 times just 'to make sure everything is wiped' or do you just format it once? Same thing for the NAND flash memory of phones/tablets. One format of the partitions will wipe them clean.
There's no such thing as a wait time for 'letting the ROM settle in'. You flash a ROM, reboot, wait for dalvik cache to rebuild, wait a minute or two after boot for all the auto-start apps to load (especially if you have a single core phone with low RAM) and use away.
You don't have to wipe cache+dalvik cache each time you flash an update of your ROM. Android automatically detects which apks have changed and rebuilds the dalvik cache only for them, rather than unnecessarily deleting the whole dalvik cache and rebuilding the same stuff again. Google 'android auto dexopt-ing' for more info.
You don't have to wipe cache+dalvik after flashing a new kernel, because those are for apps and aren't related to kernel.
The correct wiping order is -
1. Format /boot
2. Format /system
3. Format /data
4. Format /cache
Some devices have additional partitions so you would need to format them too if necessary, but for most devices these are the standard partitions to wipe. Some recoveries have a 'format all partitions (except SD card)' option which does all this at once, most recoveries require you to format them manually. In most recoveries, the option for formatting data is called 'Format data/Factory Reset'. This does the same thing as running Factory Reset in the phone settings, i.e. it formats /data and /cache. So depending on your recovery, you might not need to format /cache after formatting /data. Many people advise to format dalvik cache after formatting data. This is completely unnecessary. Dalvik cache is just a folder in /data and in /cache, so when you format /data and /cache or do a factory reset, it is wiped too. If you wipe dalvik cache after formatting those partitions already, you're doing nothing other than deleting a non-existent folder.
You don't need to 'calibrate' the battery after a new ROM flash. Battery calibration as it is called does nothing but delete a system file called batterystats.bin which contains info about the running apps, percent of battery they use and the battery history. This file is anyway reset whenever you charge the device fully, so you're essentially 'calibrating' your device each time you fully charge it.
https://plus.google.com/u/0/105051985738280261832/posts/FV3LVtdVxPT
Last one, you don't need to fix permissions each time you flash a ROM/ROM update. Only run it if you're getting a lot of app FCs.
Sent from my Desire HD using xda premium
I agree with Sashank, use the order but personally (again my own personal preference) I boot the ROM first after flashing ROM /or GApps then I reboot back into recovery to flash anything that needs to be flashed. Also when using 4EXT Recovery (preferred/best recovery for our Desire HD) there's an option to wipe all partitions except for SD Crad, I usually use that 3 time to make sure my device is as clean as possible
So after years of flashing roms, installing apps, saving junk to my phone I think it is time to completely wipe it. I've searched and come across a few threads but I want to look at some of the CWM Mounts and storage options to be sure. Here is one I came across:
http://forum.xda-developers.com/galaxy-s2/general/ref-cwm-clockworkmode-menu-options-t1542857
If I wanted to do a compete wipe including all internal SD data, but not lose Root, I would do the following???
wipe data / factory reset
wipe cache partition
wipe dallvik cache
format /system
format /cache
format /data
format /preload (unsure about this one, can't find info)
format /storage/sdcard0
install rom then from my ext sdcard1
install gapps then from my ext sdcard1
reboot into a clean phone and start installing stuff again.
That should be enough correct? I'm not sure where CWM Recovery lives but I would assume that would be on the /boot partition and that is the one section that I don't want to format, correct? I'm also not sure of where the modem is set/installed and would that need to be reinstalled again?
With this device, recovery lives with the kernel in the boot partition. Everytime you install a kernel, a fresh image is installed to the partition.
I'm not sure what your actual goal is, but the process you've outlined process is very redundant.
factory reset wipes /data & /cache (which includes dalvik-cache)
A factory reset plus manually wiping /system (and /preload if using samsung-based firmware) promises a clean installation of ANYTHING.
jackal2001 said:
[...]
If I wanted to do a compete wipe including all internal SD data, but not lose Root, I would do the following???
wipe data / factory reset
wipe cache partition
wipe dallvik cache
format /system
format /cache
format /data
format /preload (unsure about this one, can't find info)
format /storage/sdcard0
install rom then from my ext sdcard1
install gapps then from my ext sdcard1
reboot into a clean phone and start installing stuff again.
That should be enough correct? I'm not sure where CWM Recovery lives but I would assume that would be on the /boot partition and that is the one section that I don't want to format, correct? I'm also not sure of where the modem is set/installed and would that need to be reinstalled again?
Click to expand...
Click to collapse
I want to have a fresh install. Basically wipe everything including whatever junk is installed on the SD card. Like a new phone pulled out of the box. I'm sure there is tons of junk on the SD card due to apps being installed/uninstalled over the years.
Yes I understand some of the options may be redundant, but it only takes a second.
So as long as I don't "format /boot" you saying that should be OK?
If you prefer to take the extra steps, then I don't see any harm in your procedure.
It may seem obvious, but make sure you have everything you'll need on that ext-sd card, before you format /system.
mr.cook has some scripts that will format preload, if the option isn't present in your recovery.
jackal2001 said:
I want to have a fresh install. Basically wipe everything including whatever junk is installed on the SD card. Like a new phone pulled out of the box. I'm sure there is tons of junk on the SD card due to apps being installed/uninstalled over the years.
Yes I understand some of the options may be redundant, but it only takes a second.
So as long as I don't "format /boot" you saying that should be OK?
Click to expand...
Click to collapse
Hey Guys,
As an alternative to ROM slots, what you can do is,
1. Boot into 1st ROM, configure and download all the apps you want.
2. Take a Nandroid of; /System and /data and optionally; cache. But I don't use the latter.
3. Wipe Data, System, Cache, and dalvik.
4. Install 2nd ROM, boot, configure, install all the same apps (just for now)
5. Take Nandroid of /system only
To switch to ROM 1, restore the backup of its /system (should only take about 6-10 seconds as opposed to flashing data too.
To switch to ROM 2, restore the backup of its /system ""
The reason you MUST install all the SAME apps on the 2nd ROM is to rebuild the necessary data folders.
In
To install a new app, boot to rom 1 and install it, then switch to ROM 2 and wipe cache and boot or vice versa.
Have fun,
While this may work, be aware there are problems that could arise by doing this. They likely wouldn't effect much but some ROM's are picky. That aside your still partitioning your device and will lose X amount of space even with this method.
NighthawkXL said:
While this may work, be aware there are problems that could arise by doing this. They likely wouldn't effect much but some ROM's are picky. That aside your still partitioning your device and will lose X amount of space even with this method.
Click to expand...
Click to collapse
I agree, especially with Xposed, some problems could definitely arise. But I switch between Hyperdrive and GPE via this method about 2-3 times a week. Over time, constant flashing takes its toll on the Drive, but I don't mind it much.
Actually... you aren't partitioning though... you can just take the backups to your SD Card and it wont take up any internal storage other than what the ROM is taking