Jump to content

Apps2SD - n00b question ;)


Guest bipbop

Recommended Posts

Hello,

As I understand on HOW to use apps2SD by creating ext2/ext3 partition at the end of SD card, I dont understand how it will behave.

I`m using 1,0 Gb partition for Ext2 on my SD. I have ~150 Mbytes of apps installed already BUT when I go to main settings->SD card , I see that memory for Apps has shrinked and its about 22 megs left ? Internal memory has 180 Mbytes so this would be correct, BUT when I go with root explorer to my DATA\apps or SYSTEM\SD\Apps I can see information that ~150 Mbytes is used and ~780 Mbytes left .

Question is: when I install MORE apps than there`s internal memory, I`ll always see " 0 Mbytes left for apps" under settings->SD but I`ll be able to install apps till I fill SD ext2 partition ?

Btw.:greets to evrbdy !

Edited by bipbop
Link to comment
Share on other sites

Guest Phoenix Silver
Android system info installed.im using jj rl9 rom .i see that i just run out off space ;) .please help .

i had the same problem

a2sd didn't seem to work in JJ9

(1 have 1 fat32 1.5 gigs and an ext3 for journaling and corruption of 512 megs)

Link to comment
Share on other sites

i had the same problem

a2sd didn't seem to work in JJ9

(1 have 1 fat32 1.5 gigs and an ext3 for journaling and corruption of 512 megs)

Did you found any solution ?

Link to comment
Share on other sites

this guide was updated, you can find it here:

[GUIDE] How to get more FREE SPACE for your apps

what's included in this guide (updated 2011-02-04 15:51):

A A2SD vs. App2SD/MOVE2SD

B changing partition sizes (to get more space from unused space in system and cache)

C moving data or dalvik-cache to sd card

If you want to get more free space for your apps, follow this guide starting from A. Only switch to the respective next section if still necessary to get more free space.

--------------------------------------------------------

A A2SD vs. App2SD/MOVE2SD:

(root needed or a Custom ROM with A2SD support)

Explanation of the terms here. Also have a look at this explanating post.

If you want to use A2SD, check if your ROM supports it (in the ROM comparison table there is a column for it). A2SD is also possible if your ROM doesn't support it, however it will be more difficult.

To install A2SD you need to partition your SD card. To do this:

1. Backup the content of your SD card to your PC (using your PC file manager while usb connected to PC)

