[TOOL] G2X Cleanup Batch *** WARNING *** WILL FORMAT INTERNAL SD

Search This thread

mansa_noob

Senior Member
Feb 21, 2012
533
151
Markham
G2X with T-Mobile on top of it

Open device manager in windows. Expand usb section.Connect device holding volume + and - with battery removed. Wait until the driver is loaded and device is recognized. Then execute the batch file. Wait for phone to reboot. Then disconnect, put battery in. Hold down volume -. Press and hold power until back in recovery. Then mount sd card.

I am guessing you already did all that. External sd card should work this way.

Sent from my LG-P999 using XDA
 
Last edited:
  • Like
Reactions: thehumble1

Klathmon

Senior Member
May 1, 2011
320
232
If you create and test a linux version, please post it. If you like I can post the link in the OP.

Good things should be spread like wild fire :D

attached the linux version. everything should work but ill need someone to test it cause i made it on my windows machine because my nix-box is currently OOC.

i also updated the CWM version from 5.0.2.0 to 5.0.2.8 and uploaded a windows version of it too... :) (please test this too before trusting it)

Enjoy :cool:

EDIT: changed linux version to more nix-friendly compression format.

ANOTHER EDIT: added actual 5.0.2.8.img to the linux version (whoopsies)

Both files are tested and working :)
 

Attachments

  • G2XCleanUpBatch5028.rar
    7.4 MB · Views: 1,652
  • G2XCleanUpScriptInternalSDFormatLinux.tar.gz
    7.8 MB · Views: 505
Last edited:

exorcist70

Senior Member
Dec 10, 2011
73
9
Pennsylvania

exorcist70

Senior Member
Dec 10, 2011
73
9
Pennsylvania
try going into CWM, go to mounts and storage, and hit format/emmc
reboot and try it.

if its still not working, try another rom to see if it works there. if it does, post in Mr. Apocalypse's thread that its an issue for you on his rom.

I updated my CWM to 5.0.28 and then ran the newest Cleanup Batch for 5.0.28, reinstalled fresh Genesis v1 ROM, booted into CWM to format the emmc and got the following:

Error mounting /emmc!
Skipping format...
Done.


Dunno why I got an error with it.

Oh, also the internal storage is reporting 1.45GB total
 
Last edited:

exorcist70

Senior Member
Dec 10, 2011
73
9
Pennsylvania
I updated my CWM to 5.0.28 and then ran the newest Cleanup Batch for 5.0.28, reinstalled fresh Genesis v1 ROM, booted into CWM to format the emmc and got the following:

Error mounting /emmc!
Skipping format...
Done.


Dunno why I got an error with it.

Oh, also the internal storage is reporting 1.45GB total

It's all fixed now. Had to install a fresh GB rom then go in to storage then I had the option to format the internal sd. Reinstalled Mr. A's Genesis v1 rom and all is happy happy now.

Thanks for everyone's help/input! :)
 

shane1diamond

Senior Member
Jun 18, 2011
577
128
Hawaii
attached the linux version. everything should work but ill need someone to test it cause i made it on my windows machine because my nix-box is currently OOC.

i also updated the CWM version from 5.0.2.0 to 5.0.2.8 and uploaded a windows version of it too... :) (please test this too before trusting it)

Enjoy :cool:

am i able to use this attached rar file to update to 5.0.2.8 after using the cleanup batch tool? if so how would one go about doing that? or should i just NV flash to update the newest CWM? tia
 
Last edited:

mansa_noob

Senior Member
Feb 21, 2012
533
151
Markham
It's all fixed now. Had to install a fresh GB rom then go in to storage then I had the option to format the internal sd. Reinstalled Mr. A's Genesis v1 rom and all is happy happy now.

Thanks for everyone's help/input! :)

I have looked through the two sets of ROMs (GB and ICS) and the difference seems to be coming from (correct me if I am wrong) the following file:

/system/etc/vold.fstab.

Apparently in ICS the following line appears:
dev_mount emmc /mnt/emmc 8 /devices/platform/tegra-sdhci.3/mmc_host/mmc2

