[TOOL] G2X Cleanup Batch *** WARNING *** WILL FORMAT INTERNAL SD - T-Mobile LG G2x

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
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 .
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://forum.xda-developers.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://forum.xda-developers.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.

was just about to flash the new hellfire rom and saw this tool! will try it out and see how things go
edit: yeah corrupt zip on my end too.

The zip file seems to be corrupt. Could you re-upload plz

worked great on my end, no problems.

khanggle said:
worked great on my end, no problems.
Click to expand...
Click to collapse
The real test is how stable your ROM would stay with this method to wipe than any of the other methods.
I guess only time will tell .

wow this method really blaze hellfire much thanks to your( you) & (rom dev)

Ohh I like this. Thank you for sharing .
This thing is faster than nullifier, and I especially like how you don't need to be in CWM to use it. It just seems like doing it in "update mode" would allow better manipulation of the phone's internals.

so this tool DOES format and nullify in addition to recreating the partitions?
deleting and recreating partitions does not remove data. only by writing over existing data can you get rid of it (like nullifier does)

dodgefan67 said:
so this tool DOES format and nullify in addition to recreating the partitions?
deleting and recreating partitions does not remove data. only by writing over existing data can you get rid of it (like nullifier does)
Click to expand...
Click to collapse
He states in OP that it doesn't write anything, therefor doesn't "nullify". It formats and partitions.

dodgefan67 said:
so this tool DOES format and nullify in addition to recreating the partitions?
deleting and recreating partitions does not remove data. only by writing over existing data can you get rid of it (like nullifier does)
Click to expand...
Click to collapse
Actually you are right. Deleting, recreating and formatting partitions does not get did of the 1s and 0s, so in that sense the data is still there. However the pointers are gone, and hence even though the data is still there it can't be accessed without effort.
What do you think the nand has on it when the device is shipped... I can assure you its not ask zeroes!
Sent from my LG-P999 using XDA

mansa_noob said:
Actually you are right. Deleting, recreating and formatting partitions does not get did of the 1s and 0s, so in that sense the data is still there. However the pointers are gone, and hence even though the data is still there it can't be accessed without effort.
What do you think the nand has on it when the device is shipped... I can assure you its not ask zeroes!
Sent from my LG-P999 using XDA
Click to expand...
Click to collapse
Well no, it has a next to worthless version of android Also, the point he was trying to get across is that it would be better for you to present the script for what it is and not try to compare it to other scripts that do something entirely different. You do kind of imply that you accomplish the same thing as the Nullifier script and more, when in fact you simply do something different.
Some may and probably will prefer your script, at least for specific purposes, while others will prefer the Nullifier script.

MWBehr said:
Well no, it has a next to worthless version of android Also, the point he was trying to get across is that it would be better for you to present the script for what it is and not try to compare it to other scripts that do something entirely different. You do kind of imply that you accomplish the same thing as the Nullifier script and more, when in fact you simply do something different.
Some may and probably will prefer your script, at least for specific purposes, while others will prefer the Nullifier script.
Click to expand...
Click to collapse
Done. OP updated to reflect. Thanks for clarifying that. It was not my intention to state that this tool does anything any other does, or does not.
I think we are all trying to do the same thing... get rid of the issues when swapping ROMs like _____. I can't seem to think of a good analogy here .

thanks for clarifying the OP, that makes much more sense
and no i wasnt trying to say you were reinenting the wheel, just trying to understand what your tool is actually doing
and also i do understand that it would take effort to get data off any type of storage device once the partition has been erased. i deal with wiping hard drives in a data center all the time. we use a DOD wipe tool that writes 1s and 0s over a drive a minimum of three full times to eradicate the data
but with this tool doing it outside of CWM, it sounds like it may do a better job of it
but i must ask, why do you need to push CWM? what if i have a newer version of it already on my phone?

dodgefan67 said:
but i must ask, why do you need to push CWM? what if i have a newer version of it already on my phone?
Click to expand...
Click to collapse
There is no need to push CWM 5.02. As I said in the OP it is a mod of the script found in the reference. In that script it was pushing default recovery. Since the recovery partition is being overwritten as well you will loose existing one and you need a recovery to be able to push a new ROM. Hence the need to push recovery (instead of using super one click).
As long as the recovery is not bigger than the partition that holds it we should be able to push a newer version. However I can't leave it empty or people will look for me with a shotgun (myself included ).

dodgefan67 said:
but i must ask, why do you need to push CWM? what if i have a newer version of it already on my phone?
Click to expand...
Click to collapse
I was thinking the same thing but seems easy enough .. add the cwm img to the dir and edit the .cfg file. Hopefully that should get the new CWM flashed

So would it be benefitial or pointless to nullify to clear the data then run this script for a... super clean?
Sent from my LG-P999 using XDA

mansa_noob said:
There is no need to push CWM 5.02. As I said in the OP it is a mod of the script found in the reference. In that script it was pushing default recovery. Since the recovery partition is being overwritten as well you will loose existing one and you need a recovery to be able to push a new ROM. Hence the need to push recovery (instead of using super one click).
As long as the recovery is not bigger than the partition that holds it we should be able to push a newer version. However I can't leave it empty or people will look for me with a shotgun (myself included ).
Click to expand...
Click to collapse
ahhhhhh now i understand. my eyes have been opened LOL
---------- Post added at 07:36 PM ---------- Previous post was at 07:35 PM ----------
PL0X_Kleiner said:
So would it be benefitial or pointless to nullify to clear the data then run this script for a... super clean?
Sent from my LG-P999 using XDA
Click to expand...
Click to collapse
i think it would be pointless unless you are super paranoid

dodgefan67 said:
ahhhhhh now i understand. my eyes have been opened LOL
---------- Post added at 07:36 PM ---------- Previous post was at 07:35 PM ----------
i think it would be pointless unless you are super paranoid
Click to expand...
Click to collapse
Nobody is twisting any arms here... Use it if you want to, don't if you don't want to.
I saw benefit so posted so that others may benefit as well.
Sent from my LG-P999 using XDA