2. partition your SD card using clockworkmod recovery (on boot press Volume Down + Power Button, then in clockworkmod menu choose partition sd card - choose ext2 or ext3 (I recommend ext2, here is some discussion on ext2 vs. ext3) - then choose size of ext2: I recommend between 512 MB and 1024 MB - choose size of swap: 0MB, as swap isn't needed)

Caution! You should use Clockworkmod 2.5.1.8 or higher, as the previous versions didn't partition correctly.

3. if necessary: copy your backup back to your sd card

4. either your ROM should support A2SD or you have to install it manually. For that you would need an init.d boot script that (a.) mounts the ext2 partition on your sd card to /system/sd and (b.) moves your /data/app folder to /system/sd, creating a symlink (symbolic link) from /data/app to /system/sd/app.

Where to get that boot script? - Perhaps someone has a link. If it's needed, we can upload such a script taken from a custom ROM.

you can see if A2SD is working if you browse to /system/sd folder (for that you need root access. Use the app Rootexplorer, terminal or adb) and check if there is something inside. /system/sd is the ext2 partition on your sd card.

Alternatively (also without root possible) do this to have a look on the free space of the different directories:

open terminal or adb shell and type "busybox df -h". If there are too many lines, type: "busybox df -h | head". If you don't have busybox installed, just type: "df".

/data is the data partition on the internal flash memory, /system/sd is the ext2 partition on the sd card and /mnt/sdcard is the sdcard.

In android settings - sd card you can only see the free space of /data and /mnt/sdcard, however /system/sd won't appear there.

However, even if you have A2SD working you can still get into troubles with little space left.

This is because of android's design, if you install an app, it will create stuff in these folders:

1.

/data/app/XYZ-1.apk

-> original .apk file; this is used by the dalvik machine to create executable and is used by paket manager to restore default data (if you go to Settings - Apps - manage apps - (select an app) - delete data + cache

-> if you use A2SD, this folder will be on your sd card (mounted to /system/sd, with symlink to /data/app)

-> if you use App2SD, then some of the apps in this folder are moved to /sdcard/.android-secure (only the ones that enabled the Move2SD function and only the ones you manually move using settings - apps or "Apps 2 SD" app)

2.

/data/dalvik-cache/data@[email protected]@classes.dex

-> this is the dalvik-executable file of the app - compiled for YOUR android phone. the app won't be executable without this, but you can delete it and it will be restored after next reboot. for compiling it uses the classes.dex inside the XYZ-1.apk zip archive (see 1.)

3.

/data/data/XYZ

-> this is the data folder of your app. it will be created on install (from the content in the .apk's res, lib and assets folders) and be changed by your app. If you choose "delete data" in the settings - apps menu, this folder will be reseted to the default data, using the .apk file located in (1.)

-> so it's save to delete the contents of this folder, but it will be restored on next start of the app

SO:

even if you use A2SD (/data/app located on ext2 partition on the sd card) or Apps2SD (.apk files are stored on /sdcard/.android-secure and mounted to /mnt/asec ), you still will have the same space or even a bit more in the /data/dalvik-cache and the /data/data/ folders.

You can solve that problem by following the sections B and C in this guide (changing the partition sizes in order to get more free space, section B and moving data or dalvik-cache to sd card, section C).

--

A note to A2SD vs. Apps2SD: Using Apps2SD you will get problems when the SD card is not mounted. Using A2SD (ext2 partition on sd card), you can even connect your phone to the PC using USB and dismount the SD card on the phone to mount it on the PC - the ext2 A2SD partition will still work. But if you use Apps2SD (/sdcard/.android-secure folder), then something won't work if you unmount the sd card.

Also important: if you use A2SD, then you shouldn't use the Move2SD function from the android 2.2 system or the Apps 2 SD app that is a frontend of this. Explanation: if you have A2SD then all your apps will be installed to /system/sd automatically, i.e. to the sd card. However they appear to be "on the phone" if you use the Apps 2 SD app or have a look in settings - apps. If you move them to the sd card, then they will be moved to the /sdcard/.android-secure dir, i.e. from SD card to SD card. So that`s kind of useless.

As the .apk files (in 1.) are supposed to be accessed only when installing the app, re-creating the dalvik cache file or deleting the data of the app (reseting it to default data), there generally is no performance issue using A2SD. I therefore highly recommend it.

--------------------------------------------------------

B changing partition sizes (to get more space from unused space in system and cache):

Perhaps you can get more space from unused spare space in the /system and /cache partition. Example:

Before:

/system 210 MB - 125 MB used - 85 MB free (=wasted!)

/cache 40 MB - 2 MB used - 38 MB free (=wasted!)

/data 210 MB - 200 MB used - 10 MB free (problem with space, warning that no space left!)

After:

/system 128 MB - 125 MB used - 3 MB free

/cache 4.5 MB - 2 MB used - 2.5 MB free

/data 330 MB - 200 MB used - 130 MB free ( :-) )

How to change your partition layout:

(no root required; works with ALL ROMs)

1. create an nandroid backup, either

* using clockwork recovery, pressing Volume Down while pressing power on button on startup)

* or using ZTE-Blade Recovery Manager or some other nandroid backup tool.

2. download the partition layout suitable for your /system size ([Custom] ROM size), e.g.:

* 128 MB system, 4.5MB cache: shrink_cache_sane.zip by wbaw

(MD5 sum: 5eb8c0f5bba4e02fe30b86a96eb64ef8)

Caution! Not all ROMs will work with a 128 MB system partition. If your ROM is bigger, you must install a bigger partition layout. Or you can uninstall apps from the /system/app folder that you don't need or reinstall them in /data/app. How to do this? 1.) Download the App "Uninstaller for Root" from the market, 2.) Backup the /system/app/XYZ.apk of the App to your sdcard (using "Uninstaller for Root" or manually). 3.) Install the XYZ.apk from your sdcard (in the folder 'RootUninstaller') using a File manager. For example, Google maps (Maps.apk) is around 5 MB.

* other layouts you can get from the thread Partition layout change or Partition Mod for Japanese Jellyfish RLS9 (you just need the 2 files appsboot.mbn and partition_zte.mbn from the archives)

* Caution! the 2 files 'appsboot.mbn' and 'partition_zte.mbn' really shouldn't be corrupted because that potentially could permanently damage (brick) the phone. Therefore you should always check MD5 checksums, e.g. using md5sum tool for windows.

3. create a new dir on your SD card, 'image'. low case.

copy the content of shrink_cache_sane.zip in this folder (appsboot.mbn and partition_zte.mbn). Then copy the bin files from your nandroid backup to this folder, boot.img, recovery.img, system.img, data.img.

Then rename data.img to userdata.img

4. Perhaps you also need the files 'appsboothd.mbn' and 'partition.mbn'. I'm not sure if they are necessary. You can get them from a TPT (Total Phone Transfer) Image Zip-File, e.g. from Japanese Jellyfish RLS9 (download the Japanese_Jellyfish_RLS9_image.zip).

I have tested it only with these files, however perhaps they aren't necessary.

5. Now you should have a directory "image" on your sd card, containing these files:

* appsboot.mbn

* partition_zte.mbn

* boot.img

* recovery.img

* system.img

* userdata.img.

* appsboothd.mbn

* partition.mbn

6. ensure your battery is not empty, then turn on your phone with volume up button pressed. some green text will appear ("Update from T-Card" or something like this). If it doesn't work, try pressing volume up and menu button.

7.: wait for the process to complete (2mins max.)

8. Now you should have partition sizes changed and about 100MB more free space left

9. After loading the new firmware, it makes sense to rename the /image folder, such as to /flashedimage, so that it cannot be accidentally reflashed again in the future.

"How do I undo this?"

-> have a look in the standard solutions thread at the very bottom ("I have changed my partition sizes to have a 128MB system, I want to change it back"). Using this partition layout you can switch back to the standard partition layout:

No ROM, Just 2 Clockwork partitions, sets all partitions back to stock, you will need to use the Mounts/USB Mount in clockwork to put a ROM back on

http://www.mediafire.com/?xtckadj09b7sxt2

(MD5: C8010D841AF463F3CB1FDEDFFAFA3B1E )

Note: the /cache partition is only needed for downloads from the market. If you want to download an app bigger than 4.5 MB, you will have to move the /cache directory to /data. For this you can use the redirect_cache_jj9.zip from the Partition Mod for Japanese Jellyfish RLS9 (works with all ROMs)

--------------------------------------------------------

C moving data or dalvik-cache to sd card:

(root needed or a custom ROM with A2SD+ support)

The last possibility is to move either /dalvik-cache or the /data/data dir to your sd card. Be careful! I don't recommend that because your system possibly will be slower because the SD card is supposed to be much slower than the ROM drive.

The dalvik cache will be accessed every time an app starts, it will transfer the compiled files from the cache to the memory. So the start of an app will be slower perhaps but then it's okay (however as we know, android often terminates or pauses apps in background and they are "silently restartet" if you switch to them again, so also this will be slower).

The /data/data/ dir will be accessed by the apps, e.g. browser cache. So it depends on the app if it will be slower because of the moved folder.

How to move the data folder or dalvik-cache:

Sometimes this is also meant by the term "A2SD+". Some Custom ROMs support it (e.g. MoDaCo Custom Froyo Beta11, according the comparison table). So if you use MoDaCo Custom Froyo Beta11 and have A2SD enabled (by having created the ext2 partition on the sd card as explained in section A), then also the dalvik-cache will be moved to the sd card.

However you also can do it by yourself if you already have A2SD enabled (this is necessary!).

start the terminal and type (without |):

in order to move /data/data:

| su

| cp -pr /data/data /system/sd

| rm -r /data/data

| ln -s /system/sd/data /data/data

Be careful! you will loose all your application data if this fails. however usually the default data can be restored by android using the .apk file. I recommend creating a Titanium Backup before doing this (as well as an nandroid backup).

and in order to move dalvik-cache:

| su

| cp -pr /data/dalvik-cache /system/sd

| rm -r /data/dalvik-cache

| ln -s /system/sd/dalvik-cache /data/dalvik-cache

If the dalvik-cache should get lost, it's not such a problem because it will be easily recreated on reboot (taking some minutes the first time). However, the dir /data/dalvik-cache should exist and be accessible for the system (or the according symlinked dir).

Caution! If you do this, most of the apps or even the whole system won't work if the whole SD card is ejected / unmounted!

So if for example the symlink directs to /system/sd, but the sd card is not in the phone, perhaps the system won't be able to boot. In such a case you should insert the sd card and then boot again or boot into recovery mode (e.g. Clockworkmod), then connect the phone to the PC and remove the symlink using adb shell and recreate the dir /data/dalvik-cache.

Note that when using A2SD+ with a Custom ROM you won't get that problem because it has a boot script checking if the sd card is present and so being able to boot with the normal location of dalvik-cache in case that the sd card isn't there.

-

you need to move the dirs to the ext2 partition on the sd card (/system/sd) and not to the FAT32 partition, because an ext2 partition is able to preserve the file attributes (owner, permissions) and it can also be accessed when the FAT32 partition of the SD card is unmounted (when you connect the phone to the PC by USB).

Note: you can also just move some dirs, e.g. the biggest ones like the browser or TTS dirs.

Generally I recommend to only use A2SD+ respectively move these dirs if you really need the space and haven't yet enabled A2SD and changed the partition sizes. And if so, I recommend to first move the /data/data dir (or some subdirs of it) and only at the very end, if you really need more space, to move the dalvik-cache.

---------

So i guess this should solve all the "Not enough space" issues....

----------

Thanks to oh!dougal for some improvements.

Update: Posted this as a standalone Guide:

[GUIDE] How to get more FREE SPACE for your apps

Edited by ztedd
Link to comment
Share on other sites

Thank you very much for the very good explanation and how-to`s ztedd ;)

BUT

As I can see that I have something mounted in system\sd - I see folder app and app-cache I`ll probably have to move data folder as well. In systems\sd\app (as well as in \data\app) I see 144 MB used and 750 Mb free space but when I try to install more apps, when I reach ~180 Mb used (thats the internal storage of Blade) I get information that memory is full and I cant install anymore.

Do you think that moving the data/data folder to system/sd/data will be enough for my blade to show me that I have 750 Mbytes free ?I check the amount of the free internal space under main screen->options->SD card storage so I think it should be increased there to work properly ?

Btw.: I have always clockwork backup done so I can test anything and not worry because I can (and I did) restore everything in 15 minutes ;)

