yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] Goblinlord:
Script for use with cachesd

Hello... I have been using Darktremor for quite some time. After eventually running low on memory because of the cache filling up I had started using cachesd not long after I started using Darktremor. It has been absolutely awesome as far as taking care of memory issues.

Unfortunately, I have only have a class 2 sdcard. This was making some of my programs... not so snappy. I really don't mind the slow down on non vital apps but things like my launcher (currently I am on a baseline Miui ROM with translations) I found slightly unacceptable.

To combat this problem I decided I would move my cache for my system programs back to my internal memory. So far it has been working great. Doing this does have a few implications such as... if cache is cleared then this script would need to be run again. Also, I am working under the assumption that these files are created once then only modified after... if at all. What I did was create a new folder on the original cache partition, move the files I was concerned with to this new folder, then create symbolic links on the SD-EXT cache partition pointing to their new location. This seems to have solved my issue and made my more vital programs run much smoother with less loading time. This could just be my perception but I would leave that for others to decide.

The script I used is as follows:

#!/system/bin/bash
DCACHE="/cache/dalvik-cache"
FCACHE="/cache/fast"
mkdir -p $FCACHE
for i in `ls -l $DCACHE/system@*|awk '/^-/ {print $9}`
do
echo "Moving $i to internal memory"
mv $DCACHE/$i $FCACHE/$i
echo "Creating link for $i"
ln -s $FCACHE/$i $DCACHE/$i
done

You should be able to do something similar to move cache for things like launchers and whatnot to internal memory as need to allow a "smart" usage of internal memory rather than it being an empty void that isn't used. The new links don't have any specific permissions setup but the files that are moved should retain their original permissions anyways. A feature addition of this nature might be a nice for cases like mine such as people with low memory on their device but slow external memory (specifically for system app cache). To be honest though, I would check with some someone who has more knowledge of how the cache works before trying to use this script without knowing exactly what its doing. Worst case scenario you should be able to clear cache and it will delete the symbolic links it created and the cache for the system programs would recreated on the SD-EXT partition. Also, to remove the remnants from this script you would need to delete the /cache/fast folder it creates as well as its contents (the cache files it moved).
[Nexus One Android Development] Pantx:
hi,

i have a question

i have the aga rom,

which of this Version shall i use?

2.7.5.3 Beta 04

2.7.5.3 Beta 03

2.7.5.2-1
[Nexus One Android Development] johnmclin:
Error: No a2sd swap environment variable found.

Can someone please help. Running NRG rom on EVO 4G. 16 GB SD parted with 64MB swap, 1024MB ext3. Wiped, ran rom zip & dta2sd script. booted, ran a2sd check. no probs, Appsmoved, dalvik moved, zipaligned ok. When I tried tp move swap, I go the following error. see attachment.
[Nexus One Android Development] mtw4991:
most of us are using 2.7.5.3b4 using Temaseks barrier=0 script. Post 1314 or thereabouts, iirc.

---------- Post added at 07:45 PM ---------- Previous post was at 07:42 PM ----------

Not sure if anyone uses Swap anymore, no need to afaik. Not sure about the E4G tho.
[Nexus One Android Development] Rycon33:
guys, quick question here, in a2sd GUI, what does 'zipalign on boot' exactly do?
[Nexus One Android Development] :
I think it allows for an apk align on each boot as opposed to a one time align

Lets the OS and apps interact more quickly and efficiently, increasing speed and conserving memory usage

That's my understanding anyway--
[Nexus One Android Development] btabangay:
Sir please help me with this..

i flashed this latest darktremor a2sd.This is my first time to used DT.

then i install GUI..i choose apps on SD and when i select dalvik on sd card..i press move and rebuild. Then the phone restarts and when i check the phone memory.it became 195MB..

But when i install applications..the phone memory still decreasing..When i move and rebuild again. i get stuck on LG. whats the caused of that?and why my phone memory still decreasing.thanks
[Nexus One Android Development] baseballfanz:
It should still decrease, only at a much slower rate. Remember your data will still reside on the internal memory.
[Nexus One Android Development] btabangay:
Thanks, is there's a way that the data also will be on ext?
[Nexus One Android Development] bassmadrigal:
You have to be running the beta, but unless you have a fast memory card, you can see some pretty serious performance hits. I would just recommend moving apps on a case by case basis using Titanium Backup (if you long press on an app, it will give you the option to move the data over for that app).
[Nexus One Android Development] warpaper:
Hi temasek,

