Clear Cache and Data from Stock Recovery

Search This thread

K J Rad

Senior Member
Jan 7, 2011
479
97
I've seen a number of requests for this functionality and recently it became necessary for one user who had a disabled Home Key to clear cache and data without the use of ClockworkMod. I have reserached two methods to address this issue. These instructions require some familiarity of android, computer and tablet terminology and usage. Feel free to ask for clarifications in comments. Here we go...

Method I - Stock Recovery Command File

Technical: Stock Recovery command file can be used to perform a few additional functions as well as to alter the path to update files. These commands will execute with all privileges available to recovery mode.

Advantages: Very easy to use. Very little technical knowledge required. No third party software is required for use.

Prerequisites: You will need a MicroSD card formatted FAT32 and a method for transferring files from your computer to the MicroSD.

Usage:

1) Prepare a text file named "command" (no file extension) with one of the following commands on a single line. The wipe data command will wipe both data and cache. Wipe cache will wipe cache only.

--wipe_data
--wipe_cache

2) Place the file in a folder named "recovery" in the root directory of your MicroSD card.
3) From a powered down state, insert the MicroSD card into your tablet and boot into recovery by powering it on while holding down the Volume Up key.
4) Allow the command to execute completely then the tablet should reboot (this may not occur automatically depending on firmware installed).

Method II - Updater Script

Technical: The attached "Updater Scripts" perform delete commands (recursively if necessary) on the named directory or file(s). The directories are mounted automatically by the system before the script executes but it could be easily revised to include that step if necessary. The partitioning, formatting and directory structure are left untouched. Only files are deleted.

Advantages: No third party software is necessary for execution. Relatively easy to modify for more surgical precision (i.e. leaving installed apps but clearing possibly corrupted system data). Included example: "Clear Battery Stats"

Prerequisites: You will need a MicroSD card formatted FAT32 and a method for transferring files from your computer to the MicroSD.

Usage:

1) Download the attached archive (ClearData.zip) to your computer.
2) Extract the files to your computer. You should then have a folder named "recovery" (which contains a file named "command") and an additional archive named "update.zip"
3) Place the recovery folder and the update.zip in the root directory of the MicroSD card.
4) From a powered down state, insert the MicroSD card into your tablet and boot into recovery by powering it on while holding down the Volume Up key.
5) Allow the script to execute completely then reboot the tablet (this may occur automatically depending on firmware installed).
 
Last edited:

K J Rad

Senior Member
Jan 7, 2011
479
97
You're welcome. One quick note... the new stock recovery adds a menu simiilar to ClockworkMod. These methods will still work since the recovery folder/command file are checked first but it really isn't as necessary any more.
 

lrgche

Member
Apr 15, 2011
7
0
Need Help

Tried both methods above but either way I get to the viewsonic splash with the message "Booting recovery kernel image" in the upper left and it just stays there, stuck there, I left it for a long time to see and it never leaves that screen.

Any ideas?
 

Loukoebel

New member
Apr 15, 2011
1
0
Me too

I can't get into clockworkmod either. My machine is running faster. I almost hate to mess it more.
 

K J Rad

Senior Member
Jan 7, 2011
479
97
Tried both methods above but either way I get to the viewsonic splash with the message "Booting recovery kernel image" in the upper left and it just stays there, stuck there, I left it for a long time to see and it never leaves that screen.

Any ideas?

That's an indication that you may have more serious problems. nvflash will be required. http://xdaforums.com/showthread.php?t=861950

Once done you will likely need to install ClockworkMod and repartition your internal storage.

I can't get into clockworkmod either. My machine is running faster. I almost hate to mess it more.

If your tablet boots properly but you can't get into CWM then it probably isn't installed properly (or at all). http://xdaforums.com/showthread.php?t=865245

Keep in mind that CWM is NOT compatible with all ROMs. Make sure the developer for your chosen ROM recommends it before installing it.
 
Last edited:

K J Rad

Senior Member
Jan 7, 2011
479
97
Both methods are performed with an external MicroSD card. They will work from internal also but it is a little more difficult to get the files in place if your tablet is not booting properly.
 

lsu205

Senior Member
Dec 18, 2010
150
6
Both methods are performed with an external MicroSD card. They will work from internal also but it is a little more difficult to get the files in place if your tablet is not booting properly.
so your method is a simple way to replace one of the main uses of Clockword MOD?--Plus you stay stock more or less.
 

K J Rad

Senior Member
Jan 7, 2011
479
97
That is correct. Method II can also be modified to be less intrusive (leave user apps installed) or embedded into update scripts to perform a wipe during new ROM installs.
 

enigma0456

Senior Member
Feb 11, 2011
154
10
And the partitions?

