yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] yo9gnc:
i think i`m a little bit offtopic but i`m curious why do you think that? if i try to flash old roms, based on cm6rc1-2 ( like htcclay`s, or chromersmith`s), they work ok. since cm6 stable ... i`m stuck on the g1 logo after flashing zip.

i give`em enough time, believe me. are 15 minutes enough ? :D
[G1 Android Development] Ohsaka:
It basically writes a 0 to every sector of the internal phone partitions except for the "recovery" partition. So EVERYTHING is erased. (it also wipes the sd-ext directory from the sdcard and runs repair on it)
[G1 Android Development] XxKOLOHExX:
I don't think the cache partition is getting wiped :(
[G1 Android Development] Ohsaka:
#!/sbin/sh
/tmp/work/erase_image cache
echo "erase_image cache=$?" >> /tmp/wipe.log
/tmp/work/erase_image system
echo "erase_image system=$?" >> /tmp/wipe.log
/tmp/work/erase_image userdata
echo "erase_image userdata=$?" >> /tmp/wipe.log
/tmp/work/erase_image boot
echo "erase_image boot=$?" >> /tmp/wipe.log

After you flash SuperWipe, open a shell and run 'cat /tmp/wipe.log'

If you see "erase_image cache=0" then it means the erase_image command did not report any errors...
[G1 Android Development] XxKOLOHExX:
Oh okay lol :D
[G1 Android Development] studjuice:
Awesome stuff. If this lives up, it should be included in more OP's for rom's. Can't wait to see that day
[G1 Android Development] raven_raven:
Finally something like that appeared! I'm very thankful Oshaka, it is very useful little .zip. To think that no one up to this day created something like that. Huge thank you!
[G1 Android Development] RichieDaze:
Ohsaka,

Kudos on this project.

I would have to agree that the repartitioning of the .img(s) is a better way, and should be the

standard

way to erase android's mounted file systems.

ezterry,

I also believe in your statement above, but doesn't the recovery.img also formats the questionable partitions with the format commands from the update(r)-script the same as fastboot?

Per say:

format("MTD", "system");
format("MTD", "userdata");
format("MTD", "cache");
format("MTD", "boot");
[G1 Android Development] Ohsaka:
Thanks for the props.

For my next trick, I'm thinking about putting a GUI front end onto ApkManager.sh so that we can manage which apps are internal vs. sd-ext.
[G1 Android Development] drd525:
Thanks Ohsaka, works beautifully!

This is an EXCELLENT idea!
[G1 Android Development] ezterry:
In theory the same way as erase_image, in practice the erase image in cyanogenmod seems better than raRecovery (all I can think of is diffrences in rarecovery libmtd and clockwork libmtd.. this new wipe uses a static compiled version from biffmod which is really the clockwork recovery fork in cyanogenmod github)

This is a low level erase of MTD blocks in the partition, but I think fastboot must be flagging the blocks in another way.. that works on some edge cases erase_image fails.

As I said however erase_image nearly always works, so in practice use fastboot erase if changing partition sizes if possible, otherwise this is probably all you need to switch roms 99.9% of the time..
[G1 Android Development] oneG:
I flashed CM RC1 from SuperCSDI and CM ate my battery like a buffet. So I flashed back but im still having battery drain from CM on CSDI. Could the wipe.zip fix my problem?

Sent from the Grandaddy G1 via XDA
[G1 Android Development] Ohsaka:
Probably not, but it couldn't hurt! :)
[G1 Android Development] biglo:
I don't think this .zip is wiping/repair my ext partition, when I run it, it completes in like a 10 seconds and when I use the recovery to wipe the ext and repair it that would take about 20 secs.

I installed cm 5.0.8 after I used the superwipe and the secondary partition couldn't be found. I went back into recovery and did it the regular way and now its fine.
[G1 Android Development] nakeman:
did you repair the ext in recovery after superwiped?
[G1 Android Development] Ohsaka:
Can you run "fdisk -l /dev/block/mmcblk0" from a shell/terminal and paste output here?

Also run "mount" and paste the output here please. I would suggest used using the CODE tags to make the pasted text easier to read.
[G1 Android Development] biglo:
No I didn't repair after I used superwipe because I assumed it did the repair automatically after wiping it, unless I misunderstood the OP. But After I repaired ext using recovery it worked fine.
[G1 Android Development] biglo:
OK I used decide to do everything over, in my rom installation I had about 7 apps installed. I superwipe again (twice :)) and installed cm 5.0.8 again.