Since the internal memory of my N1 getting low and i plan to purchase a class 10 card (the current one is the bundle 4G class 4 one). may i double ask a class 10 card can give me the same performance as i am not running data2ext?

just wanna double check before i buy a class 10 card but can't help my low internal memory problem.

sorry for stupid question.
[Nexus One Android Development] temasek:
I would suggest this

1. Use S2E

2. Selectively move apps' data to sd-ext using titanium backup.

In that way u have speed, storage.

Class 10 u still will feel the lag.
[Nexus One Android Development] jbbandos:
I won't recommend class 10. I had only problems with a class 10 card (Patriot). I gave up and bought a Sandisk class 6 and it even feels faster - and no more data corruption.
[Nexus One Android Development] warpaper:
Hi jbbandos,

so from your experience, ur using a Sandisk class 6 with DT apps2sd and data2sd without any lag or problem? if yes, i will follow your recommendation. 8 )

PS: i believe ur talking about this one: SanDisk® Mobile Ultra™ microSDHC™ memory cards?

Update on 13 Jan: finally i brought a 16G SanDisk above and it working pretty well with both app2sd and data2sd enabled. Thanks all comment.
[Nexus One Android Development] CAL7:
I have tried to convert from DT to S2E a couple of times and it has never worked - it says it converts, but I get FC's on many apps. I believe there is an issue when the DT ext4 apps is too large for conversion to internal before conversion back to S2E ext4. I could certainly have this wrong. I would appreciate any lesson on what to look for when converting DT to S2E.
[Nexus One Android Development] temasek:
I did the conversion once only and was successful. One thing probably was that I did a full apps+data backup via titanium and then start uninstall quite a few big apps. Once done I converted to S2E and then did a restore via titanium.
[Nexus One Android Development] jbbandos:
Sorry, in the end I got a class 4 (http://www.amazon.de/gp/product/B003HIWHN0), and using this one with data2sd (XPART) it flies - and all the data corruption problems I had with the class 10 Patriot (had to verify every backup made with TB, and had to redo a few every time) are now gone. I am very happy with it.
[Nexus One Android Development] temasek:
Patriot class 10 had many issues then. If u google u see lots of complains.
[Nexus One Android Development] jbbandos:
I know, but with D2SD (and/or XPART) seems like everyone that had a class 10 card had problems.
[Nexus One Android Development] temasek:
I don't.

I was using DT with my class 10 and had no issues with data2sd function enabled.

It is just that sometime back, many were probably using fake class 10 or a bad sdcard.
[Nexus One Android Development] jbbandos:
Well, you're the first one I hear of that didn't have problems with a class 10 card. What brand is yours?

BTW, the card I had problems with works perfectly on my camera...
[Nexus One Android Development] bassmadrigal:
The easiest way I found was to completely stay away from the converting. I just used Titanium Backup to back up all my apps and app data, then I wiped everything cleanly (make sure you MANUALLY wipe the /system partition to clear out any remaining remnants of DT's), reinstalled CM and gapps, then installed S2E and Titanium from the market. Set up S2E, reboot, then use Titanium to restore all your apps.
[Nexus One Android Development] warpaper:
Dalvik Cache?

Now I have apps2dsd and data2sd enabled on my N1. I have pretty much internal memory available and wanna increase my system speed (although a class 6 sdcard give quit well performance).

In term of system response, where should i put the Dalvik Cache? SD card, /cache partition or internal phone storage?

Thanks
[Nexus One Android Development] aerismel:
I installed this app, but it made my IMEI to disappear. Therefore, I have no signal, and can't make phone calls. In the IMEI part is says "unknown". If I restore to the previous version without a2sd installed, my imei is there, perfectly. Somehow, when I install this app, I lose my imei number..

Is there a fix? Or a stable version or something that doesn't change my IMEI number?

Thanks!!
[Nexus One Android Development] bassmadrigal:
You need to make sure you have enough room in the /system partition before you install this. What ROM are you trying to install this on?
[Nexus One Android Development] Revhead:
I'm confused about one thing?

I have an HD2 and am using NexusHD2-Gingerbread_V3.2a_NAND_(Android-2.3.7).

Have installed dtapps2sd-2.7.5.2-signed.zip.

My 16Gb card is partitioned with a 2GB Ext4 partition and a 256Mb swap partition.

When I go into manage applications does the option "move to SD card" in reality move it out of the Ext4 partition and into the Fat32 partition?

Conversely, does "move to phone" put it back in Ext4?

Thanks in advance.
[Nexus One Android Development] HTCDevil:
Could it work on a Stock FRF91 Rom for Nexus?

I've tried your guide but @ ./makeboot [etc] it gives to me: "Could not load boot.img-kernel".

Thanks for your hard work ;)
[Nexus One Android Development] tkirton:
Maybe your SD card isn't mounting.

If you can get into ADB shell while it is boot looping, try typing the following:

a2sd remove

a2sd nocache

This may get your out of your boot loop.
[Nexus One Android Development] tkirton:
It won't work on any stock roms unless the stock rom has been modified to launch scripts via its init.rc.

But since you are trying to modify it...did you run ./getramdisk first?

The way it works is this:

./getramdisk

cd ../ramdisk

gvim init.rc

<make necessary changes to init.rc using the Rom installation guide>

cd ../scripts

./makeramdisk

./makeboot ../boot.img-kernel ../newramdisk.gz ../newboot.img 0x20000000
[Nexus One Android Development] HTCDevil:
Thank you tkirton, i'll retry :D
[Nexus One Android Development] HTCDevil:
Same error...i think it's a stock frf91 issue...boot.img-kernel has something wrong on it.

Thanks anyway :)
[Nexus One Android Development] plasmadragon007:
I have tried doing it a few times and have ran into the same issue, right after I ./makeboot ../boot.img-kernel ../newramdisk.gz ../newboot.img 0x20000000 , I get [ ] Creating New Boot Image