Your post is very interesting. It implies that you have a knowledge of the g-tabs partition structure. I have played with Linux off and on for the last 10+ years. When I began, I used Slackware and when you set it up you had to manually create partition tables using fdisk. You were only required to create two - the data partition and a swap partition but it was often recommended that you create several others - one to contain the home directory to prevent users from using all the disk space (in the days of small disks) for example. It appears that there are a lot of partition on the g-tab. Up to now, I have used various wiping tools like clockwork or calkulins wipe all on faith. I would really like to know what all the partitions are and what is in them. I have used terminal to get to the root folder and tried to do an fdisk to display the partitions but try as I might everything remains hidden. It would seem that a script like yours could be adapted to do many things but I would certainly want to understand the structure a little better before I did anything. I have searched and been unable to find that information. Can you point a way for the curious to learn more about the partition structure on the g-tab?
 

K J Rad

Senior Member
Jan 7, 2011
479
97
Wish I had a direction I could point you in. What I've found so far has mostly been stumbled upon while looking for something else. What I can tell you is this...

1) When using fdisk in Android you must specify the device to look at. Try something like: fdisk /dev/block/mccblk3 That should list the current partitions as defined by CWM or whatever was used originally.

2) Within one of those partitions in the list generated above are sub-partitions holding the bootloader, system, data, etc partitions. You can see how they're described in the .cfg files in the nvflash restores that are lying about.
 
Last edited:

CodeNamePapa

Member
Apr 19, 2011
13
1
K J Rad - any idea if the partition size can be set with these methods (2048 & 0) in case I can't get clockwork installed?
 

K J Rad

Senior Member
Jan 7, 2011
479
97
K J Rad - any idea if the partition size can be set with these methods (2048 & 0) in case I can't get clockwork installed?

I'm looking for a solution to that problem. Unfortunately these methods still require the ability to get into recovery mode which likely won't work if you're having trouble getting CWM installed.

If, however, you can get into recovery... then it is theoretically possible to create a script that would accomplish that. As soon as I have one I'll be adding it to the mix ;-)

Edit: I've found something I think will work. Will do some testing tonight. It will still require access to recovery.
 
Last edited:

CodeNamePapa

Member
Apr 19, 2011
13
1
More thoughts:
because I went w/ cyan7 is it possible i have a "bad" kernel and that the stock bekit-1105 or the roebeet-3588 files are crashing w/ the kernel in place already?

I know custom ROMs can have a custom kernel applied separately, but I have no idea whether cyan7 loads it's own kernel...

I have yet to try the nvflash_gtablet_46 version, as I see the img files w/in are different from the original 1105 .zip

Also:
read on another thread that part 2 and part 3 aren't loading for other users when doing nvflash - I did notice that it pauses, runs some stuff, then starts loading part 4 through to the last part, then success. - do part 2 and 3 run for you?

edit: I see a 4349 downgrade.zip in another thread for those who got the OTA update but want to go back to stock 3588 prior to jumping off somewhere else - I can't expect that would help me as I can't do squat w/ recovery yet, but could that possibly "reset" any bad kernel problems? - again, I'm just thinking out loud.
 
Last edited:

K J Rad

Senior Member
Jan 7, 2011
479
97
This is well outside the scope of this thread but I find some of what you mention interesting so I'll address it and then end any further off topic discussions.

I did not build nor have I ever used Cyan7 so I have no basis for an opinion on the matter other than this... Each ROM comes with a kernel installed so if properly done an nvflash should overwrite any "bad" kernel.

Part2 and Part3 do indeed load, they are just displayed differently than the other Parts. Just minutes ago I flashed down from Mountain Laurel (4349 based with the new bootloader and recovery) with absolutely no trouble. I can, and have, read back those partitions after an nvflash to prove that point.

The 4349 downgrade will only work for you if recovery is working. Having never used it I don't know that it would "reset" the kernel but any subsequent flashing of a new ROM image would.

I am working on a stock recovery solution for partitioning but it isn't likely to help anyone who is stuck in an APX loop. I do have some ideas on what might help for that condition but I haven't been able to get my hands on one for testing and trying to help people here is like being a consulting mechanic for a car repair that's in someone else's shop having work done on it that you're not being told about.