whereas in GB the following one:
dev_mount emmc /mnt/emmc 9 /devices/platform/tegra-sdhci.3/mmc_host/mmc2

Based on description it would seem that the ROM would try to mount partition #8 in ICS and #9 in GB.

Any comments?
 

Klathmon

Senior Member
May 1, 2011
320
232
I have looked through the two sets of ROMs (GB and ICS) and the difference seems to be coming from (correct me if I am wrong) the following file:

/system/etc/vold.fstab.

Apparently in ICS the following line appears:
dev_mount emmc /mnt/emmc 8 /devices/platform/tegra-sdhci.3/mmc_host/mmc2

whereas in GB the following one:
dev_mount emmc /mnt/emmc 9 /devices/platform/tegra-sdhci.3/mmc_host/mmc2

Based on description it would seem that the ROM would try to mount partition #8 in ICS and #9 in GB.

Any comments?

that could be the case, what GB rom did you pull that line from? (and ICS rom)

not really sure why that would change though...


am i able to use this attached rar file to update to 5.0.2.8 after using the cleanup batch tool? if so how would one go about doing that? or should i just NV flash to update the newest CWM? tia

the file i attached is the exact same thing as what is in the first post, but its updated to the new version. so if you flash that you will be wiping again...

(still haven't heard any word that it works alright though)
 
  • Like
Reactions: shane1diamond

mansa_noob

Senior Member
Feb 21, 2012
533
151
Markham
attached the linux version. everything should work but ill need someone to test it cause i made it on my windows machine because my nix-box is currently OOC.

i also updated the CWM version from 5.0.2.0 to 5.0.2.8 and uploaded a windows version of it too... :) (please test this too before trusting it)

Enjoy :cool:

Awesome. Tested the windows version (don't have a linux machine at all :(). Anyways, the windows version with 5.0.2.8 works great.

I will edit the OP with link to your post!

Thanks again.

[edit] OP updated. Let me know if you want to change something.
 
Last edited:

mansa_noob

Senior Member
Feb 21, 2012
533
151
Markham
that could be the case, what GB rom did you pull that line from? (and ICS rom)

not really sure why that would change though...

Not sure... have so many ROMs on my SD card that I have lost track :D. Anyways, I looked through a few and that seems to be a common theme between GB and ICS. I think its from Android. They don't expect anyone updating on an empty slate... so probably would be ignored when going GB --> ICS but corrupts when going blank --> ICS.

I know... it seems far fetched (likely because it is :)).

I tried a few variants of the script... moving #8 and #9 around, using boot.img from ICS builds, etc. but nothing solves this problem. Seems like blank --> GB --> ICS is the only working route.

Maybe we should ask the Devs (if any are listening please chime in).
 

MWBehr

Senior Member
Oct 11, 2010
1,164
380
Corpus Christi
Not sure... have so many ROMs on my SD card that I have lost track :D. Anyways, I looked through a few and that seems to be a common theme between GB and ICS. I think its from Android. They don't expect anyone updating on an empty slate... so probably would be ignored when going GB --> ICS but corrupts when going blank --> ICS.

I know... it seems far fetched (likely because it is :)).

I tried a few variants of the script... moving #8 and #9 around, using boot.img from ICS builds, etc. but nothing solves this problem. Seems like blank --> GB --> ICS is the only working route.

Maybe we should ask the Devs (if any are listening please chime in).

I'm no dev, but all I can tell you is EMMC is definately p8. Also, if memory serves correctly, you're also right that EMMC on GB was p9. The partition tables that CWM uses are:

0p1 = system
0p2 = cache
0p5 = boot partition
0p7 = data
0p8 = emmc
1p1 = sdcard

There is no mmcblk0p9 under /sys/block/mmcblk0 so I have to assume that ICS has no partition 9 on the mmc. I wish I could also tell you what is in p3, 4, and 6, but I can't :D
 
  • Like
Reactions: kesara

kesara