Link to comment
Share on other sites

you have to move the data and make a symlink too

Yeah - I did the movement of DATA folder and did symlink (ln - s). After reboot phone seems to work ok (I`m not sure but I think it seems a little bit faster thou).

still in options->Sd card information I have 144 Mb free not 750 mb free, I`ll check at home when I install some big apps if this shrinks a lot ;)

So now I have on my ext2 partition:

\system\sd\app

\system\sd\app-cache

\system\sd\data

all of which are pointing to respectively:

\data\app

\data\app-cache

\data\data

I`m not moving dalvik-cache for now. I`ll see if the movement of data was enough for me to use that extra ext2 space.I`ll keep you posted about progress ;)

Edited by bipbop
Link to comment
Share on other sites

Guest Phoenix Silver

great it's just fine how you are

you'll see later if you need to move the cache

why do you use ext2 and not ext3 ?

you take the risk of data corruption

Link to comment
Share on other sites

great it's just fine how you are

you'll see later if you need to move the cache

why do you use ext2 and not ext3 ?

you take the risk of data corruption

I`ve read somewhere that ZTE Blade only supports Ext2 and not Ext3 - I know it`s little OFT but what`s the difference in Android phones between those two ?

Link to comment
Share on other sites

Guest Phoenix Silver
I`ve read somewhere that ZTE Blade only supports Ext2 and not Ext3 - I know it`s little OFT but what`s the difference in Android phones between those two ?

no ext3 is supported no problem ;) i use it

ext3 has journaling for files corruption

Link to comment
Share on other sites

ext3 has journaling for files corruption

but ext3 has problems when undeleting files and ext2 doesn`t ;) I`ll stay with ext2 if it doesnt give anything to speeed or lower battery consumption.

Link to comment
Share on other sites

but ext3 has problems when undeleting files and ext2 doesn`t ;) I`ll stay with ext2 if it doesnt give anything to speeed or lower battery consumption.

Furthermore, ext3 is supposed to take more space than ext2. I dont't think that file corruption really is a danger - at least I didn't experience anything like that and haven't heard about anyone who had such a problem.

Remember some discussions here about ext2 vs. ext3 resulting in the advice that it's okay and somehow best to use ext2.

After reboot phone seems to work ok (I`m not sure but I think it seems a little bit faster thou).

