LINK TO THE THREAD WITH THE AUTOMATED SCRIPT (thanks to @skyguy126): http://forum.xda-developers.com/moto-g/general/mod-storage-reloacting-dalvik-cache-t2953616
Hello everybody
as you may know, our Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Well, thanks to @skyguy126, who linked me to this guide, I managed to link the dalvik cache files to the /cache partition
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't :laugh:
b) you're running ART
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Other than that, all you need is a rooted phone, the Terminal Emulator app installed (HERE), a root file manager, at least one hand and a working brain
I TAKE NO RESPONSIBILITY FOR ANY DAMAGE THAT HAPPENS TO YOUR PHONE, CONTINUE AT YOUR OWN RISK.
Steps:
1) Open any text editor, messaging app, notes app or anything that allows a text input. write the following line, select it and copy it to your clipboard (you'll need it later).
Code:
ln -s /cache/dalvik-cache /data/dalvik-cache
Also, make sure you open the Terminal Emulator app and type in "su" (without quotes), then grant it superuser access. You'll need to switch to it quickly.
2) Open your root file manager, while making sure you still see the terminal emulator's notification (I used Root Explorer but any other app should work just fine), go to /data, select the /dalvik-cache folder (just to be sure, hit "properties" to check its size. If it's less than 600Mb you're good to go. If it's not, this won't work, sorry) and move (NOT copy, MOVE) it to /cache. If it asks you to merge two folders, do it.
NOTE: now some apps may start force closing, it's normal, keep going
3) Switch to the Terminal Emulator app (via the recents screen or by tapping its notification" and paste the text you copied at the beginning by long-pressing the black screen and hitting "Paste" (DUH?!?), hit enter, make sure no error messages come up, then reboot.
TA-DAAAA!
Your dalvik cache is now linked to the /cache partition, enjoy that half a gigabyte
If you need any help, feel free to PM me
"But Bert, what if it doesn't work and my phone explodes?"
Well, if it blows up there's nothing much I can do, but if it's just stuck at bootanimation/bootlogo/somewhere where you can't use it, simply head to the recovery and wipe dalvik-cache. This will revert the process and delete the link, putting the phone as it was before
Batch File to Automate the Process!!!
Look at reply #58 for latest information
Old:
Batch file complete, credit goes to @Bert98 for devising a method.
USE THIS COMPLETELY AT YOUR OWN RISK! You may NOT rehost, take credit, or make a paid download without the permission of @skyguy126 or @Bert98
This will only work on windows based computers!
I tested this on my moto g xt1032 16GB running CM11 Nightly and it worked fine.
Click that thanks button if it helped!
How to use:
Step 1: Download the attached file and extract.
Step 2: Double click the cachemove.rbat file and follow the onscreen instructions.
EDIT: THIS IS NOT WORKING ON MOTO G STOCK 4.4.4!!!
I am working on this issue but any help is greatly appreciated!
Common errors:
"adbd root cannot run as root in production builds"
Solution: http://forum.xda-developers.com/showthread.php?t=1687590
Install the app and run it. Enable insecure binary.
Changelog:
v1.1 - Fixed some minor bugs in script.
v1.2 - Added a restore script.
Keep in mind that the /cache partition will be slower as it's a ext4 partition as opposed to f2fs
DustArma said:
Keep in mind that the /cache partition will be slower as it's a ext4 partition as opposed to f2fs
Click to expand...
Click to collapse
/data is a F2FS only on stock ROM, on GPE and other ROMs it's ext4 as well
Inviato dal mio Moto G utilizzando Tapatalk
Bert98 said:
Hello everybody
as you may know, our Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Well, thanks to @skyguy126, who linked me to this guide, I managed to link the dalvik cache files to the /cache partition
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't :laugh:
b) you're running ART
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Other than that, all you need is a rooted phone, the Terminal Emulator app installed (HERE), a root file manager, at least one hand and a working brain
I TAKE NO RESPONSIBILITY FOR ANY DAMAGE THAT HAPPENS TO YOUR PHONE, CONTINUE AT YOUR OWN RISK.
Steps:
1) Open any text editor, messaging app, notes app or anything that allows a text input. write the following line, select it and copy it to your clipboard (you'll need it later).
Code:
ln -s /cache/dalvik-cache /data/dalvik-cache
Also, make sure you open the Terminal Emulator app and type in "su" (without quotes), then grant it superuser access. You'll need to switch to it quickly.
2) Open your root file manager, while making sure you still see the terminal emulator's notification (I used Root Explorer but any other app should work just fine), go to /data, select the /dalvik-cache folder (just to be sure, hit "properties" to check its size. If it's less than 600Mb you're good to go. If it's not, this won't work, sorry) and move (NOT copy, MOVE) it to /cache. If it asks you to merge two folders, do it.
NOTE: now some apps may start force closing, it's normal, keep going
3) Switch to the Terminal Emulator app (via the recents screen or by tapping its notification" and paste the text you copied at the beginning by long-pressing the black screen and hitting "Paste" (DUH?!?), hit enter, make sure no error messages come up, then reboot.
TA-DAAAA!
Your dalvik cache is now linked to the /cache partition, enjoy that half a gigabyte
If you need any help, feel free to PM me
Click to expand...
Click to collapse
Hello! Thnk you for the tip, but, with me, i think, didnt work.
Im stuck in the boot, can you helpme to restore the directories? BTW, i have folloed all the steps like you say, i dont know why not work, im using CRom
Greetings!
KahosTch said:
Hello! Thnk you for the tip, but, with me, i think, didnt work.
Im stuck in the boot, can you helpme to restore the directories? BTW, i have folloed all the steps like you say, i dont know why not work, im using CRom
Greetings!
Click to expand...
Click to collapse
Do you have TWRP on your device?
Inviato dal mio Moto G utilizzando Tapatalk
i have CWM, philz touch.
(any idea why didnt work? :c )
KahosTch said:
Hello! Thnk you for the tip, but, with me, i think, didnt work.
Im stuck in the boot, can you helpme to restore the directories? BTW, i have folloed all the steps like you say, i dont know why not work, im using CRom
Greetings!
Click to expand...
Click to collapse
To get it working just wipe dalvik cache in cwm, it will re-create directory in /data.
I had the same issue..
I will try to investigate what went wrong with this....
fabus said:
To get it working just wipe dalvik cache in cwm, it will re-create directory in /data.
I had the same issue..
I will try to investigate what went wrong with this....
Click to expand...
Click to collapse
jaja Thakyou, that work.:fingers-crossed:
I have found an issue. When you are copying /data/dalvik-cache to /cache/dalvik cache permissions can be mismatched (different partition type).
To fix it just:
- Go to CWM
- Connect phone to PC (should be recongnized as ADB device, if not check in Hardware Manager how it was recongizes)
- issue "ADB shell" command
- in Android shell: chmod 644 /cache/dalvik-cache/*
- reboot and you are done
I have made up an easier way to achive dalvik-cache on /cache partition:
On running android:
- make sure /cache/dalvik-cache folder is empty!!
- Rename /data/dalvik-cache to /data/dalvik-cache2
- ln -s /cache/dalvik-cache /data/dalvik-cache
- reboot and done
Android will recreate dalvik cache in /cache/dalvik-cache dir, it will take about 10 minutes, so be patient
if something goes wrong, just rename /data/dalvik-cache2 by ADB (e.g. in CWM)
I hope if was helpfull.
Cheers,
good work
Thank you for this. I will definitely be doing this.
You should make a batch file that does this whole process automatically. I would be happy to assist!
Guys could some experts code a batch file for this?
I appreciate the guide but terminal codes etc are beyond me.....
600mb is quite a lot of space to gain for an 8gig moto g
Sent from my XT1032 using XDA Free mobile app
AndroidHtc101 said:
Guys could some experts code a batch file for this?
I appreciate the guide but terminal codes etc are beyond me.....
600mb is quite a lot of space to gain for an 8gig moto g
Sent from my XT1032 using XDA Free mobile app
Click to expand...
Click to collapse
It's up to 600mb. It's what ever size your dalvik cache is. I don't think this will work on android 5.0 since the change to art.
Yep I'll work on it... Hopefully it'll work, no promises...
skyguy126 said:
Yep I'll work on it... Hopefully it'll work, no promises...
Click to expand...
Click to collapse
That'd be great, since I know nearly nothing about batch files if you succeed, I'll put it in the OP
Inviato dal mio Moto G utilizzando Tapatalk
Skyguy
I have around 125apps and 500mb free, would installing the batch screw my phone up?
Thanks for helping
Sent from my XT1032 using XDA Free mobile app
AndroidHtc101 said:
Skyguy
I have around 125apps and 500mb free, would installing the batch screw my phone up?
Thanks for helping
Sent from my XT1032 using XDA Free mobile app
Click to expand...
Click to collapse
It depends on your /data/dalvik-cache folder's size, you can check with root explorer
Inviato dal mio Moto G utilizzando Tapatalk
Hi Bert
It's 466.92mb
If I could get 500mb of more free space I would have a gig free which would really help my 8gb moto g
Sent from my XT1032 using XDA Free mobile app
AndroidHtc101 said:
Hi Bert
It's 466.92mb
If I could get 500mb of more free space I would have a gig free which would really help my 8gb moto g
Sent from my XT1032 using XDA Free mobile app
Click to expand...
Click to collapse
Follow the instructions in the OP then, you're good to go
Inviato dal mio Moto G utilizzando Tapatalk
Related
Moving Dalvik-Cache to /cache
Notes:
If you want to move the Dalvik-Cache to /cache you will needed to the following:
1. A Viewpad7 or another branded device (such as: Cherry Mobile Superion, Commtiva Linx N700, Olivepad VT-100, Spice MI700, and Camangi FM600..........)
2. Already got the root permission (For running a set of command)
3. ADB or Terminal Emulator (For running the command)
4. Root Explorer(Optional - if you have a lot of patience for typing)
Steps
1. Build a file call "install-recovery.sh" into the /etc (Path: /etc/install-recovery.sh) With 711 Permission. (Or you can build it in your computer and put it in the sdcard then copy it using Root Explorer.
Code:
#!/system/bin/sh
chmod 771 /cache
2. Move your dalvik-cache and Create Symbolic Link
(You may experience some program FC (Force Close), but never mind)
Code:
mv /data/dalvik-cache /cache/dalvik-cache
ln -s /cache/dalvik-cache /data/dalvik-cache
You've done the action!
If you got a LOT of FC after move the dalvik-cache.
Please go to /(Root) to check the permission of the /cache it may be become 770.
Remarks:
I think it is able to do the same things to a SD Partition or A2SD.
However I have try it. (Because I still haven't install the Custom Recovery.)
If you have any problems. Please leave a message here.
If you want to forward this message. Please provide the source URL in your message.
DISCLAIMER: I cannot be held liable for anything you do to your Viewpad 7 (or equivalent device).
[DISCLAIMER Copy from lakehousetech thanks for your DISCLAIMER.]
Will this still works, after reboot ?
Yes It will be. The install-recovery.sh scripts will be automatically run everytime you boot up the viewpad 7
i found a more efficient method, moving dalvik chache to sd card partitions... using rom manager and link2sd..
wazzzuuuup2 said:
i found a more efficient method, moving dalvik chache to sd card partitions... using rom manager and link2sd..
Click to expand...
Click to collapse
Hah same here And it works great
Could either of you guys who are using ROM Manager/Link2SD provide instructions for how you set that up? Thanks!
Edit, a few days later. Disregard, figured it out on my own. For anyone else interested...
If you're one a Windows based machine, download this, and use it to create an ext2 partition on your SD card. Personally, I copied the contents of the SD over to my computer before I did so, then copied them back after I was done. With link2sd, you can just adjust all the "user" apps to link to the SD, and set it up so it does likewise on install of new apps. Very easy.
Hey Guys whenever i download any apps from market i get the error Install Unsuccessful .... Insufficient storage ...
What to do :-/
Rom Hell Fire v7.2
UOT Kitchen Flashed 1
Overclocked 729 Mhz
Wildfire
delete apps or move some to SD card? If your memory is full it's logical you can't add apps
Sounds to me that a2sd is not properly set up.
I been having some issues running out of storage internaly. and after some fiddeling around with a2sd it was ok. And how to do it is posted in this rom's explanation on how to install it.
ruymanca said:
The ROM takes about 10 minutes to start for the first time since the beginning makes for a facility, I recommend formatting the memory trageta do a clean install or possibly delete the folders: ANDROID, LOST DIR ANDROID as these folders SECURE conflicts created by data from the old roms
I recommend making partitions ie swap64mb ext512 and the rest as fat32 mind too expensive or necessarily recommend formatting the card will memory or possibly delete the folders in the same android, haer all the wipes, the Rom takes a few minutes to make first start since being installed all the extras on the first boot takes 3 to 5 minutes, once this echo this start and made previous settings obligation is to do a reboot for full functionality telefeno
Installation of the rom:
1. reboot in recovery mode
2. we wipes all
3. selected to install update sip
4. restart the tlf
5. enter the terminal console and register the following:
his press enter
# a2sd cachesd or enter
the phone will reboot and have about 150 megs of free internal memory
Click to expand...
Click to collapse
nope dint workk :-/
Type "su" first (Without Quotes), then try the a2sd command.
Can u mention it Step by Step?
Hi all, i have same issue.
Yesterday i finally rootat my Wildfire and put Cyanogenmod 7.0.3.stable on it.
Its very nice!
BUT cant allways install apps from market. I have 87mb free on inside memory and 1,7gb in sdcard... So what is problem?
What i need to do? I can full wipe all my data from telefone if somone tell me how i can do this..
Can somone help?
Use dalvik wipe from xrecovery to clean ur phone data..
Sent from my U20i using XDA Premium App
try istalling darktremor a2sd script (need to be istalled from recovery if not already integrated into your rom) and download a2sdgui from market, it's a gui for the script mentioned earlier. into recovery you have to partition your sd card too (advanced) 1024mb ext and i suggest 64mb swap, then open the app I told you (a2sdgui) and move everything to ext, dalvik cache too.
I agree with the poster above.
if you have issues with a2sd, I recommend installing A2SDGUI from market. (I assume you already have darktremors a2sd script installed). I had darktremors script working fine, but after flashing a zip file, it was not working. So I installed the A2SDGUI from darktremor and fixed the script. Now it is working. Just search the market and install it. It is great. Now I have around 168 MB free after all the installed apps.
Hope this helps,
SOLUTION TO INSUFFICIENT STORAGE:
1. Use FROYO+ default apps2sd. It gives the option to force moving of 95% of the apps to sdcard. Even root is not necessary. You can move 95% of apps only after using the adb command "adb shell pm setInstallLocation 2". This command is not even needed in cm7. And this method uses the fat/fat32 partition of sdcard not the ext partition. Specifically apps will be installed to .android_secure folder in the root of sdcard.
2. This method includes creating ext partition on sdcard and using an app called "link2sd". This is a root only app. No scripts are needed. That app has option to even link individual apps to ext partition. Also links dalvik cache.
3. Creating ext + swap partition and using dtapps2sd script. Root is required. Also custom recovery is required for flashing the script. This might be the toughest one but it is pretty awesome. Moves apps , data, dalvik cache to ext partition. Everything can be done with commands from the terminal emulator. Or you can use the "a2sdgui" app for graphical user interface.
Sent from my HTC Wildfire using XDA App
The GUI for the script is much more user-friendly than emulator terminal. And you can undo everything you did if it's not as you tought faster than from terminal.
I am not aware of how Hell Fire works. But yes for Cyanogenmod 7 I know there is a issue downloading a large application from the market. It won't download. Problem is the space.
Fix for this is few steps:
1. In Terminal type the following commands.
2. su
3. mkdir /sdcard/download-cache
4. cd /cache
5. mv download download.bak
6. ln -s /sdcard/download-cache download
Done... Now Go to market and download anything you won't get such errors..
If It Helps Don't forget Press Thank Button.
Thanks a lot!
I just get my new sd-card( 16 Gb) and install darktremor a2sd script + a2sdgui.
Works just like it says!
No more thinking what program van install and what not....
Well I just installed the MOdd Again ... and I was done
Though i bought Samsung Galaxy ace as its my second time the Touch Panel doesn't work ... first in Tattoo and den in Wildfire
So ... Thanx a lot guys for Helping
DestinyAwaits said:
I am not aware of how Hell Fire works. But yes for Cyanogenmod 7 I know there is a issue downloading a large application from the market. It won't download. Problem is the space.
Fix for this is few steps:
1. In Terminal type the following commands.
2. su
3. mkdir /sdcard/download-cache
4. cd /cache
5. mv download download.bak
6. ln -s /sdcard/download-cache download
Done... Now Go to market and download anything you won't get such errors..
If It Helps Don't forget Press Thank Button.
Click to expand...
Click to collapse
Working perfectly fine for me Thanks!
No mount scrip
System cm10 build 6
Please help form this error
Swap 256
Sdext 1024 ext4
You have to clear up some space in the system. Oh and next time search first this has been asked and answered numerous times in both related threads. The whole solution is described there.
Swyped from my P509 on Tmobile.
With Swype and Flash, why would anyone choose the iPhone?
not working
mrlamo said:
You have to clear up some space in the system. Oh and next time search first this has been asked and answered numerous times in both related threads. The whole solution is described there.
Swyped from my P509 on Tmobile.
With Swype and Flash, why would anyone choose the iPhone?
Click to expand...
Click to collapse
[mode google translator on]
thanks for replying
it´s a clean installation, full wipe and wipe fo all partition, one by one... and try repair partition, and try creating partition and convert ext2 to ext3 and ext3 to ext4
I will find the solutions already published, but with the installation of other roms no problems, even with CM10 build 5
I use cwm 5.0.27 n it works.256 ext4 and 64 swap.
cwm
bao_loc106 said:
I use cwm 5.0.27 n it works.256 ext4 and 64 swap.
Click to expand...
Click to collapse
I already downloaded it.
how to install this application?
already installed, but the error continues
not working
sermaudu said:
I already downloaded it.
how to install this application?
already installed, but the error continues
Click to expand...
Click to collapse
Clockworkmod Recovery v5.0.2.7
E:Bad boot message
"recovery "
sermaudu said:
Clockworkmod Recovery v5.0.2.7
E:Bad boot message
"recovery "
Click to expand...
Click to collapse
What?
Delete one unused app from the /system partition. You should be able to do so within Link2SD. Just filter the system apps and remove one (make sure that something doesn't rely on it!) If you don't use app E-Mail (not Gmail) you can remove it, only the E-mail and not the provider. That should work, I have done it this way too.
--
P>
Sent from my LG-P500 using xda app-developers app
not working
paul.n said:
What?
Delete one unused app from the /system partition. You should be able to do so within Link2SD. Just filter the system apps and remove one (make sure that something doesn't rely on it!) If you don't use app E-Mail (not Gmail) you can remove it, only the E-mail and not the provider. That should work, I have done it this way too.
--
P>
Sent from my LG-P500 using xda app-developers app
Click to expand...
Click to collapse
hi,
sorry by english but...
I returned to partition, reinstall the OS and link2sd works, still shows the same error does not mount the script, when I go into recovery mode get the error mentioned above ....
Delete partitions, resizing, formatting and nothing
sermaudu said:
hi,
sorry by english but...
I returned to partition, reinstall the OS and link2sd works, still shows the same error does not mount the script, when I go into recovery mode get the error mentioned above ....
Delete partitions, resizing, formatting and nothing
Click to expand...
Click to collapse
Hmm, Link2SD works but it won't work?
You need to delete some files in /system/ in order to create the mount script. Our system parition is too tall. So delete some files you don't need from system.
Example:
If you don't like E-Mail, delete Email.apk from /system/app/
And so on!
Recovery: That's normal! It isn't a problem, it's on every LG-P500!
Sent from my LG-P500 running Protos 0.0.1
not working
CodingDroid said:
Hmm, Link2SD works but it won't work?
You need to delete some files in /system/ in order to create the mount script. Our system parition is too tall. So delete some files you don't need from system.
Example:
If you don't like E-Mail, delete Email.apk from /system/app/
And so on!
Recovery: That's normal! It isn't a problem, it's on every LG-P500!
Sent from my LG-P500 running Protos 0.0.1
Click to expand...
Click to collapse
thanks
CM9 installed without problems(link2sd working smoothly), reinstall CM10 when more stable
sermaudu said:
Clockworkmod Recovery v5.0.2.7
E:Bad boot message
"recovery "
Click to expand...
Click to collapse
This not an error, a working recovery SHOULD show this.
Sorry for my bad English.
Sent from my LG-P500
Dalvik cache cleaner is a shell script which clears the Dalvik cache that can be used with Android Terminal Emulator.
Root and busybox is required, if you don't know what root and/or busybox is then do NOT bother using the script.
Place the shell script in the main directory.
With Android Terminal Emulator type:
su
sh /sdcard/Dalvik_cache_cleaner.sh
The process should be close to instant depending on how much files you have in the directory.
Download: http://caftp.3owl.com/Shell_Scripts/Dalvik_cache_cleaner/Dalvik_cache_cleaner.sh
It worked
~~~~~~~~~~~~~~~~~~~~~
Samsung galaxy s2
Rom: Jedi knight 6
kernel: Jedi kernel 2
~~~~~~~~~~~~~~~~~~~~~
And you thought celebrities weren't smart! =P
Is this also intended to run on every boot, ie via init.d
thebrainkafka said:
Is this also intended to run on every boot, ie via init.d
Click to expand...
Click to collapse
No, that would also waste too much time on boot then on a normal boot due to rebuilding the cache everytime.
When you uninstall an application, usually a dalvik cache file is left over wasting space.
But if you want you can use ROM Toolbox from JRUMMY APPS INC. in the Play Store.
There is a Scripter in that application that you can use for such thing but the problem is that when I tryed using the su binary in the shell script, there is an issue where the su binary in the shell script will just cut off the other parts of the script and only the su binary so your answer would be fat chance unfortunately. :/
Sent from my Sony Tablet S using xda premium
Issue fixed.
Is this the same as wiping dv cache through recovery. Also what will be the script for wiping cache? Will it be rm /cache?
Thanx!
The-Droidster said:
Is this the same as wiping dv cache through recovery. Also what will be the script for wiping cache? Will it be rm /cache?
Thanx!
Click to expand...
Click to collapse
Yes and the code is:
#!/system/bin/sh
rm /data/dalvik-cache/*
reboot
Click to expand...
Click to collapse
I'm not sure if /cache/ is really dalvik cache, on devices with OTA update support the OTA zip's will be stored their with other stuff but if you want I can give you the code for that.
On linux (That also means android) use 'chmod 755' for the permissions for the shell script.
I have tried adding 'su' but that fails has the terminal only executes the su binary so the rest of the script does not get executed.
Using the 'echo' binary to say out what it is doing is a fail has the terminal does not go anywhere due to the echo binary getting executed but it will not display output in the terminal anyway making the script not being executable.
Sent from my Sony Tablet S using xda premium
Man I am full with ideas.
I can create a shell script to do:
[OTA]
Remove OTA Update zip in cache
Copy OTA Update zip from cache to SDCard
[Files and Folders]
Remove LOST.DIR (That is just a useless folder )
Wipe SD Card
Wipe Zip files (useful for custom roms on your SD which you don't want anymore)
Well soon I should get more ideas so the OTA shell scripts will not be possible unless I get a rootable device with OTA functionallity (I do have a Sony Tablet S but I forgot to root it but I went and installed the firmware update without noticing) so it would be the Nexus 4 I would test it on in March.
The thing is that more shell scripts I create more pages I have to add to my website to give information about it, how to use it and the download link which can take around 10 Minutes just by editing the code, make backup and then upload via FTP.
Sent from my Sony Tablet S using xda premium
New shell scripts available which should be available tomorrow and if not a few days.
They are:
Aptoide Cleaner - I found out that the xml files are adding numbers to their file extensions so I built a script which can remove that problem real fast.
Take Out Bin - Removes all or at least most useless directories like LOST.DIR and LazyList, they are just a few.
ExtSD and USB Cleaner - Same has 'Take Out Bin' but it does it on the external SD Card while on USB, LOST.DIR will be erased has that should not be there.
-OLDER PROJECTS-
Dalvik Cache Cleaner - Read the first post.
Andro.Shell.Crash - This is good for developers has this does crash/lag/freeze the OS which can help a root exploit get in, of course there is different effects depending on the hardware and software, if the device is fast and has good hardware then it is possible that it may just lag and/or freeze but for older devices with older hardware can just crash.
NOTICE: The older projects are already out and available to download on my website.
I will be creating a forum about these shell scripts but I am not sure about the Aptoide one for many reasons.
I know that I am not suppose to be talking about this on a thread which has a different purpose but yeah, just an update.
EDIT: I uploaded and programmed the webpages from my tablet using WM FTP Client and DroidEdit Pro so that was a bit too early but all well, new thread(s) should come in tomorrow depending what will happen tomorrow (It is 03:30AM so it would count has today anyway).
Anyone can please guide me how to remove this script???
Thank you in advance
romelcool said:
Anyone can please guide me how to remove this script???
Thank you in advance
Click to expand...
Click to collapse
You just delete the shell script, you only use it in the Terminal Emulator so once you run it, it will wipe the dalvik cache so it will not do such thing in every boot.
Sent from my Nexus 4
Man I think you should create a script which are:
Auto clean of cache || Optimize App || Kill Media Process
If it's possible to you to create script with the list below that will be awesome ! ..
what is the code for auto cleaning cache every 30 minutes ? ..
and also auto optimize application every 24 hours ? ..
kill media process ?
I hope you could help me with this .. Thanks !
CoolApps said:
Download: http://caftp.3owl.com/Shell_Scripts/Dalvik_cache_cleaner/Dalvik_cache_cleaner.sh
Click to expand...
Click to collapse
Gone!
jidanni said:
Gone!
Click to expand...
Click to collapse
That's because I switched sites between 2012 - 2015. This thread was very inactive so I missed it out and didn't update the link with the new one.
The current server I use for it has some files that I'm aware of that are more often downloaded by users which means I ended up removing the shell scripts along with others that don't need to be there. I made a backup of everything before, by the way.
I don't feel that there's a need restore the file and plus, this thread's old.
Because of the sudden bumps of a thread that currently serves no purpose, something should be done about it to avoid further confusions.
Sent from my Nexus 4 using Tapatalk
Can you please tell me what your script did.
I made my own script that does
su -c 'find /data/data/*/cache/* -delete'
This one line saved me from installing multi-megabyte apps that do the same thing.
Is there anything more I should add to my script?
Now I can finally have enough room so Google Play can update apps again!
Thread closed at OP's request.
DISCLAIMER: YOU AGREE TO TAKE FULL RESPONSIBILITY FOR YOUR DEVICE IF YOU PROCEED.
The original thread (http://forum.xda-developers.com/moto-g/general/mod-save-data-space-cache-partition-t2942765) was getting to cluttered up with development and testing so I decided to start a new thread with the "finished" product. The original thread will be renamed to Q&A/Development. We might even ask for the old thread to be closed down. (up to @Bert98, the thread's creator.)
Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't
b) you're running ART (this is default in lollipop and newer)
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Original post by @Bert98
Click to expand...
Click to collapse
This was tested on my moto g 16GB which is running RetailUS_4.4.4 kitkat with CWM recovery. The custom ROM procedure was tested on the same phone but with cm11 Nightly installed.
Prerequisites:
1. You must have "adb root" functioning. If you don't head to this thread: http://forum.xda-developers.com/showthread.php?t=1687590 and there is a free download link at the bottom of the post.
Download and install the apk on your phone. Open up adbd insecure (the new app) and grant it superuser rights PERMANENTLY. Check the box that says "enable insecure binary" and make sure to check the box
that says "enable at boot."
2. You must have a recovery that can accept adb shell commands.
3. Root Access Duh?!
4. A windows machine capable of running batch files.
5. A decent text editor, notepad will work but notepad++ is strongly recommended. (Only needed if you are using STOCK ROM procedure)
Please, please make a nandroid backup before you continue!!!!
Stock ROM procedure:
Read the directions very carefully and then read them again, before continuing.
1. Download the cachemover_v1.3.zip from: LINK REMOVED DUE TO SCRIPT ISSUES.
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover_Stock.bat
5. Follow the onscreen instructions until you get to the part where it says to edit a file.
6. About halfway through the script it will pull a file called "init.qcom.post_boot.sh" to the folder.
7. Open it with a TEXT editor and navigate to about line 487 (Might be different for 8gb model). Look here for a better understanding: https://www.dropbox.com/s/jr5lyl5s5i2jtpg/where to paste code.PNG?dl=0
8. Start a new line and paste this code in the file: (Refer to the image above for help)
Code:
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
9. Make sure to save the file in the same folder as the cachemover_Stock.bat
10. Press any key to continue on the script and let it do its thing.
11. It will reboot several times and land you on the home screen/lock screen.
12. If the script hangs after a reboot, you need to unlock the device to reestablish a connection with your computer.
13. There might be one or two force closes but once you close the notifications they will not come back.
Custom ROM procedure:
USE THIS FOR ROMS THAT DO NOT REMOUNT OR CHANGE PERMISSIONS OF /CACHE ON BOOT
1. Download the cachemover_v1.3.zip from: https://www.dropbox.com/s/bzj34g4q1s61ojz/cachemover_v1.3.zip?dl=0
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover.bat
5. Follow the onscreen instructions.
If anything goes wrong:
Go to recovery, wipe cache, then wipe dalvik-cache and reboot. This should get your device back to how it was.
(If you used STOCK ROM procedure)
The script made a backup of the "init.qcom.post_boot.sh" file to /sdcard/init_backup
You can restore the shell script to /system/etc/ via shell commands or by using a root browser. To restore permissions:
Code:
chmod 740 /system/etc/init.qcom.post_boot.sh
chown root:root /system/etc/init.qcom.post_boot.sh
Custom ROM procedure already has a restore script!
I am currently working on an auto restore script for stock and that will be relased soon, hopefully! :good:
Changelog:
v1.0 - First stable release. Does not work on STOCK ROM.
v1.1 - Added a restore script.
v1.3 - Added support for STOCK ROM. There are still a few bugs.
How it works?!?!
Coming soon...
Huge thanks to @Bert98 and @dd043
Hit the thanks button if it worked! I went through about 50 factory resets, and reflashed the ROM about 25 times, and put about 10 hours of work into this script! Really motivates me for future projects. :laugh:
Thanks for your help man and effort.
I encountered a problem, everything works up until my device boots in CWM to fix permissions, then just sits there doing not alot I don't even see the option in my CWM.
Any ideas? cheers
Sent from my XT1032 using XDA Free mobile app
When it reboots to cwm unplug the cable and replug it, if it hangs just type these commands manually from a command window.
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
reboot
If this does not work you may ned to go into mounts & storage in the cwm menu and click mount /cache. Then try the commands again.
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
You have a typo in the threads title. Just a heads up.
Vuciz said:
You have a typo in the threads title. Just a heads up.
Click to expand...
Click to collapse
Thanks for letting me know!
dd043 said:
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
Click to expand...
Click to collapse
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
skyguy126 said:
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
Click to expand...
Click to collapse
Yes I've tried your script, all went well but the result is the same. The script itself works nicely btw
Applications present before moving cache work perfectly, but I can't install anything new. I suspect it might be my device but before wiping everything I'd prefer feedback from others :fingers-crossed:.
I cannot install new apps as well. The mount command you showed me has the same effect too. I honestly don't know anymore, the sym link did not allow the install of new apps nor did the mount command you sent me. Correct me if I am wrong.
Edit: Going through all the init files on my phone to see which one remounts /cache at boot.
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
I don't see the mount cache command in CWM strange
I've managed to get back to normal, thanks for everyone's help though, I will keep and eye on the thread
Sent from my XT1032 using XDA Free mobile app
non-windows version?
Thanks for this tool. It's a great idea and our Motos really need it.
However, I have a problem - I do not own a windows license (os x and ubuntu user) and I would prefer not to spend $120 just to use it for this script. Pirating is out of the question for me.
I was wondering if there is any chance of having this script written for linux and/or mac. If impossible, is there a LEGAL way of running windows in a virtual machine? Something like a trial or similar?
If you know how just convert it to shell script for osx and Linux. I give you permission to do this but you may not take credit or rehost your creation.
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
skyguy126 said:
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
Click to expand...
Click to collapse
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
dd043 said:
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
Click to expand...
Click to collapse
How about making a simple apk that toggles this feature. Something like when you click the icon it doesn't even open but gives a little notification of success. Something like that. I myself am not experienced with apks but I can put together a shell script for the apk.
skyguy126 said:
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
Click to expand...
Click to collapse
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
Ill try it. I don't mind doing a bunch of resets because I am using my moto g as a test bench anyway. My daily driver is the OnePlus One
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
EDIT: Unfortunately it didn't work. I don't know if I modified the installd file correctly. The program I used is HxD.
Is there a way we can force dalvik to start after the directories are created. And change dalvik to create it in /cache.