error: could not load kernel '../boot.img-kernel'
[Nexus One Android Development] HTCDevil:
Yes, that's my exact issue. I think it is a problem of stock frf91. :(
[Nexus One Android Development] zen kun:
sorry if this was being asked but i know this work for CM RC3 not sure if will work for stable version can someone confirm please thanks
[Nexus One Android Development] trock62:
Just installed on cmnightly 0902 with devlik to SD. Very fast and responsive. Wifi.market all work great
[Nexus One Android Development] poochie2:
Working fine on CM6, I had to move the Dalvik from cache to extra but I had to empty the cache Dalvik folder manually, maybe it should be automatic.
[Nexus One Android Development] mynameisjon:
does anyone know how I can restore the symlinks?

I reformatted my SD card and did a nand-ext restore, but the apps aren't showing.
[Nexus One Android Development] tkirton:
Did the nandroid backup have Darktremor already installed? If not, flash Darktremor on your restored image and the program will take care of the rest.
[Nexus One Android Development] mynameisjon:
I had an earlier version of the script installed before the nandroid.

Flashed the new zip and it works fine now.

Thanks.
[Nexus One Android Development] zen kun:
a little help i already have some apps moved to sd using froyo apps2sd but i have low storage memory so what should i do? Titanium backup to resotr after flashing? i have TB set up to restore original position(sd) so should i deactivate this?

thanks
[Nexus One Android Development] djmcnz:
@ tkirton

Question:

Does the possibility exist that somebody could enable apps2ext, after previously using it or upgrading their rom and end up "activating" old data in the symlinks to dalvik-cache?

It is my understand that if dalvik-cache is moved to /sd-ext then there is no 'automated' way of clearing it, recovery won't do it (links are either not established, /sd-ext is not mounted or links are not followed). The install script of a rom will not do it (delete_recursive /data/dalvik-cache) because /sd-ext is not mounted.

So, in (my) theory it's possible for /sd-ext/dalvik-cache to be populated and orphaned.

Proceeding from this premise (an orphaned, populated dalvik-cache) is it then possible for a user to (re)activate apps2ext (say, after installing a new rom) and find that once the symlinks are (re)established they are now using the old, orphaned dalvik-cache with old data?

Or is there a failsafe way that this scenario can not arise by a mechanism in DarkTremor?

I'm asking about this very narrow and specific case because I have recently seen a spike in the number of dalvik-cache related failures (hard crashes, soft reboots, force closes etc) for people running apps2ext (CM6/2.7.5 RC3c - not that I think this matters). Like a massive spike... it's quite concerning.

Or more simply put, does DarkTremor absolutely, definitely clear out dalvik-cache every single time the symlinks are established?

Have I explained myself well enough?
[Nexus One Android Development] zen kun:
ok i can boot now, the problem was i use clockwork recovery to partition but has no option to make ext 3 so i flash amon ra and i convert to ext3 and all was ok