Having more free space left won't affect the speed of your android - there is no such thing as a "swap file on the data partition" that could get buggy if there is little space left. Also fragmentation is not an issue on flash drives (it only was on pc hard drives). Little space will just result in not being able to install any more apps.

However what possibly could be a performance issue is the speed of the internal flash memory vs. the sd card. This could be important if apps use big data and have to access them quite often. But in fact I don't think that you will really notice any big difference after moving the /data/data directory to the sd card.

still in options->Sd card information I have 144 Mb free not 750 mb free, I`ll check at home when I install some big apps if this shrinks a lot
In options->Sd card you just see the FAT32 partition of the sd card. To get a better overview, open terminal or adb shell and type:

busybox df -h

If there are too many lines, type:

busybox df -h | head

If you don't have busybox installed, just type:

df

You will get an output similar to this:

Filesystem................Size........Used.......Available.....Use%......Mounted on

/dev/block/mtdblock6......324 M.......210 M.......114 M........65%......./data
/dev/block/mmcblk0p2......457 M.......223 M.......210 M........52%......./system/sd
/dev/block/vold/179:1.....3.2 G.......2.7 G.......531 M........84%......./mnt/sdcard[/codebox]

Actually there are some more lines, these are the interesting ones. /data is the data partition on the internal flash memory, /system/sd is the ext2 partition on the sd card and /mnt/sdcard is the sdcard.

In settings - sd card you can only see the free space of /data and /mnt/sdcard, however /system/sd won't appear there.

Edited by ztedd
Link to comment
Share on other sites

Guest bigmc88
you can see if A2SD is working if you browse to /system/sd folder and check if there is something inside. /system/sd is the ext2 partition on your sd card.
.

am I browsing to the filer app on my phone to look for this? if so i get to /system then system/media not system/sd folder. thoughts anyone?

Edited by bigmc88
Link to comment
Share on other sites

.

am I browsing to the filer app on my phone to look for this? if so i get to /system then system/media not system/sd folder. thoughts anyone?

for browsing the dir you need root access. try rootexplorer. alternatively (without root) type in terminal "df" to see if there is some space used on /system/sd (as described in the post above).

Edited by ztedd
Link to comment
Share on other sites

So I`ve checked yesterday evening and I think I got what I wanted - many many thanks to everybody for the help (especially you ZTEDD ;).