I'll be happy to address any further comments or questions regarding your specific issue in an appropriate thread or via PM. Thanks.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    I've seen a number of requests for this functionality and recently it became necessary for one user who had a disabled Home Key to clear cache and data without the use of ClockworkMod. I have reserached two methods to address this issue. These instructions require some familiarity of android, computer and tablet terminology and usage. Feel free to ask for clarifications in comments. Here we go...

    Method I - Stock Recovery Command File

    Technical: Stock Recovery command file can be used to perform a few additional functions as well as to alter the path to update files. These commands will execute with all privileges available to recovery mode.

    Advantages: Very easy to use. Very little technical knowledge required. No third party software is required for use.

    Prerequisites: You will need a MicroSD card formatted FAT32 and a method for transferring files from your computer to the MicroSD.

    Usage:

    1) Prepare a text file named "command" (no file extension) with one of the following commands on a single line. The wipe data command will wipe both data and cache. Wipe cache will wipe cache only.

    --wipe_data
    --wipe_cache

    2) Place the file in a folder named "recovery" in the root directory of your MicroSD card.
    3) From a powered down state, insert the MicroSD card into your tablet and boot into recovery by powering it on while holding down the Volume Up key.
    4) Allow the command to execute completely then the tablet should reboot (this may not occur automatically depending on firmware installed).

    Method II - Updater Script

    Technical: The attached "Updater Scripts" perform delete commands (recursively if necessary) on the named directory or file(s). The directories are mounted automatically by the system before the script executes but it could be easily revised to include that step if necessary. The partitioning, formatting and directory structure are left untouched. Only files are deleted.

    Advantages: No third party software is necessary for execution. Relatively easy to modify for more surgical precision (i.e. leaving installed apps but clearing possibly corrupted system data). Included example: "Clear Battery Stats"

    Prerequisites: You will need a MicroSD card formatted FAT32 and a method for transferring files from your computer to the MicroSD.

    Usage:

    1) Download the attached archive (ClearData.zip) to your computer.
    2) Extract the files to your computer. You should then have a folder named "recovery" (which contains a file named "command") and an additional archive named "update.zip"
    3) Place the recovery folder and the update.zip in the root directory of the MicroSD card.
    4) From a powered down state, insert the MicroSD card into your tablet and boot into recovery by powering it on while holding down the Volume Up key.
    5) Allow the script to execute completely then reboot the tablet (this may occur automatically depending on firmware installed).
    1
    microSD, command file, --wipe_data = FLAWLESS VICTORY!!

    I can't thank K J Rad enough for his suggestion "--wipe_data" (sans quotes a mere 11 characters) saved me from the endless apx booting status.

    The method 1 process outlined by K J Rad in post #1 of this thread was the solution to my problem.

    I had nvflashed my buns off - to no avail - but I'm 100% back in the land of the living now - I've shut the device off, and turned it back on and voila - no apx mode by default!

    Here is a blathering run-down of K J Rad's steps I performed successfully - if you want the short version, just follow method 1 in post #1 of this thread.

    First note - make sure your microSD is formatted FAT32 - my Nikon formats in FAT and I didn't think to check it in any other attempts.

    I formatted your microSD as FAT32,
    put a folder on it called "Recovery",
    a command file with --wipe_data as the only text inside,
    popped it into the gtablet,
    hit volume.plus & POWER

    Sweet. Glorious. Birds.

    the hills are alive, with the sound of geeee-taaaaaab

    I hadn't seen the birds in days, so I knew I was on the right track.

    The --wipe_data command was successful, it booted into the old stock ROM w/o any issue (it booted into the old stock ROM b/c that was the last one I nvflashed)

    With the stock TnT interface the USB connection wasn't firing up (random? it had been previously) but no worries.

    Again I loaded my microSD - this time with CWM.08 update.zip and a recovery folder w/ command file (noting a SDCARD2 command, natch)

    Put microSD in gtablet, shut down, did the recovery volume.plus & Power = Recovery Key Detected, hello Clockwork!

    At this point I popped my microSD out, and hit "Advanced, Reboot Recovery" - just to make sure I wasn't dreaming (I slapped myself in the head for good measure, too).

    (some of the following steps may be redundant to other threads and to the processes I had already done, but I just want to clarify for any noobs (or non-noobs) who were down on their luck like I was - I pity the fool... and I was the fool for about a week... plus, if it's borked, let's get it fixed, right?)

    Once I was back in Clockwork:
    1. wipe data / factory reset
    2. Then Wipe Cache
    3. Then, Advanced, Wipe Dalvik Cache
    4. Finally, Advanced, Partition SD Card with 2048 and 0 - this step takes a minute or so, it asks you do "please wait..." - so please... wait...

    Just to make sure I was still good, I did Advanced, Reboot Recovery - and it booted back into Clockwork.

    At this point I mounted USB, loaded the stock 3588 update.zip, and installed it w/o issue.

    Rebooted.

    Hello birds, hello gtablet logo, TnT logo (meh), and hello welcome screen.

    What. An. Ordeal.


    Take Heed, All Who Consider NVFLASH:
    Roebeet says "this is extreme, a last resort"
    And he knows what he's talking about - and I do too, now.

    I gave up on other recovery/installation processes WAY TOO SOON and thought "well, these nvflash steps don't look too bad - a fresh start sounds like a good idea"

    I've had a knot in my gut and brain for days due to the endless apx boot status, haven't been sleeping well, if at all, as I've been thread searching until WAY TOO LATE at night, etc... I've dug around so many threads that bookmarking them has proven worthless.

    I will do my part to update any "apx boot loop" threads on which I've already commented to let them know this was the method that saved my woot-envy-better-get-one-from-ebay $300 purchase from needing to be tethered to my PC in order to boot!

    Thanks again K J Rad, for your patience with my multiple questions, and for figuring this out.

    </blathering>

    EDIT: Because of my sleep deprivation, I can't say which of these processes I performed... it's either:
    1. gtab was powered off, inserted microSD, did recovery volume.plus & power, said "Recovery Key Detected"

    OR

    2. had the microSD inserted, and merely held down volume.plus as the nvflash process was nearing completion, and then it booted recovery.

    Either way, follow the steps, get it done.