Once it was up and running I checked the storage and it shows

total space 458MB

available space 426MB

This is normal when I do a finish install of cm 5.0.8 so I guess it is working and maybe something just went wrong the first time around.

I went to adb and ran the code you gave me. I hope that was the way I was suppose to do it since I never do this sort of thing with the terminal.

fdisk -l /dev/block/mmcblk0

Disk /dev/block/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 226919 7261348+ c Win95 FAT32 (LB
A)
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 226919 242560 500540 83 Linux
Partition 2 does not end on cylinder boundary

Mount

mount
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /sqlite_stmt_journals type tmpfs (rw,relatime,size=4096k)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/dev/block/mtdblock3 on /system type yaffs2 (ro,relatime)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev,relatime)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev,relatime)
/dev/block/mmcblk0p2 on /sd-ext type ext2 (rw,noatime,nodiratime,barrier=1,data=
ordered)
/dev/block//vold/179:1 on /sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,rela
time,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,ioc
harset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

If I did this wrong I'm sorry lol, I tried.
[G1 Android Development] Gazorninplat:
Anyone try this on a 32A Magic yet?

And to confirm, it does not erase the recovery right?

Thanks!
[G1 Android Development] ezterry:
no wont erase recovery, spl, misc, radio.. as its to clean the system not brick your phone :)

I'm not sure if anyone used it on a 32a without the audio jack.. But I know someone in cm forums used on a mt3g1.2 who was having bootloop, and able to continue without issue after.

However It will work on all dream/sapphire systems. So feel free to use it.
[G1 Android Development] lamusic:
Little error

Thanks for your work.

I have a tiny error when i use this .zip file, the erase run correctly in the log :

erase_image cache=0
erase_image system=0
erase_image userdata=0
erase_image boot=0