I had 141 Mb free on the memory when I transfered all the data\data to system\sd\data and linked. After this I installed about 30 Mbytes of apps and now I have 138 Mb free - this means that only some cache (probably in dalvik-cache) is being installed on the internal memory and all the rest is in my SD-ext2 partition. COOL. Problem solved and also now I have a full understanding how a2sd works.

Thank again !

Link to comment
Share on other sites

Guest geegeethatsme

Thanks to ztedd for that helpful summary of A2SD vs. 2.2 Move2SD. I was getting totally confused as to what apps were going where on the SD card (running MCR 2.2 r11 on an OLED SF). Soooo, as I had already used the Froyo option to move some apps to SD (FAT32) using Move2SD from the Manage Applications menu, should I move those apps back to the 'phone' to let A2SD do its stuff and stick them on the ext2 partition, leaving me the FAT32 space for data exclusively?

Forgot to say I baked A2SD+ so the Dalvik Cache is also on the SD Card - presumably in the ext2 partition?

Edited by geegeethatsme
Link to comment
Share on other sites

Thanks to ztedd for that helpful summary of A2SD vs. 2.2 Move2SD.

you`re welcome! ;)

Soooo, as I had already used the Froyo option to move some apps to SD (FAT32) using Move2SD from the Manage Applications menu, should I move those apps back to the 'phone' to let A2SD do its stuff and stick them on the ext2 partition, leaving me the FAT32 space for data exclusively?
Yes, that's exactly what I suggest to you. Because having the apps "on the phone", i.e. on the A2SD partition has the advantage that you can even use them if your sd card (FAT32 partition) is mounted to your PC.

Forgot to say I baked A2SD+ so the Dalvik Cache is also on the SD Card - presumably in the ext2 partition?
Yes, if your ROM has A2SD+ moving the Dalvik Cache, then it should also be on the ext2 partition, in fact presumably in /system/sd/dalvik-cache.

Do you notice any lower performance (e.g. startup time of apps) after having a2sd+ enabled?

Link to comment
Share on other sites

Do you notice any lower performance (e.g. startup time of apps) after having a2sd+ enabled?

I did noticed... I`ve installed sooo many apps, that now my system is sometimes slowing down and loading times are very very slower. I have visible lag when running quadrant (especially database write test) and Opera browser. I think I`ll resign from the option of using ext2 with a2sd totally and try to go on with resizing cache , data etc. on the internal memory of the phone so its faster and more stable (I read that it`s possible to get almost 330 Mb of internal memory ;) and that would be enough for my needs ;) ). So today I`ll go for titanium backup for some of my apps, maybe change rom and resize.

Eventually I`ll use Froyo APP2SD option for some little more space.