Senior Member
Oct 16, 2011
460
103
Chesterbrook
attached the linux version. everything should work but ill need someone to test it cause i made it on my windows machine because my nix-box is currently OOC.

i also updated the CWM version from 5.0.2.0 to 5.0.2.8 and uploaded a windows version of it too... :) (please test this too before trusting it)

Enjoy :cool:

Linux version - the RAR file is corrupt

Sent from my LG-P999 using xda premium
 
Last edited:

overground

Retired Senior Moderator / Inactive Recognized Dev
I have looked through the two sets of ROMs (GB and ICS) and the difference seems to be coming from (correct me if I am wrong) the following file:

/system/etc/vold.fstab.

Apparently in ICS the following line appears:
dev_mount emmc /mnt/emmc 8 /devices/platform/tegra-sdhci.3/mmc_host/mmc2

whereas in GB the following one:
dev_mount emmc /mnt/emmc 9 /devices/platform/tegra-sdhci.3/mmc_host/mmc2

Based on description it would seem that the ROM would try to mount partition #8 in ICS and #9 in GB.

Any comments?

Don't know which ROM you're looking at, but early ICS ROMs had that in fstab.
In order to get emmc to work on some of the earlier 4.0.x ROMs for the G2X, one had to manually edit fstab to read 8 instead of 9.
Most devs have fixed this in their ROMs by now.
 

Klathmon

Senior Member
May 1, 2011
320
232
Thanks, the gziped file is good. Seems you didn't include the recovery-p999-5.0.2.8.img in the package. I have that but others might not.

Lol damn I'm not havin a good day :(, ill make sure to include it and test the whole thing when i get home