now when i check my memory the internal its 196 mb and i have free 70 MB, and if i check the partition it has 400+ free MB

before using this i had 25 MB free i need enable or something?

if i check my apps they are like before some of them i move with old froyo method so some say (move to phone)

so i need move all to phone and then reinstall or what?

i check with root explorer

in /mnt/ace

and there is some APK,seems that are the apks that has been moved with the old froyo style

thanks

sorry for my english
[Nexus One Android Development] warpaper:
How to clear the Dalvik Cache without booting into recovery?

Hi,

i am sorry i have through the info but still can't found the command for "the user to easily clear the Dalvik Cache without booting into recovery".

Please kindly point out.

Thanks alot.
[Nexus One Android Development] tkirton:
a2sd resetcache
[Nexus One Android Development] tkirton:
If your internal storage free amount increased after applying Apps2SD, then there's nothing else you need to do.

Froyo has its own Apps2SD, and both Froyo Apps2SD and this Apps2SD (what is called Classic Apps2SD to separate it from the Froyo version) can be ran together.

When running both, all programs set to run on internal storage will be sent to the EXT partition on the SD card. Anything set to run on external storage will be sent to the FAT32 partition on the SD card.

Data and Dalvik-Cache will remain on the internal storage (unless you use one of the dalvik-cache commands).
[Nexus One Android Development] tkirton:
Sorry it took a while to respond. I wanted to think about your question.

As of 2.7.5 RC3C, when the dalvik-cache is moved, the contents is moved with it. This should not cause the issue you are experiencing...however, the qualifier is should not, and right now, I'm having a hard time justifying that.

There are cases that I have ran where old data could be present (i.e. an older version of Darktremor was used or the EXT partition didn't mount due to the rom not supporting Apps2SD).

The problem I run into is that, if I reset the cache every time someone moves the location of the davlik-cache, I end up with a group of people who complain that the boot process goes into a loop or takes a long time (reason is that the dalvik-cache needs rebuilding).

If I move the data, like I do in RC3C, then I get the complaints of old data causing issues.

So, I had to think about this for a little while...and I think I have a solution.

I'm going to create three new commands in 2.7.5 final.

cachepartreset - does the same as cachepart, but also resets dalvik-cache.

cachesdreset - does the same as cachesd, but also resets dalvik-cache

nocachereset - does the same as nocache, but also resets dalvik-cache.

I will definitely have this ready by the weekend. I'm working on final testing (new installer is working perfectly).
[Nexus One Android Development] michie:
What do i have to modify in the script to let dalvik build on SD-EXT on first boot already after installing my rom with darktremors a2sd build in ?

(To avoid the low sound bug in HD2 ICS roms)
[Nexus One Android Development] aerismel:
Sorry, is this for me? I'm sure there is enough room in the /system partition because I haven't installed any apps and my sd has 8gb of storage. The ext partition is 512 mb. So I'm sure there is enough space. I have installed cyanogen 7.1 and miui. I can't make apps2sd work on either rom.
[Nexus One Android Development] jaggyjags:
hello, created a rom with kitchen for htc explorer with a2sd enabled, working perfectly.

want to know how to add the beta 4 to it,

2.7.5.2 is the version pre loaded in kitchen and can't flash the beta4 .zip file. Tried copying data and systems files to my rom. It flashed alright but cannot get datasd work everytime, is that the correct way?

how could I do it?

many thanks
[Nexus One Android Development] neroyoung:
Hi Please help me i am not getting why this happening.

Here is what my config is

16 GB SD Card Class 6 (13.5GB FAT32 + 1.5 EXT3 SD-EXT Partition)

I flashed this Script using clockwork mode and I saw in Titanium Backup that SD-EXT is 1.5 GB and 1.4GB is free.I installed apps,used phone everything was fine.But as i rebooted all the software which were on phone memory disappeared.and shourtcut of those apps were glassy grey color like app is not installed...

What should i do to solve this ?
[Nexus One Android Development] baseballfanz:
After flagging dt script, did you use terminal to enter the command to move apps to ext?

↖↗↖↗↖↗↖↗↖↗↖↗↖↗↖↗↖↗↖↗↖↗↖↗↖↗↖↗↖↗
[Nexus One Android Development] neroyoung:
No,i didn't did anything. I just flashed the script, and checked in a2sdgui that ad-ext is shown.

Then i just installed few apps normally and rebooted the device and after rebooting all apps in phone memory were disappeared,,,,,

Can anyone tell me step by step guide to proper installation of the script?

I my own modified stock Rom that supports init.d not cm7
[Nexus One Android Development] DRSdroid:
does this work with any ICS roms? like a CM9 beta for instance?
[Nexus One Android Development] :
need to read the OP pages

but they, as far as i know, are using their own versions--ia2sd--which kick in on 2nd boot
[Nexus One Android Development] bodyshop:
My sister has a Transform Ultra 2.3.4 that i just rooted via the one click method. Can i flash this beta 4 script our do i need to flash a custom ROM first?

Or does she at least need to have a custom recovery 1st?

Then again i don't know if that (1 click) method installed a recovery or not.

Sent from my SHOOTER full off off Chop Suey, that JamZ like no other!!!
[Nexus One Android Development] FrEcP:
Hi,

several questions:

1. is the project abandoned? Since there isn't an update for a year now...

2. Can it be installed wihtout loosing the Data on the SD? e.g. resizing SD partitions from windows? How the had to be created?

3. What happens to already installed apps? will they be moved? can the be moved? Waht happens to apps wich are moved by gingers app2sd function?

4. can we install it wihtout clockwork mod? e.g. copy wiht root explorer and set permission - then a normal scrip should be also capable of installing- or is there more to be done?

5. what happens if the partiton runs out of space? Will apps go to internal memory then?

Even I already used it for some time now on my wildfire - still those question bother me since I just switched to a device where i don't have clockwork mod...
[Nexus One Android Development] Androidity3000:
1) Most likely. Whatever is here is here. This shouldn't be too much as a problem as some report that this works with ICS. It would be nice if the low volume bug could be fixed... Maybe one day the dev will come back.