But; (i'm using psfreedom 1.3.0, is the same of Amon_Ra 1.7.0 with psfreedom, so i suppose is the same issue with Amon_Ra recovery), the partition cache is already mounted so is impossible to unmount; i don't know if the erase run when the partition is mounted but i doubt.

I have poweroff, when i reboot in recovery, i'm ls in cache and i see this :

/ # ls cache/
lost+found
recovery
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

So if is not possible to umount /cache, i thinks the best way is not erasing the cache, or use my "gruik fix".

I have modified the script for "gruik fix" and for my use.

#! /sbin/sh

# modified by luo

/sbin/busybox mount >> /tmp/wipe.log 2>&1

/tmp/work/erase_image cache
echo "erase_image cache=$?" >> /tmp/wipe.log
/tmp/work/erase_image system
echo "erase_image system=$?" >> /tmp/wipe.log
/tmp/work/erase_image userdata
echo "erase_image userdata=$?" >> /tmp/wipe.log
/tmp/work/erase_image boot
echo "erase_image boot=$?" >> /tmp/wipe.log

um

# For purge sdcard with or without ext* partitions
mount /sdcard >> /tmp/wipe.log 2>&1
if [ -e /sdcard/.android_secure ] ; then
rm -rf /sdcard/.android_secure/ >> /tmp/wipe.log 2>&1
fi
if [ -e /sdcard/Android ] ; then
rm -rf /sdcard/Android/ >> /tmp/wipe.log 2>&1
fi

# For ext* partitions
if [ -e /dev/block/mmcblk0p2 ] ; then
mount /sd-ext >> /tmp/wipe.log 2>&1
rm -rf /sd-ext/* >> /tmp/wipe.log 2>&1
um /sd-ext >> /tmp/wipe.log 2>&1
/sbin/e2fsck -pv /dev/block/mmcblk0p2 >> /tmp/wipe.log 2>&1
else
echo "No ext partition found!" >> /tmp/wipe.log
fi

# Remove DiskCacheIndex files
for i in `ls /sdcard/DiskCacheIndex*` ; do
rm -rf $i >> /tmp/wipe.log 2>&1
done

um /sdcard >> /tmp/wipe.log 2>&1

# For fixing a phony dir
if [ -e /cache ] ; then
rm -rf /cache/* >> /tmp/wipe.log 2>&1
fi

exit 0

lamusic aka luo.
[G1 Android Development] annddrrewww:
I want to use this to clean up my phone, but I'm sorta a newbie so, if I use this it won't erase my root on my mytouch 3g?
[G1 Android Development] Ohsaka:
Correct, it will not remove root.
[G1 Android Development] LOONEyRR:
has anyone had any issues with signing in after using this? cause that was the only difference i made and now it wont let me sign in.
[G1 Android Development] pippapeppa:
Hi All,

I have attempted to install the Superwipe but the follow error arise: E:Can't find update script.

My Dream start only in Recory Mode as explained in "http://xdaforums.com/showthread.php?t=837929", seems the internal partition are all broke / unconfigured and any script on this partitation are unavailable.

Can anyboby help me ?

Thanks

Pippapeppa:(
[G1 Android Development] Ohsaka:
How do you think formatting partitions can cause issues with signing in? It makes no sense. All this does is completely erase your phone, if a ROM acts weird then the ROM has problems.
[G1 Android Development] pippapeppa:
Thanks Ohsaka for the response.

So the ROM has corrupt !

On your experience I can fire my Dream or should be any intervento that I can perform ?

Thanks again

Pippapeppa
[G1 Android Development] Ohsaka:
I'll send you a PM and try to help you. Think your problem is bigger than just SuperWipe...
[G1 Android Development] pippapeppa:
Thank Thank Thanks.

I 'm waiting for info.

Regards

Pippapeppa
[G1 Android Development] Ohsaka:
Sent you a PM. Check the "private messages" link in the top right of the page...
[G1 Android Development] azazel673:
thk's for your update ;)
[G1 Android Development] arefin:
Dumb question, I use CW recovery and dont have any power off option, can I use this and simply reboot to recovery to clean up, or powering the phone off is a must?

Thnx
[G1 Android Development] ezterry:
I'd recommend upgrading to ra-recovery. But besides that:

Select reboot then immediately press and hold home until the phone buzzes and shows the splash screen.

If recovery boots it worked.. if you are stuck at the splash optionaly with "fastboot usb" it did not.. try to boot recovery again you are not bricked just booting a non-existant boot.img
[G1 Android Development] Ohsaka:
I agree with terry. :)
[G1 Android Development] arefin:
thanks........
[G1 Android Development] Ohsaka:
Got this in a PM:

Hi, i do not want to spoil your thread, but i think, that your superwipe totaly messed up my phone (european g1) I solved it but i thing, it is better that you know.

What i did have on phone:

spl and radio from ezterry (15 megs+), amon RA recovery 1.7.cyan

rom TMUS G1 remix, firerats apps2ext (ext4), swap partition 96 MB and fat32 partition.

What i did: i had nandroid of above rom and installed biffmod 2.1, than wanted to go back and used your superwipe zip.

After that all my nandroid backups (with ext) refused to boot, stayed forever on boot animation.

I installed CM6.1 without ext and installation went fine, first boot too, but installing any application from market caused reboot. The same was biffmod and TMUS CM remix. (with apropriate kernel off course).

What i tried:

Fastboot erase, repartition SDCARD, everything the same, flash orange.nbh linked in ezterrys OP, still the same problems

What solved it: I came back to android 1.0 (dreaimg.nbh) to try RMA, again repartitoned my sdcard, everything was fine, rerooted,

now i have again "ezterrys" spl and radio, rom TMUS CM6 remix, every app like before...

Conclusion, i wont touch your superwipe anymore.

My theory is, that it somehow corrupted partition mapping (system and data).

Sorry, have no logs saved...

Here are the actual commands my script runs: (comments,logs,etc removed)

erase_image cache
erase_image system
erase_image userdata
erase_image boot
rm -rf /sd-ext/*
rm -rf /sdcard/.android_secure/*

erase_image specifically looks at the partition map boundaries when it does the format. SuperWipe doesn't do anything magical. Google "mtdutils.c" if you want to see the actual C code it uses... It does however erase EVERYTHING on the phone. I think some nandroid backups aren't full backups. I always use BART to do backups. Perhaps nandroid doesn't include the boot partition image?

Anyway... I promise SuperWipe isn't corrupting anything.
[G1 Android Development] ezterry:
Nandroid+ext:

Backups nandroid (system, data, cache, boot)

Also puts /sd-ext/app* into a tarball

Restore restores the nandroid.. removes (-rf) /sd-ext/app* and re-extracts the tarball

bart

Takes a nandroid (at least the same as above, actually cache seems to be another tar file not sure why)

And adds everything from /sd-ext but lost+found into a tarball

Restore restores the nandroid and clears+restores all of /sd-ext

Not sure what is better.. the nandroid method let's you keep some unix files on sd-ext

However biffmod and firerats apps2sd relies on /sd-ext/data .. maybe we will move it to app-data in future.. the nandroid+ext worked better in cm5 where data staid on data
[G1 Android Development] Ohsaka:
Here is the actual code in case anyone is curious what the erase_image function does...

https://github.com/koush/android_bootable_recovery/blob/eclair/mtdutils/mtdutils.c#L493
[G1 Android Development] metalfangs:
I shall keep this on my sd card, thank you Ohsaka :)
[G1 Android Development] ezterry:
Yes just remember to backup first :)

speaking of which

@Ohsaka maybe we want to pull that yn directory out of my radio updater to verify the user really wants to erase everything.. or even a separate choice of erasing nand/sd-ext
[G1 Android Development] Ohsaka:
I don't see why at this point we dont just make a universal SuperWipe for all phones. cat /proc/mtd, skip recovery and misc, but prompt user if they want to erase each partition with YN.
[G1 Android Development] Inceptron:
Thanks! Seems like things are even snappier :D
[G1 Android Development] sparksco:
I totally agree, lazy people need taking care of by stuff like this to make them even lazier
[G1 Android Development] nakeman:
i totally agree with you.. but why not?
[G1 Android Development] sparksco:
Because I don't want to use erase_image to wipe my phone
[G1 Android Development] sparksco:
Testing Results

Ok so there are two ways I tested this superwipe. One method works fine, and the other does not. There is nothing wrong with this superwipe, just the way Biffmod is going about it.

1. First off let me point out that nandroid restores and Froyo roms do not get along. I've always had problems nandroid restoring Froyo roms, and chances are a lot of people are going to have problems like I have. This part of it sucks because if you screw up your phone a nandroid restore will not function as good as a fresh rom install.

2. So I used the superwipe, did a fresh rom install, and everything booted up fine like it should. And no I didn't have to boot up before installing the kernel extractor, pull battery, ect.

3. I superwiped again, but this time did a nandroid restore. Very first thing I noticed was that my custom boot animation was gone, just the stock android one :confused:. This is very confusing because the boot animation is located in the system/media, and not the data/local. It booted up and everything, but then started ramdonly soft rebooting.

Conclusion: This superwipe seems to be ok, but there is one flaw. After you wipe you erase ./android_secure yes? If you nandroid restore with Amon RA 1.7.0, it doesn't restore the ./android_secure. This basicly does everything that clockworkmod recovery does except quicker. DON'T use this and then do a nandroid restore or you will run into problems! I know a lot of people don't want to wipe or whatever, but a fresh rom install is the best option.[/QUOTE]
[G1 Android Development] AndDiSa:
Why do you think nandroid is not working with FroYo-ROMs? I am using it always (to be honest I am using BART, but it's almost the same + sd-ext backup) and there are no problems at all. Probably you run into problems when switching between different ROMs without wiping, but that's another thing and not due to nandroid. :confused:
[G1 Android Development] QUEDRO:
Will this can be virtually working on other devices like MT4G ?
[G1 Android Development] BookCase:
I just wanna say, i love how it says, "Hope you made a backup" instead of asking you if you wanna make a backup first. I lol'd.
[G1 Android Development] Ohsaka:
So the one flaw in the "one step completely wipe your phone" zip is that it wipes the .android_secure directory? You must have some strange new meaning of the phrase "completely wipe" that I wasn't previously aware of.

If you are having troubles restoring backups then either its user error or a broken backup method...
[G1 Android Development] Gazorninplat:
Update: Works great on my 32A Magic!
[G1 Android Development] sparksco:
haha, no, same rom, and bart backup should have nothing to do with the boot animation now should it? Also I just had my first random reboot, which I never had before now.

Edit: Look don't get mad at me for froyo being a B**CH
[G1 Android Development] sparksco:
NO, and NO
[G1 Android Development] sparksco:
Still can't admit that nandroid restore doesn't restore ./android_secure, but whatever I'm done with this thread.
[G1 Android Development] Ohsaka:
Sounds like nandroid is broken... why dont you whip out your elite dev skills and fix it?
[G1 Android Development] BookCase:
Nandroid Restore hasn't worked for me since "CM6" 1st came out. Just saying. I no longer even bother trying. Now, i wipe and reformat every time and use Titanium Backup to restore after flashing and setting everything up.
[G1 Android Development] sparksco:
Me too! Good Call! This superwipe works fine, I never said that it didn't, but only when I do a fresh rom install.
[G1 Android Development] Spakainz:
I have problems with NAND restore since updated radio to 2.22.27.08 and using ezterry kernel. I decided to flash clockworkmod recovery, but when I flashing it I get error : "FAILED (remote: signature verify fail)". I think it is because I use SPL: 1.33.0013d. How I can fix it and flash other recovery? Maybe I need engeneering SPL?
[G1 Android Development] AndDiSa:
Where is ./android_secure located and what are nandroid and BART doing?

./android_secure is located on the root of /sdcard and not on /sd-ext nor on /system nor on /data nor on /boot nor on /cache (speking in mount points, not partitons).

Nandroid is backing up /sytem, /data, /cache and your boot image. BART is additionally doing a tgz of your /sd-ext ... but no one is doing a backup of your /sdcard.

So if you want a backup of your /sdcard (or parts of it), you have to do it manually, or writing a script which is doing that ... same for restoring later.

Send from my G1 with HTCClay's UNOFFICIAL Superfly 1.6 D/S ADS using XDA App
[G1 Android Development] sparksco:
Trivial games, ha, save your breath, I already know "Where it is", and that it is hidden.

Really!! You want a cookie now?

I don't know why anyone would go through all of the trouble to write scripts for something that clockworkmod recovery already does, or the manual method you mentioned.

1. Copy ./android_secure to computer for backup, then unmount USB

2. Flash superwipe, and then mount usb again, copy folder back to /sdcard
[G1 Android Development] greenster4470:
hey could anybody please explain how to execute this Oshaka "super wipe" I'd really appreciate it. Thanks in advance. Peace
[G1 Android Development] ThR1LL:
Sorry for the extremely noob question but it's because I'm really interested in using this :D What's the difference between this and using fastboot erase system -w, fastboot erase boot, and deleting/recreating my ext partitions?
[G1 Android Development] drslippyfist:
Installation Aborted

Im having a little trouble running this. When I try to "install zip from sdcard"

it runs some words on the screen but ends with installation aborted. Do you know where Im going wrong
[G1 Android Development] sparksco:
What recovery are you using?
[G1 Android Development] Ohsaka:
This does a low level format of all the partitions. Plus its simpler, flash file and you are done. Less clicking required.
[G1 Android Development] drslippyfist:
RA AR amons arons. I can never get it right.its one of those. Not clockwork
[G1 Android Development] losinc:
would it be possible to make something like this for the newer phones like the mt4g and the g2?
[G1 Android Development] Ohsaka:
It would be fairly simple. The erase_image executable would probably need to be recompiled and the parition names verified.

As soon as someone donates me a new phone I will be all over it! :)
[G1 Android Development] sparksco:
lol, well I wouldn't put all your eggs in one basket buddy, I'm still waiting for my phone too :p
[G1 Android Development] Ohsaka:
I was going to buy a Nexus S for Xmas. Then I found out its just a Nexus One with a Front Facing Camera. So disappointed now, there is no phone that I want or am waiting for now...
[G1 Android Development] sparksco:
Auto Reboot?

Any chance you could add a auto-reboot to recovery with this for amon ra recovery? Not a big deal but it sure would help make life easier
[G1 Android Development] Phateless:
Do we know if this works for mt4g?
[G1 Android Development] sd2000:
I don't know

I don't know what I am doing wrong I put the zip file on my sd card and I go into fast boot and try and flash it and it doesn't do any thing. I am on Amon Ra 1.7 recovery and cyanogen 6.0 stable. Any help would be appreciated.
[G1 Android Development] Phateless:
SuperWipe is flashed through RECOVERY, not fastboot. You flash it just like a rom.
[G1 Android Development] sd2000:
oh let me give that a try :o

well that worked and after I powered off I rebooted into recovery then what do I do? sorry I am such a NOOB :)
[G1 Android Development] sd2000:
So after I super wipe the I have to flash a new recovery such as Cyanogen 6?
[G1 Android Development] Phateless:
Then you flash whichever rom you like in exactly the same way. Then flash the appropriate google apps, again in the same way.

Are you following a guide?
[G1 Android Development] sd2000:
Is there a guide because I didn't see one? If you could direct me to a guide I would be most Thankful :o