Sent from my LG-P999 using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 36
    If you are going to flash and ICS ROM after this tool please make sure to first install a GB then ICS otherwise your SD card will not be accessible. I am trying to find a fix but it has been illusive. This statement will be removed once a fix has been found and OP updated.

    Now with CWM Touch!

    This method uses NVFLASH to recreate all partitions and formats them, thereby getting rid of the file allocation pointers and hence renders data inaccessible without effort.

    Note: I have never seen a file come back to life or its data affect other files without effort on the users part or a temporary glitch once the partitions and pointers have been overwritten. Please post a reply with evidence if you have seen it.


    Benefits:

    The contents of the zip file can be used to super clean G2X before a new ROM flash. This tool recreates all the partitions in the phone so wipes the pointers to all files (everything). The method it employes has existed from before. The files here will stop short of pushing a ROM, so that you can push your favorite ROM.

    Prerequisites:

    • G2X (Will not work on O2X due to different partition table)
    • Desire to have a clean install of your favorite ROM :D
    • Backup your data

      *** WARNING ***​

      This tool will wipe both phone internal memory and internal SD card. External SD card content is safe.

      Don't say you haven't been warned!

    What to do:

    • Download the attached Zip file.
    • Take out the battery (assuming you have backed up your data on external SD card, computer or elsewhere), connect the device via USB while holding VOL+ and VOL- together. Don't let go of the volume buttons until the device is recognized.
      (I typically leave Device Manager open to see when it shows up in the list under "USB Controllers").
    • Launch flash.bat, sit back and wait until the process finishes (generally a good idea to open a command prompt, CD to the directory and then run the file).
    • Unplug, put battery in, reboot into CWM recovery (pushed by this tool) by holding VOL- first, then pressing and holding POWER).
    • Flash your favorite ROM.
    • Enjoy!

    I made this package because I could not get the bluetooth to work with G2x GB 2.3.3 (and below). The issue was a disconnect problem where both the phone and headset would still think they were connected but in audio would not be routed for a call or media. After this procedure my phone has not had an issue for almost 3 weeks now. I have tried it with two ROMs and 3 different headsets without any issues.

    I guess I will not toss this phone after all :D.

    Putting it out there in the hope that it may help others solve some of their issues as well. I suspect bad data stays in places not touched by other methods.

    Your comments are most welcome.

    [Update]

    Klathmon has made an newer version with CWM 5.0.2.8. RP by Klathmon can be found here:

    http://xdaforums.com/showpost.php?p=24768294&postcount=66

    I have tested the windows version but linux one is untested. Use at your own risk.

    [Update]

    Now with CWM Touch!

    Thanks to everyone who has contributed on this thread with a drive to positive change! You work/comments/suggestions are very much appreciated.



    References:
    http://xdaforums.com/showthread.php?t=1248644. This link was the inspiration for the current work.

    Link to CWM Touch development thread. I took the image posted there: http://rootzwiki.com/topic/22984-recovery-touch-enabled-cwm-5813/



    [EDIT] The zip file should be fixed now. Darn work machine does something to the upload.
    5
    If you create and test a linux version, please post it. If you like I can post the link in the OP.

    Good things should be spread like wild fire :D

    attached the linux version. everything should work but ill need someone to test it cause i made it on my windows machine because my nix-box is currently OOC.

    i also updated the CWM version from 5.0.2.0 to 5.0.2.8 and uploaded a windows version of it too... :) (please test this too before trusting it)

    Enjoy :cool:

    EDIT: changed linux version to more nix-friendly compression format.

    ANOTHER EDIT: added actual 5.0.2.8.img to the linux version (whoopsies)

    Both files are tested and working :)
    4
    honestly this is a great idea. Unless your trying to wipe data for security purposes (like the FBI is out to get you) there is no need to write all 1's then all 0's (and honesty you should follow that up with random data for true security). Removing the partition table and recreating it will TRULY restore this phone to as much of a clean-slate as your gonna get.

    I have never (and should never) seen a programmer access data by means of a low level memory address, so even though most of the 1's and 0's are still there, the pointers to those values are gone. so unless the program is written SPECIFICALLY to restore data from this, its not going to magically appear (or glitch into existence).

    and IMHO, this does a much faster, better, and more thorough job of restoring things back to a base, so that new ROM's will not have issues. It erases and rewrites ALL usable partitions of the phone (excluding external card), including boot, cache, data, system, internal sd, and a few others that im not sure what they are even used for. For all i know, many issues could be caused by strange data written to system, or a weird glitch in one of the other partitions caused from us flashing so much.

    I'm not trying to start fights here, im only simply stating a comparison, in the same way i would compare 2 apps. The nullifier does have its uses, but i feel its more suited to secure data destruction than resetting the phone back to a clean slate.

    last note, wiping internal might be a good idea, as newer roms are starting to use it differently than just a second storage. :)
    3
    First of all thank you for another useful tool for our G2X! Secondly I just had to say that I'm truly impressed with how you've handled this discussion. In my opinion people are just ridiculously sensitive on these forums sometimes and it can cause things to get out of hand quickly. To clarify I'm not saying Bork was ridiculously sensitive at all because he worked hard to provide everybody an awesome "tool" so he has all the right in the world to be sensitive about his work. (In fact I'm gonna try out his Nullifier along with this one and I'm truly appreciative for having both!) What I'm saying is if you were ridiculously sensitive and responded ignorantly it most likely could've gone out of control. It just seems like that happens a lot and we wind up losing either great developers or great "tools" for our phones. So I was definitely impressed because it shows that you really weren't trying to step on toes or compare girths lol. Very well played man and thanks for the script (or "tool") for my phone! Just my two cents anyway :D


    Sent from your inner child
    3
    :)I just wanted to thank you for all your work on this. I was getting ready to flash 5.0.2.8 this morning by using the flash tool with 5.0.2.0 in it and altering the file to change the img to 5.0.2.8 so that it would upgrade my CWM. I wanted to try the new touch recovery from CWM but I decided it would be allot more trouble renaming files etc..... and lo and behold I get up this morning and come into to check the OP one more time before I flashed and there as pretty as you please is the Touch CWM already set up to flash my G2x and get the added advantage of G2x Clean Up Batch as I also was having issues with Bluetooth. Flashed the batch file and it all went smoothly as can be, now up and running my Hell Fire Rom and its much faster. No one can compensate you guys for the work you do on here but I did drop a donation in the box for you. Thanks again!!!!