2) You can install/flash this just fine with no wipes. You WILL need to have an EXT partition (recommended ext3 or 4) for this to work. When you create the partition you WILL lose all data on SD. Backup everything on your PC first. As for how to flash, I would simply recommend to do it with a recovery (IE: AmonRa or 4EXT touch recovery).

3) Not sure if you can move previously installed apps. This script does not give the user an easy option to choose which to move to ext which is a shame... Apps that are moved on .android_secure (gingerbread's a2sd) can be moved back easily (and placed in the EXT by default) by going to settings>apps>on sd and click move to phone. It will usually move the app to the ext which the phone recognizes as internal.

4) Not too sure. The best way (obviously) is to flash the script via recovery but I am not the one to ask for moving files to /system. You can open the RAR file on your PC and view where the files are supposed to go and try to push them there. But when experimenting, back up lol.

5) If the partition runs out of space then apps will be installed to internal until that is almost filled as well. Then you will get the low memory error when trying to install. You must likely will not fill a partition as this script has many flaws when it comes to recognizing 'free space.' When I used to use it I would get 'low memory' errors when the partition was only half way filled.

Hope this helps. If you don't understand anything I said just ask.
[Nexus One Android Development] goister:
Hi,

I've 2 questions:

1. I have a HTC Desire GSM that's running CM 7.0.3 and I've run the DT A2SD script to put my apps and dalvik-cache to the EXT partition on the sdcard. I wish to update to CM 7.10, and the instructions seem straightforward enough (nandroid, flash, that's it). I'm wondering if I need to do anything about A2SD for the update?

2. I wish to upgrade to a larger sdcard. How can I migrate from my existing sdcard to a new one?
[Nexus One Android Development] Hanny:
1)

nandroid

wipe cache

wipe dalvik

flash update

flash darktremor

reboot

done ;)

2)

boot to recovery mode

nandroid backup, only choose [android_secure] and [sd-ext]

turn on usb mass storage

move everything on sd to computer

turn off usb mass storage

turn off phone in recovery

switch hardware sd card from old to new

do not power on phone normally

must directly boot into recovery mode

partition sd card - your desired ext and space etc.

usb mass storage on

everything from computer to sd

usb mass storage off

nandroid restore (the one only with the two options ticked)

reboot phone - phew finished!
[Nexus One Android Development] goister:
Thanks! So I assume flashing the CM7.1 update will clear my internal memory, that's why I need to reflash darktremor zip file? After flashing it will I need to run the a2sd scripts again after reboot to move my apps and dalvik-cache to my sdcard?
[Nexus One Android Development] earth08:
I am on Stock Rom 2.3.6 with root permission

and i would like to install more apps ( a2sd)

what should i do.

Pls guide me.