btw.:I`m using SDHC class 4 8Gb card (made in Japan) so its not so slow ...

Edited by bipbop
Link to comment
Share on other sites

Guest geegeethatsme
(ztedd @ Feb 4 2011, 15:36)

Do you notice any lower performance (e.g. startup time of apps) after having a2sd+ enabled?

Thanks for the quick response ztedd. Moved the apps back and all now on the ext2 partition. I can't say I have noticed any material change in performance with A2SD+, better or worse. I had A2SD on my previous ROM (MCR 2.1 r4), so if there was to be any difference it would presumably be in the read times from the Dalvik Cache. Imperceptible to my eye, and any lag is probably balanced by the improved relative performance of 2.2.

Link to comment
Share on other sites

I did noticed... I`ve installed sooo many apps, that now my system is sometimes slowing down and loading times are very very slower. I have visible lag when running quadrant (especially database write test) and Opera browser. I think I`ll resign from the option of using ext2 with a2sd totally and try to go on with resizing cache , data etc. on the internal memory of the phone so its faster and more stable (I read that it`s possible to get almost 330 Mb of internal memory ;) and that would be enough for my needs ;) ). So today I`ll go for titanium backup for some of my apps, maybe change rom and resize.

Eventually I`ll use Froyo APP2SD option for some little more space.

btw.:I`m using SDHC class 4 8Gb card (made in Japan) so its not so slow ...

Thanks for your answer, that's very interesting. In fact I'm recommending not to use A2SD+ except it is the last possibility for someone to get more free space. The first option should be the changing of partition sizes, then A2SD. Note that App2SD or A2SD should not slow down your system, because the *.apk files are accessed very rarely, only if the dalvik-cache was deleted and needs to be rebuilt or if the default app data need to be restored. So if you change partition sizes (very effective and a real hot hint, by the way) and use App2SD / A2SD, then your system should be smooth as it used to be while having more free space now.
Link to comment
Share on other sites

Thanks also @geegeethatsme. So it seems to depend on which ROM and which apps are used.

However I think a worse performance using A2SD+ would only be really convincing if someone tests loading apps several times with different configurations (dalvik-cache on internal ROM vs. on sd), really stopping the app loading times with a stop watch.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.