Ok so question, why are you killing all the data on your internal SD card? Why not just the individual partitions that the phone uses? Your destroying data that don't need to be destroyed before flashing a rom...
Sent from my LG-P999 using xda premium

It does not have to be destroyed. I just haven't had a chance to test without recreating emmc yet.
Next step. Likely tomorrow. Would like to test before release.
Sent from my LG-P999 using XDA
[edit] BTW, I do want to restate that there is some data that needs to be destroyed which is not being taken care of by other methods. I don't believe it is in the emmc, but rather it resides in one of the other partitions. Most methods out there are only working in the /data, /system and /cache domain.
My original problem (bluetooth disconnect) which happens to be a problem for some in the community even now was only completely fixed by this method.

Related

[GT-P6200][CWMRecovery][ROOT]ClockworkMod Recovery and Root

****** USE AT YOUR OWN RISK *******
This is NOT SUPPORTED SOFTWARE. This is purely for my amusement and entertainment. I'm making it available to download for those who might like to examine my work, but if you install it, you are on your own. I can't even test this myself. (I don't have a GT-P6200.)
Seriously - this has not been tested enough for me to be happy with it, and I'm unable to test it myself. Please read the thread for the GT-P6210 for instructions, known issues, warnings, etc.
If you do decide to install this anyway, please let me know how it works out for you. If no one is using it, I WILL NOT MAINTAIN IT AND WILL DROP IT.
If people do start using it, and the reports are that everything is working okay, then it'll get merged into what I'm already doing with the other two 7 plus models (meaning it'll get updated as needed when they do.)
Again, PLEASE READ the thread for the 6210 for everything you need to know: http://forum.xda-developers.com/showthread.php?t=1379532
..and here's a link for a CWM recovery.
Link: http://www.mediafire.com/download.php?do5jkna3dpas1tq
Take care
Gary
Hi! I'm a placeholder.
garyd9 said:
Hi! I'm a placeholder.
Click to expand...
Click to collapse
Hi, Placeholder. I'm a placeholder, too. Good meeting you here.
Pm'ed you. went straight in CWM, looks nice. able to make a full backup and md5. fails to restore in the middle of restoring /data
also getting UDIDs are inconsistent , fixing permission is supposed to take care of this.
and Im pretty much factory reset after reboot.
EDIT: appears as if Location cache map app by remy in market I had set to block wifi and cell caches. restoring a backup in CWM got permissions error, trestoring /data fails and Im left with pretty much a factory reset. went back to market and reinstalled suspicious app, installed and still says caches blocked removed app, rebooted, made back up and successful restore! woo hoo! Thank You Gary!
Note: should we make a note for 7+ CWM users beware blocked location caches, or re-write recovery to take care of this, and/or email the app dev?
anyways, pretty excited. Thanks so much Gary.
Anyone else want to help test the CWM Recovery for this tablet? (GT-P6200 only)
The current tester has had mixed results, but it _may_ have been the result of a third party app causing problems. I'd like to get someone else to test in addition to ensure there aren't any other issues.
In order to test, I need someone who has "adb" installed on their PC, is comfortable with linux commands, already knows how to use adb for commands such as "adb shell, adb push, and adb pull", doesn't mind using ODIN to restore their tablet to a factory state if it soft-bricks, and already knows how to use ODIN and CWM Recovery.
As a side-note; the third party app that MIGHT have been causing the problem is "Location Cache" by "remydemy." I don't use this app myself, but apparently it has some function to block the google/android location caches and it appears to do that by messing with the permissions on the files... which is somehow causing an error when the recovery tries to clean the /data directory in order to restore.
Thanks
Gary
link posted for testing.
thanks again gary loving it.
when I select wipe dalvik cache in CWM options it says dalvik cache wiped awfully fast. and after reboot and removing some bloatware.apks there are still loads of .dex files in /data/dalvik-cache including bloat that i removed.
So i just used root ecplorer to delete entire contents of folder. : )
is this not linked properly or CWM issue, or is this normal function?
thanks so much for your help.
chrisrotolo said:
when I select wipe dalvik cache in CWM options it says dalvik cache wiped awfully fast. and after reboot and removing some bloatware.apks there are still loads of .dex files in /data/dalvik-cache including bloat that i removed.
Click to expand...
Click to collapse
I'll look into it. Please try this alternative to test that function: Boot your phone normally, and then reboot into recovery. Using the recovery menu, mount the /data partition. Then use 'adb shell' to shell into the device and manually look in the /data/dalvik-cache directory. Then "cd /" and from within recovery choose the advanced->wipe dalvik-cache. Then look in /data/dalvik-cache directory again to see if it did what it should have done.
It's possible, based on the ordering of your above description, that the dalvik cache rebuilt after you wiped it (during the reboot) but before you removed your bloatware.
Take care
Gary
thank you. Gary tried not to get Banned OK? we need you buddy. lol
chrisrotolo said:
thank you. Gary tried not to get Banned OK? we need you buddy. lol
Click to expand...
Click to collapse
Where you able to run those tests yet?
thanks
Gary
not as of yet, sometime today though.
---------- Post added at 03:13 PM ---------- Previous post was at 02:23 PM ----------
so yeah, you must be right. dalvik-cache was full with /data mounted. cd / then wiped dalvik from CWM, which finishes in a split second; a list (ls) shows no dalvik-cache folder after wiping, completly gone.
Answers my question.
One other issue I ran into, that you're may be aware of is somehow I disabled the power button in CWM, it said something about back button disabled. I think I had to hold power for 10 sec. to reset device.
Thanks.
chrisrotolo said:
...somehow I disabled the power button in CWM, it said something about back button disabled.
Click to expand...
Click to collapse
That one I'm not sure of and really can't help much with. No 'power' button means you can't select anything which would really be annoying.
it works great! instant root and cwm within 2 minutes! i highly recommend gary's method than the other one. i also don't seem to lose root access by clearing ram memory. SWEET.
Not working:
- format internal sd-card
- update CSC
- installing pre-apps
how to remove CWMRecovery and install stock recovery?
lvsw said:
Not working:
- format internal sd-card
- update CSC
- installing pre-apps
how to remove CWMRecovery and install stock recovery?
Click to expand...
Click to collapse
formatting the internal SDCard isn't going to happen with this version of CWM (that's designed for GB.) Honeycomb devices don't have a seperate /sdcard partition to format. Formatting the "internal sdcard" can be done from within the settings menu via a factory reset.
The other two items aren't broken - they simply don't exist in CWM recovery, and probably never will... Is having the pre-loaded samsgung sample video and music files repushed to your device over and over actually more important to you than the ability to do a nandroid backup? Do you even know what the CSC is that isn't being updated?
Have you bothered to seach around BEFORE installing this? Have you bothered to search around AFTER installing it to find out how to restore to factory?
I'm NOT going to answer your specific question on the basis that it's been answered already and I honestly feel that a user of XDA needs to have the ability to SEARCH before posting.
Take care
Gary
worked like a charm...backup and restore works perfectly...
thanks gary !!!
Hey Gary-
Question -
Is it possible to get ROM manager to recognize the recovery flashed here? I'd like to flash the new version of CWM, which claims to fix the internal SD card problem, but when I install ROM Manager it doesn't recognize that I have CWM flashed.
I could just flash a new recovery from ROM Manager, but I don't want to screw anything up.
Thanks!
Sent from my Galaxy Tab Plus using Tapatalk
jeffcavicchi said:
Is it possible to get ROM manager to recognize the recovery flashed here? I'd like to flash the new version of CWM, which claims to fix the internal SD card problem, but when I install ROM Manager it doesn't recognize that I have CWM flashed.
Click to expand...
Click to collapse
This recovery is CWM Based - it is not an official ROM Manager supported recovery. I have no idea what "internal SD card problem" you are referring to, as I had internal sd card issues resolved with this CWM-based recovery before I posted it (there's only a single version for the P6200.)
I'd actually advise against using the "ROM Manager" program on this device. It's not a supported device, and things can go terribly wrong when messing with recovery and firmware partitions that aren't explicitly supported.
Take care
Gary
garyd9 said:
This recovery is CWM Based - it is not an official ROM Manager supported recovery. I have no idea what "internal SD card problem" you are referring to, as I had internal sd card issues resolved with this CWM-based recovery before I posted it (there's only a single version for the P6200.)
I'd actually advise against using the "ROM Manager" program on this device. It's not a supported device, and things can go terribly wrong when messing with recovery and firmware partitions that aren't explicitly supported.
Take care
Gary
Click to expand...
Click to collapse
Got it - sort of what I figured.
Am I wrong that Recovery still sees the external SD card as an internal SD card? I thought the last time I flashed a zip (boot animation) Recovery showed it as being on the internal card, even though it was actually on the external card. I could be wrong, though - and I don't have the device in front of me to check.
Not a big deal either way - thanks for the response, and your hard work!
*Edit*
Just realized I posted this in the wrong thread like an idiot - I have a P6210. guess that's what happens when you start posting things bc (before coffee).

[RECOVERY]CWM-Based Recovery 5.0.2.8 For P999(Internal & External SD)

The image was provided by Mr Rusty over on the P990 thread and i asked him if we can have an update..well he gladly helped out so don't forget to thank Mr Rusty over on his Thread..
I repacked and added a script that you will just run in order to flash this CWM version..(Thanks to Russ for the script)
From his Thread:
By request a quick explanation of the difference between the two recoveries:
Usually, your recovery image will look on the external SD card for ROMs to flash, and backups to restore, and the external version here is no different. For the most part that is fine and dandy (unless you don't have an SD card I guess), however the stock O2X mounts it's internal SD card as /sdcard, which confuses ROM Manager a fair bit.
The internal version of the recovery mounts the internal storage as /sdcard as well, so ROM Manager can find backups it's made etc.
NOTE: Backups made with v5 are not compatible with earlier versions.
Click to expand...
Click to collapse
BIG Credits goes to Koush as well for his great work for innovating the CWM..
Get it Here: CWM 5.0.2.8 For P999 or from Here
Instructions on HOW to use/WHAT to do:(For Windows)
- Once you have downloaded the Package from the link Above..extract it to a Folder..
- Inside the folder all you have to do is look for the flash-recovery_xp.bat file..
- now turn your G2x OFF..
- remove the BATTERY and make sure your G2x is not connected to the PC via USB
- Press the VOLUME DOWN button together with the VOLUME UP..
- now CONNECT the USB Cable..
- If by all means Windows prompts for a new DEVICE you have to install the APX drivers from here(extract the package and manually install from this source)..
- Else if windows does not prompt OR you are already done installing the APX drivers you can now proceed on Running the flash-recovery_xp.bat by double clicking it..
- Choose 1 and Then press Enter..Wait for a few seconds till it prompts you that the FLASH was successful..IMHO you ought to wait another 5 more seconds after the prompt for not to have issues..
- After that Reboot into CWM by Pressing Power Button together with VOLUME DOWN til you see the LG Logo with waves..upon seeing that now release the buttons and wait for the CWM menu..
For Linux/Ubuntu Users:
- Download the Package
- Extract the folder somewhere
- Now turn your Phone OFF and DO NOT plug the USB cable yet..
- Now while Phone is OFF press VOLUME UP and DOWN together and now PLUG the USB cable in..keep them held together throughout the process..
- Run the Terminal and locate the Directory on where the Files are located..
- Type the ff:
Code:
chmod +x flash-recovery.sh
./flash-recovery.sh
- Once DONE you can now reboot..
FAQ:
Q: I am getting NVflash errors?
A: You might be on a BAD Cable or either way upon installing the drivers do a reboot..also DO THIS ON WINDOWS XP..on Windows 7 there are circumstances that the device is not recognized properly..also make SURE your unit is a P999 or P999DW(my unit is P999DW and touch WORKS!!) and not P990 or SU660..
Q: My device is not Recognized?
A: You have to download the APX drivers from one of the instructions above
Changelog: Github Source
Thanks and also vote for the page..
Seems the Chinese are on to this files too..lolz..
Thank you!! It flashed perfectly, no issues here.
Troy.
thegreenfamily04 said:
Thank you!! It flashed perfectly, no issues here.
Troy.
Click to expand...
Click to collapse
Glad it worked??
So internal and external mounting are all fine with this one?
Sent from my LG-P999 using xda premium
Wow thanks man. I may have to ask a out posting the CWM touch to the G2x.
Sent from my LG-P999 using xda premium
Just flashed it with no problems , when are we getting the touch CWM? Now that will look sexy
thy for your work. coming from ClockworkMod 5.0.2.0 what are the differences / improvements? could someone explain please?
thanks in advance
Just an update: I flashed a MIUI rom (Look in my sig) used the "Nullifier 2.0" (Double wipe) and flashed the current Trinity Kernel all with no issues
Phone is running GREAT now! Thank you once again
Troy.
Волк said:
Wow thanks man. I may have to ask a out posting the CWM touch to the G2x.
Sent from my LG-P999 using xda premium
Click to expand...
Click to collapse
I was thinking the exact same thing. Seems strange to me that Koush made it for the O2x and not for us.
Im getting a nvflash error when trying to install the new clockwork.
It says check apx driver and usb cable. The drivers are already installed so Im thinking its the usb cable, but not sure.
MWBehr said:
I was thinking the exact same thing. Seems strange to me that Koush made it for the O2x and not for us.
Click to expand...
Click to collapse
the recovery's on a different partition, might make it a pain in the ass to access the touch drivers...
or he might just like the o2x more (everyone likes those Europeans more than us anymore)
Touch Recovery
I'm just gonna throw this out there, just because I wanted to try, I flashed the O2x Touch Recovery to my G2x. Everything as far as the application goes worked, touch to select, ect. The only problem is when you ask it to do something, the mounts are wrong, naturally. What I'm getting at is that both devices use cwm 5020, obviously, mounts changed. How hard would it be to decompile both versions of 5020 and apply the differences to the new touch recovery app?
p.s. for those who wonder how I flashed touch to my G2x, I just swapped out the recovery images in the one-click nvflasher, pretty simple. when you're done, put back correct file, nvflash again.
mustangtim49 said:
I'm just gonna throw this out there, just because I wanted to try, I flashed the O2x Touch Recovery to my G2x. Everything as far as the application goes worked, touch to select, ect. The only problem is when you ask it to do something, the mounts are wrong, naturally. What I'm getting at is that both devices use cwm 5020, obviously, mounts changed. How hard would it be to decompile both versions of 5020 and apply the differences to the new touch recovery app?
p.s. for those who wonder how I flashed touch to my G2x, I just swapped out the recovery images in the one-click nvflasher, pretty simple. when you're done, put back correct file, nvflash again.
Click to expand...
Click to collapse
It's all in the ram disk. Just swap out the vold.fstab in the ram disk. Recovery images are simply boot.imgs.
Interesting, because the differences are only 1 partition. And using the O2x CWM to wipe /system (iirc) would just wipe our internal SD. Ours is partition 7 theirs is partition 8, our partition 8 is the internal SD. Since the phones are 99% the same, it should be that simple. and I need to get up early... I do have one untested tool for decompiling a boot.img....
@Kairi: Can you mirror this on Dropbox? Or somewhere not blocked by my work? Wifi at home is down and I am just chewing away at my data with having to tether.
Волк said:
Interesting, because the differences are only 1 partition. And using the O2x CWM to wipe /system (iirc) would just wipe our internal SD. Ours is partition 7 theirs is partition 8, our partition 8 is the internal SD. Since the phones are 99% the same, it should be that simple. and I need to get up early... I do have one untested tool for decompiling a boot.img....
@Kairi: Can you mirror this on Dropbox? Or somewhere not blocked by my work? Wifi at home is down and I am just chewing away at my data with having to tether.
Click to expand...
Click to collapse
http://db.tt/rEpbpRfA here you go. Really interested on what you can do with it
Sent from my LG-P999 using Tapatalk
Волк said:
Interesting, because the differences are only 1 partition. And using the O2x CWM to wipe /system (iirc) would just wipe our internal SD. Ours is partition 7 theirs is partition 8, our partition 8 is the internal SD. Since the phones are 99% the same, it should be that simple. and I need to get up early... I do have one untested tool for decompiling a boot.img....
@Kairi: Can you mirror this on Dropbox? Or somewhere not blocked by my work? Wifi at home is down and I am just chewing away at my data with having to tether.
Click to expand...
Click to collapse
that might work. Id try it out myself if i didn't f up my Linux install...
Nvidia graphics got the best of me there too
Sent from my LG-P999 using Tapatalk
Works as advertised! Thanks!
works great! thanks!
So, my idea worked? I'm not at home and since I'm a collision tech by trade, my boss don't like me playing with my phone. Volk, if you read this pm me and fill me in if you can. Thanks brother.
[email protected]

How to replace one file when failing to boot

Hey guys
I screwed up my vold.fstab trying to get "_ExternalSD" back.
Unfortunately! I did not run a nandroid before I made the change.
Now, I can dirty flash my rom on top, or go back to a nandroid from a few days ago, but I'd really just like to recover and go on my merry way. And maybe learn something in the process.
Only thing is, I can't figure out how to access the phone other than the External SD card through CWM.
Can I mount the internal /system and access through USB? Is there some facility to copy a file from one point to another? Any other methods? I guess the phone has to be up to run ADB, right?
I don't know how to generate a flashable zip but I could extract the original version of the file from the original rom. I assume that its non trivial to create a flashable zip, but maybe someone can comment? It looks like there is signing and certificates involved..
thanks for any ideas
bluenote73 said:
Hey guys
I screwed up my vold.fstab trying to get "_ExternalSD" back.
Unfortunately! I did not run a nandroid before I made the change.
Now, I can dirty flash my rom on top, or go back to a nandroid from a few days ago, but I'd really just like to recover and go on my merry way. And maybe learn something in the process.
Only thing is, I can't figure out how to access the phone other than the External SD card through CWM.
Can I mount the internal /system and access through USB? Is there some facility to copy a file from one point to another? Any other methods? I guess the phone has to be up to run ADB, right?
I don't know how to generate a flashable zip but I could extract the original version of the file from the original rom. I assume that its non trivial to create a flashable zip, but maybe someone can comment? It looks like there is signing and certificates involved..
thanks for any ideas
Click to expand...
Click to collapse
this is why i hate it when people make those guides.
messing with the vold.fstab is dangerous (even though its only a few lines) if your trying to recover your data, give up. its not going to happen. (sorry)
when you edit the vold.fstab it messed up the partitions on your internal SD card and most likely did the equivalent of wiped your /system partition. (or another important one.) your actually lucky it did not completely brick your phone.
your post was a little vague, but if you can, just restore an older nandroid, or wipe everything and install another ROM. (you can try dirty flashing but i dont think itll work)
if you cannot access CWM, then follow the steps in This guide. it should get you back up on your feet. after you follow that guide flash a gingerbread ROM (any gingerbread rom will do fine) then you can reboot and flash any ROM you want. (it needs this to fix a quirk in that script)
Hope you get it fixed
EDIT: re read your post, if your feeling adventurous and want to give it a shot, boot into CWM and connect it via usb. you can now get into an ADB shell on your phone by typing 'adb shell' if you have adb all setup and working. (im working from memory here so dont quote me on any of this)
now, you should be able to access your /system folder from that shell. be very careful though, i dont have much experience right here, and if i remember correctly you might not be in the full root directory yet)
if you can get into it try replacing your vold.fstab with a stock one,
if you dont have a stock one lying around, make a nandroid of the current state of the rom, then flash another rom, pull the vold.fstab, then re-restore back to the broken one and restore it (id upload mine but my phone is OOC right now )
after that just reboot and hope it resolves itself, if not then just follow my advice above
and keep that guide i linked to handy, messing around in CWM has the ability to brick your phone, if it does, then just follow that guide.
Klathmon said:
this is why i hate it when people make those guides.
messing with the vold.fstab is dangerous (even though its only a few lines) if your trying to recover your data, give up. its not going to happen. (sorry)
when you edit the vold.fstab it messed up the partitions on your internal SD card and most likely did the equivalent of wiped your /system partition. (or another important one.) your actually lucky it did not completely brick your phone.
your post was a little vague, but if you can, just restore an older nandroid, or wipe everything and install another ROM.
if you cannot access CWM, then follow the steps in This guide. it should get you back up on your feet. after you follow that guide flash a gingerbread ROM (any gingerbread rom will do fine) then you can reboot and flash any ROM you want. (it needs this to fix a quirk in that script)
Hope you get it fixed
Click to expand...
Click to collapse
How bout adb and pushing the file back in? Or cant you access the phone via adb?
Sent from my LG-P970 using XDA
N00BY0815 said:
How bout adb and pushing the file back in? Or cant you access the phone via adb?
Sent from my LG-P970 using XDA
Click to expand...
Click to collapse
re read your post and updated my last post right after you posted
after dealing with noobies all day, i forget sometimes people want to try big things
Thanks guys. The info I was missing was there's no special trick to attaching adb while in CWM! Just plug in!
My phone is back up and running and partitions are fine as far as I can see after just booting up.
Hi there! I messed up with the vold.fstab filfe on my tablet – I replaced it with a downloaded file with the intention to transfer apps to my external SD card.
Now my tablet is only showing the startup logo and won’t continue loading. I can access recovery mode. Now I want to restore the original vold.fstab file.
My questions:
1. Using the Android SDK, the file explorer does not show any files, though my tablet is recognized.
2. Using adb push, it yields an error: permission denied, how to successfully push the original vold.fstab and replace the existing vold.fstab?
3. If I dump an image of my tablet and edit the dumped image, would this be easier compared to the steps above?
Thanks!
http://forum.xda-developers.com/showthread.php?t=1646108
Try this.
If this doesn't help you should ask in the section for your tablet to get more specific advice.
TwitchyEye said:
http://forum.xda-developers.com/showthread.php?t=1646108
Try this.
If this doesn't help you should ask in the section for your tablet to get more specific advice.
Click to expand...
Click to collapse
Thanks, I will try it later when I got home. My tablet is not found here. I have a Skyworth S71(3G) with RK3066 chipset.
BryanF said:
Thanks, I will try it later when I got home. My tablet is not found here. I have a Skyworth S71(3G) with RK3066 chipset.
Click to expand...
Click to collapse
You need to do an adb remount before you can push. Was it rooted before?
-- The noob says:
This just in... my IQ has increased 50 points thanks to the g2x!
Mansa_noob, yes, my tablet is rooted. I followed some instructions about adb but had an error saying access denied, and also no files are displayed at file explorer. See my posts above. I also mounted it successfully. I will post some sreenshots later.
Please if you have some instructions, I am willing to try.
---------- Post added at 07:06 AM ---------- Previous post was at 07:02 AM ----------
TwitchyEye said:
http://forum.xda-developers.com/showthread.php?t=1646108
Try this.
If this doesn't help you should ask in the section for your tablet to get more specific advice.
Click to expand...
Click to collapse
Hi twitchyEye, it did not work. It attemps to install (using the install update from ext sd card) but then says installation aborted.
Any more suggestions? Thanks
What recovery are you using? I suck with adb so I got nothing on that front.
It was the stock recovery from my Tablet. I don't have it on hand right now, I will post later. The chipset is RK3066. My problem is my tablet has no official support on the internet (maybe becaue it's still new). Model is Skyworth S71(3G).
I see. Yeah this is over my head man. I thought for sure you were running a custom recovery and it was an easy answer. I'm actually struggling right now with adb myself with a similar issue something about permissions whenever I try to do anything to my phone. So I guess right now would be a perfect time for somebody to chime in with a smarter answer!
TwitchyEye said:
I see. Yeah this is over my head man. I thought for sure you were running a custom recovery and it was an easy answer. I'm actually struggling right now with adb myself with a similar issue something about permissions whenever I try to do anything to my phone. So I guess right now would be a perfect time for somebody to chime in with a smarter answer!
Click to expand...
Click to collapse
Are you doing adb remount and still getting permission denied?
-- The noob says:
This just in... my IQ has increased 50 points thanks to the g2x!
mansa_noob said:
Are you doing adb remount and still getting permission denied?
-- The noob says:
This just in... my IQ has increased 50 points thanks to the g2x!
Click to expand...
Click to collapse
Yes, I did adb remount and still access denied
BryanF said:
Yes, I did adb remount and still access denied
Click to expand...
Click to collapse
This is strange. A properly rooted phone would adb remount to r/w system. Something is fishy. Is it rooted+
-- The noob says:
This just in... my IQ has increased 50 points thanks to the g2x!
mansa_noob said:
This is strange. A properly rooted phone would adb remount to r/w system. Something is fishy. Is it rooted+
-- The noob says:
This just in... my IQ has increased 50 points thanks to the g2x!
Click to expand...
Click to collapse
I am sure it is rooted, because I downloaded an application from Google play to check it it is rooted or not. It is really rooted. I alvo confirmed this as I can now fully backup and restore my apps using Titanium backup before the tablet is messed up.
BryanF said:
I am sure it is rooted, because I downloaded an application from Google play to check it it is rooted or not. It is really rooted. I alvo confirmed this as I can now fully backup and restore my apps using Titanium backup before the tablet is messed up.
Click to expand...
Click to collapse
OK. Odd or not, it is what it is. Is it possible for you to load a custom recovery?
-- The noob says:
This just in... my IQ has increased 50 points thanks to the g2x!
mansa_noob said:
OK. Odd or not, it is what it is. Is it possible for you to load a custom recovery?
-- The noob says:
This just in... my IQ has increased 50 points thanks to the g2x!
Click to expand...
Click to collapse
I want to try, but the stock recovery is my last hold as I have no stock ROM. If I overwrite the stock ROM, I cannot reinstall it as I don't have a copy of it.
So why not flash cwm with nvflash and then make a backup of your current stock rom? I did exactly that.
Sent from my LG-P999 using xda premium

New Builder Question

This should probably go in some general Q&A forum, but this is by far the most helpful community I've come across so I wanted to try here first. I've finally got my Ubuntu box up and running again (upgrading to 14.04 wasn't pretty) and was able to build for both my 700t and my n5 without error, but I'm afraid to pull the trigger and flash it. I'm building straight CM for the tablet and AOSP for the phone, so what is the worst that could happen? I haven't gotten either of them to run in the emulator, but I'm not completely sure that is even possible. Any insight you may have would be most appreciated.
Thanks in advance!
Just thought of this, since I'm running Crombi ROM2SD, could I just install my zip on external, and then refresh the right kernel?
Sent from my ASUS Transformer Pad TF700T using Tapatalk
psudeke said:
but I'm afraid to pull the trigger and flash it. I'm building straight CM for the tablet and AOSP for the phone, so what is the worst that could happen?
Click to expand...
Click to collapse
The worst thing that can happen is that you brick your device, but you must do something sufficiently stupid for that to happen. I can't say anything about your phone, but for the TF700T, as long as you have a working recovery, flashing a ROM won't brick it. You may want to create the nvflash blobs if you want to have another safety net - it is possible to brick the TF700T if you force it to boot to the recovery and the recovery is broken.
psudeke said:
I haven't gotten either of them to run in the emulator, but I'm not completely sure that is even possible.
Click to expand...
Click to collapse
That's normal - ARM devices are just too different, and the emulator is just another different device.
psudeke said:
Just thought of this, since I'm running Crombi ROM2SD, could I just install my zip on external, and then refresh the right kernel?
Click to expand...
Click to collapse
See my Android dual-booting thread in the dev subforum. I originally developed ROM2SD to be able to test my self-built ROMs without breaking my working installation.
_that said:
The worst thing that can happen is that you brick your device, but you must do something sufficiently stupid for that to happen. I can't say anything about your phone, but for the TF700T, as long as you have a working recovery, flashing a ROM won't brick it. You may want to create the nvflash blobs if you want to have another safety net - it is possible to brick the TF700T if you force it to boot to the recovery and the recovery is broken.
That's normal - ARM devices are just too different, and the emulator is just another different device.
See my Android dual-booting thread in the dev subforum. I originally developed ROM2SD to be able to test my self-built ROMs without breaking my working installation.
Click to expand...
Click to collapse
Thanks _That, I appreciate your help! After reading your post and the f2fs post, i thought i was in the clear, but i still managed to screw something up. i'm unable to get the tablet to boot off of external, regardless of whether its my ROM or CROMBi. I see a "segmentation error" listed in the output from the the preinit, and then it always boots to internal. I thought maybe i got the mount points reversed in recovered, so i reflashed recovery, but no luck. i also tried deleting the preinit script and then reinstalling CROMBi, but i still get the same error. any thoughts?
psudeke said:
I see a "segmentation error" listed in the output from the the preinit
Click to expand...
Click to collapse
For some unknown reason, dynamically linked executables don't work for preinit in KitKat. So if your *internal* ROM is not stock 4.2-based (I have no data about 4.3), the only way to run a preinit script is to use a statically linked busybox.
You still get that fault with a static busybox but it seems to copy files fine.
@psudeke you can compile the static busybox yourself simply with make static-busybox in your build folder - or just steal mine from /system/boot
sbdags said:
You still get that fault with a static busybox but it seems to copy files fine.
Click to expand...
Click to collapse
Your fault may come from one of the programs that you call in your script (did you forget to prefix some line with "busybox"?).
_that said:
Your fault may come from one of the programs that you call in your script (did you forget to prefix some line with "busybox"?).
Click to expand...
Click to collapse
it comes from the ls -l /init* which indeed doesn't have the busybox prefix but if I do it gives some other error I forget now
Anyway it doesn't harm the boot process - just an error message
_that said:
For some unknown reason, dynamically linked executables don't work for preinit in KitKat. So if your *internal* ROM is not stock 4.2-based (I have no data about 4.3), the only way to run a preinit script is to use a statically linked busybox.
Click to expand...
Click to collapse
_that said:
Your fault may come from one of the programs that you call in your script (did you forget to prefix some line with "busybox"?).
Click to expand...
Click to collapse
Internal is the 5/17 build of Crombi, and its a brand new install. with a full format of the data partition (which in my haste to get this working yesterday, i wiped out my nandroid from right before i tried this).
is there any connection between when the internal is flashed compared to the external? in other words, if i reflash the internal rom, it should still recognize an existing external rom? hope that makes sense, i'm still shaking off the effects of a little too much whiskey last night.:laugh:
psudeke said:
Internal is the 5/17 build of Crombi, and its a brand new install. with a full format of the data partition (which in my haste to get this working yesterday, i wiped out my nandroid from right before i tried this).
is there any connection between when the internal is flashed compared to the external? in other words, if i reflash the internal rom, it should still recognize an existing external rom? hope that makes sense, i'm still shaking off the effects of a little too much whiskey last night.:laugh:
Click to expand...
Click to collapse
No currently if you reflash internal it will only see internal. You need to reflash external for that to work.
sbdags said:
No currently if you reflash internal it will only see internal. You need to reflash external for that to work.
Click to expand...
Click to collapse
Ahh, thanks sbdags! that fixed the issue with ROM2SD. i got that impression when i pulled the preinit and saw it only had an entry for internal. but, i'm still very much in a learning phase so i didn't want to jump to a conclusion.
and after getting crombi to boot on external, i swapped sd cards and my build of CM11 actually booted! now the real learning process begins as i figure out how to customize it.
Thanks again to both you and @_that, you guys are the best:good:
@sbdags and @_that
Just wanted to thank you both again for your help. After much trial and error, i was able to build the 5/27 version of CM and merge in that's 9 f2fs kernel, its running well so far. not a bad quadrant score for someone who doesn't know what they're doing!
https://www.dropbox.com/s/khq17h04b715eyd/C11%20Benchmark%20ART.png
Hats off to both of you! :good:
--- Guess I can't insert an image directly from my DropBox, link is to a screenshot of my score ---
psudeke said:
After much trial and error, i was able to build the 5/27 version of CM and merge in that's 9 f2fs kernel, its running well so far. not a bad quadrant score for someone who doesn't know what they're doing!
Click to expand...
Click to collapse
Congratulations! If you can build a working ROM from source, you're already in the top 1% of people here who know what they're doing.
_that said:
Congratulations! If you can build a working ROM from source, you're already in the top 1% of people here who know what they're doing.
Click to expand...
Click to collapse
Good to finally be a "One Percenter" in something! :laugh:
Thanks again for your help, I'm sure that was the first of many questions I can't figure out.
psudeke said:
Good to finally be a "One Percenter" in something! :laugh:
Thanks again for your help, I'm sure that was the first of many questions I can't figure out.
Click to expand...
Click to collapse
Just ask away and congrats! :good:
sbdags said:
Just ask away and congrats! :good:
Click to expand...
Click to collapse
Be careful what you wish for, I've got a laundry list of questions ranging from basic Linux commands to the nature of the multiverse, lol.
I do have one question out of the gate about the update-binary file. I'm trying to add a couple apps to either the system or data folders, but I'm not sure what commands are available from the stock CM file. I think for the most part by looking at your updater-script file I can figure out the commands to do what I want, but given the little I know about this and the size difference of the binary file between CM and the one i was looking at of yours, I'm curious. Is the best way to see what's available CM's git? I basically just want to install a different Launcher and Viper instead of DSP manager for sound. Do I need to study up on edify to look at the binary or is there an easier way?
Thanks again!
Sent from my ASUS Transformer Pad TF700T using Tapatalk
psudeke said:
Be careful what you wish for, I've got a laundry list of questions ranging from basic Linux commands to the nature of the multiverse, lol.
I do have one question out of the gate about the update-binary file. I'm trying to add a couple apps to either the system or data folders, but I'm not sure what commands are available from the stock CM file. I think for the most part by looking at your updater-script file I can figure out the commands to do what I want, but given the little I know about this and the size difference of the binary file between CM and the one i was looking at of yours, I'm curious. Is the best way to see what's available CM's git? I basically just want to install a different Launcher and Viper instead of DSP manager for sound. Do I need to study up on edify to look at the binary or is there an easier way?
Thanks again!
Sent from my ASUS Transformer Pad TF700T using Tapatalk
Click to expand...
Click to collapse
yes the easiest way to do it is just make 2 folders with your extra apps in it say /extras/app
then add the following to the updater-script (you don't need to touch the update-binary unless you start using aroma)
package_extract_dir("extras", "/system");
delete("/system/app/DSPManager.apk");
delete("/system/priv-app/Trebuchet.apk");
What that does is copies the extras/app folder into system and deletes your unwanted apps
note apps can be installed into 2 folders /system/app or /system/priv-app
similarly you can install your user apps into /data/app but this is dangerous with launchers as if the user manually uninstalls it you can't do anything on the tab
sbdags said:
yes the easiest way to do it is just make 2 folders with your extra apps in it say /extras/app
then add the following to the updater-script (you don't need to touch the update-binary unless you start using aroma)
package_extract_dir("extras", "/system");
delete("/system/app/DSPManager.apk");
delete("/system/priv-app/Trebuchet.apk");
What that does is copies the extras/app folder into system and deletes you unwanted apps
note apps can be installed into 2 folders /system/app or /systempriv-app
similar you can install your user apps into /data/app but this is dangerous with launchers as if the user manually uninstalls it you can't do anything on the tab
Click to expand...
Click to collapse
Thanks again! i can see how this becomes addicting fast :fingers-crossed:
@sbdags do I need to mount data before installing anything to the /data/app folder? I saw in your updater-script this line, and i'm assuming i need the same:
Code:
mount("f2fs", "EMMC", "/dev/block/mmcblk0p8", "/data");
one other quick question (hopefully), I saw in the XDA WIKI that i can possibly test the script using the update-binary, do i have to do this on the tablet itself? i spent all afternoon trying to fix a problem that amounted to an errant quotation mark in my script (and i knew it was something like that too. too many years of non-terminated string errors to not look there first:laugh, but the only way i could find to test it was to rezip the file and flash. any suggestions?
thank you good sir! :highfive:
psudeke said:
@sbdags do I need to mount data before installing anything to the /data/app folder? I saw in your updater-script this line, and i'm assuming i need the same:
Code:
mount("f2fs", "EMMC", "/dev/block/mmcblk0p8", "/data");
one other quick question (hopefully), I saw in the XDA WIKI that i can possibly test the script using the update-binary, do i have to do this on the tablet itself? i spent all afternoon trying to fix a problem that amounted to an errant quotation mark in my script (and i knew it was something like that too. too many years of non-terminated string errors to not look there first:laugh, but the only way i could find to test it was to rezip the file and flash. any suggestions?
thank you good sir! :highfive:
Click to expand...
Click to collapse
just zip the /meta-inf folder, and flash that to test. obviously comment out any format commands as they will fail. That is what I do.
Hey @psudeke you ever need any help with anything to do with source or git let me know
I am also willing to help out
and just a FYI be careful of @sbdags :cyclops: LOL
Just kidding....
Let me know thx Josh

Possibility to return to STOCK ATT ROM after KDZ flash of PR version?

I'm noticing that FlashFire has the option to backup the system parition file based. I'm wondering if someone who has flashed the PR ROM could simply do a restore of a STOCK ATT system partition backed up this way and if it would work? If anyone wants to try, I can make a backup and upload it and post a link.. Let me know!
petermg said:
I'm noticing that FlashFire has the option to backup the system parition file based. I'm wondering if someone who has flashed the PR ROM could simply do a restore of a STOCK ATT system partition backed up this way and if it would work? If anyone wants to try, I can make a backup and upload it and post a link.. Let me know!
Click to expand...
Click to collapse
Sounds like a hard brick waiting to happen.
uly609 said:
Sounds like a hard brick waiting to happen.
Click to expand...
Click to collapse
Yeah.. probably right. It was real late when I posted that LOL
Actually doing a system restore via file based shouldn't hard brick the phone. Only if it was raw based possibly, but either way it would only be the system position so the kdz/tot would still be able to be flashed to the phone as before. This might work! Or at least be a good base to try.
petermg said:
Actually doing a system restore via file based shouldn't hard brick the phone. Only if it was raw based possibly, but either way it would only be the system position so the kdz/tot would still be able to be flashed to the phone as before. This might work! Or at least be a good base to try.
Click to expand...
Click to collapse
I agree with this theory. It should only flash the system over the system. You would have to make sure the boot loader is correct for the system rom. So say a 10b bootloader for an equivalent 10bPR rom.
(If any of the above is confusing or slightly off, I blame it on the fact I have been battling a bad virus this week with a bad headache.)
I just warrantied my PR rom device a few weeks ago, or else I would have tried this for you.
Edit: You would also have to edit the script in the file to flash to designate the correct partition to flash the system to.
CAG-man said:
I agree with this theory. It should only flash the system over the system. You would have to make sure the boot loader is correct for the system rom. So say a 10b bootloader for an equivalent 10bPR rom.
(If any of the above is confusing or slightly off, I blame it on the fact I have been battling a bad virus this week with a bad headache.)
I just warrantied my PR rom device a few weeks ago, or else I would have tried this for you.
Edit: You would also have to edit the script in the file to flash to designate the correct partition to flash the system to.
Click to expand...
Click to collapse
Unless it just extracts the tar'd files it copied from the system partition of the stock device. Still some ambiguity regarding that app. For example, it shows no option to allow me to make backups on the external SD card...
petermg said:
Unless it just extracts the tar'd files it copied from the system partition of the stock device. Still some ambiguity regarding that app. For example, it shows no option to allow me to make backups on the external SD card...
Click to expand...
Click to collapse
I would think it still needs an address as to where to put the extracted files.
I will look and see if I have any twrp backups on my computer from some of the roms I made. I have never fully looked through and studied the backups as much as I used them for system dumps. It just seems to make since that the recovery would need to know where to write the system files. Just flashing an app is alright without the address.
In writing the flashing script for ROMs, I have always had to give the recovery the address as to where to write the system files or else it would result in a flash failure or soft brick.
I may be writing my scripts wrong too. I just know what works for me.

Categories

Resources