sd-ext/a2sd - 128mb free /data: insufficient memory - Desire Q&A, Help & Troubleshooting

Perhaps I don't understand the purpose of sd-ext/4ext/a2sd etc [I'm sure this is the case!]
I'm running the Aurora v3 rom - basically a sense2.1 with an ext partition. I cannot understand why I've 128mb free in /data after installing pretty much all my apps yet I'm getting insufficient storage errors; I can't install anything despite having a lot of /data free- it seems if my sd-ext if nearly full I can't use my /data?
1. The rom's files flash to /system, and a few to /data. As it's large, we partition the sd card with a 4ext part of say 342mb for overspill of the system/data files.
2. If we change the hboot (to cm7) such that the /system is smaller - overflowing into sd-ext - we get a larger /data partition for apps on the internal memory. (I've done this for for Oxygen/Redux roms and had over 340mb /data with no sd-ext.) Thus alpharev say's we'd get 287mb /data.
3. This rom installs apps to /sd-ext, and/or /data[?]; in Android's App usage I'm reporting 152mb used, 135mb free (the 287mb /data?); and 128mb free storage.
4. 4ext recovery reports 1.7mb free of 342mb for sd-ext - it's full. Which makes sense if apps install to /sd-ext, but why not fill the internal /data first? adb shell df -h gives:
Code:
Filesystem Size Used Available Use% Mounted on
/dev/block/mtdblock4 5.0M 796.0K 4.2M 16% /cache
/dev/block/mmcblk0p1 7.1G 4.5G 2.6G 63% /sdcard
/dev/block/mtdblock5 287.6M 159.3M 128.3M 55% /data
/dev/block/mmcblk0p2 331.3M 329.6M 1.7M 99% /sd-ext
/dev/block/mtdblock3 145.0M 122.8M 22.2M 85% /system
5. To me this means /data has 128mb free for apps; sd-ext is full with system files and apps - seeming to me that apps take space up on both /data and /sd-ext, duplicating space usage. Obviously I'm wrong on this but that's how I see my space disappearing lol Yet I cannot install any apps as I've insufficient storage.
6. Clearly I'm misunderstanding things after installing just 150mb apps and thinking I'd have 287mb of apps /data, not just /sd-ext: why shrink hboot's /system to make a large /data if the apps go to sd-ext?
7. I've not moved dalvik cache to sd as I thought I'd not need to given the seemingly large /data, and it's free amount. Clearly I can do so but why isn't my /data space available?
Sorry for long post and sounding dumb, I'm really trying not to be!

These Roms use sdext for both Rom and part of the apps and possibly dalvik too. Traditionally it would just be apps and maybe dalvik.
With these bigger roms, you need bigger ext to get the same. Yes when ext is full, you can't install anything. Maybe you need a bigger ext partition
Sent from my HTC Desire using XDA App

Thanks for the reply.
That's what I thought - I just cannot understand why I cannot use the free /data though; what's the point of changing to the CM7 hboot when your /data is limited to that of the sd-ext? Isn't it doubling up on storage use by apps, placing them in sd-ext and /data, and when one is full you can't utilise the other?
Sorry for sounding stupid, it just makes no sense to me.
btw I checked out your dGB, looks great. I do love miinimalist roms but also prize my Sense-720p'd camera!

No its not doubling up. The point is that /data/app and /data/dalvik-cache are symlinked to /sd-ext/app and /sd-ext/dalvik-cache.
However, /data/data where the libs, preferences and databases are, remain on /data/data
So when you install an .apk, it installs the app to /sd-ext/app, the dalvik is created on /sd-ext/dalvik-cache and the libs & db's etc will install to /data/data
If sd-ext is full, there is no where for the apk to go.

Thanks for clearing that up for me, I feel kinda stupid - I just couldn't get my head around it: why the nand wasn't being used for apk placement but I see they are split up and components spread over the combined sd-ext and /data. Thanks!

No probs. Not seen you on AF for a while?

OT
Android Forum? = xda? I've been offline a lot recently as this Indian Summer has made for some prime ultrarunning weather, but also takes a ton of time (by definition) although I've been rocking Redux/Aurora roms recently. Just been perusing the Desire forum today and there's been a ton of awesome rom progress since my last visit. I remember your help and work on Redux/thread/pm, great stuff. Still a beginner but it's very interesting learning this stuff, just also takes a lot of time for a non programmer!
Of potential note, 'found' a bug in gnu parted trying to partition out a 512mb 4ext sd-ext via 4EXTRecovery (madmaxx82 located it, I merely experienced it!) Always feels good to in a tiny way contribute

Related

cache2cache

Can the Desire benefit from using cache2cache? The Hero and Eris both use this in some of the sense roms, not sure if the Desire devs have taken any notice?
-------------------------------
http://forum.xda-developers.com/showthread.php?t=726467
Cache Location (Cache2cache):
By default, the dalvik-cache has been relocated from the internal /data/dalvik-cache/ directory to the internal /cache/dalvik-cache directory. The Eris comes with an internal /cache/ file block of 130mb that is not used! After reviewing a number of xda member file system usage reports (thanks xtrROM and xtrSENSE users!) the MOST reported use of this space was 5%... So by moving the dalvik-cache to this free area you now have over 150mb on internal /data/ for apps and over 75mb in internal /cache/ for dalvik-cache. This means that you can probably install close to 100 apps WITHOUT having to partition and move anything to the SD Card ext!
Well as we have s-off we can just resize the partitions instead It's quite easy to do. BTW I don't remember the std partition layout so can't say if this is really a problem

[Q] partitions, /cache and Apps2SD methodology ??

Ok Im having a few issues with my touch slide 3g -- according to app "partitions info lite" it seems that i have the following partitions:
--------------------------------
Partitions on PHONE:
/dev (209mb) [used 0mb]
/asec (209mb) [used 0mb]
/system (240mb) [used 97mb]
/data (145mb) [used 122mb]
/cache (80mb) [used 78mb)
Partitions on SDCARD:
/sd-ext (457mb) [used 41mb]
/sdcard (14671mb) [used 8387mb]
/com.froogloid.kring.google.zxing.client.android-1 (2mb) [used 0mb]
/fm.last.android-1 (2mb) [used 0mb]
--------------------------------
--------------------------------
I have a 16G sd card for music etc...
and was hoping to move all my apps to an sd-card (ext3 or ext4) partition as we all know the phone doesn't have much storage space, the things that puzzles me are:
1. why is the /cache partition so full and how do i clear it - tried a few "cache clearing apps" to no avail... (cachemate, HistoryEraser, etc..)
2. what are partitions /dev and /asec for?
3. can any partitions on phone be removed? Id really like to resize my /data partition so i dont get 'low space warnings" anymore
4. is there such a thing as "partition magic" for android (to resize the /data partition bigger) ?
5. why the 2 funky partitions on SD? I do have "last.fm" and "key-ring" on the phone and guess i can try un-installing and see if the partitions goes away, but a bit weird for both these apps to require their own partitions...
is there a way to remove the partitions from SD and recoup the space used?
6. Ideally id like to move the /cache partition to the sdcard, or offload my large "copy protected" paid apps to a ext3 partition on my large sdcard. I have heard about "Darktremor Apps2SD" but after i tried it all my apps were gone! - luckily i backed up my rom before hand... guess Im a bit lost and seeing guidance from a guru.
I know there are a lot of questions here, im hoping some kind soul can help, perhaps others might have similar problems.
-s
My device:
---------------------------
HTC Tmobile My touch Slide
S-off
Cyanogenmod 6.1.1 (2.6.29.6)
android 2.2.1
build# frg83

[Q] System computes free space on /data instead of sd:ext

Forgive me if this has been asked/answered before. I found similar threads related to the /system partition, but nothing related to the /data partition.
I'm running a custom ROM with A2SD (sd:ext)-- specifically, an ample 1GB partition on /system/sd. As you're probably aware, /data/app symlinks to /system/sd/app. Currently, I have 52MB free on /data, and 355MB free on /system/sd.
Here is my situation:
I have a large app (74MB) installed in .android_secure. Since I don't want apps in .android_secure (for my own personal irrelevant reasons), I would typically go into Settings->Applications (or TitaniumBackup) and actually move the app to the phone (which puts it into /data/app, hence /system/sd/app). The problem is that the system's move program that moves the app calculates the free space on the /data partition (52MB) instead of the free space in the finer destination, which is /system/sd/app (355MB), and ultimately rejects the move because it doesn't think there is enough free space (when there really is).
I was thinking of resizing the /data partition to "trick" the move program. But the only thing I can really steal space from is the /system partition, which isn't such a great idea. Seeing as my dalvik cache and app data takes up 350MB (or about 85%) of the /data partition, I'm further concerned I might eat up my /data partition, even without apps installed directly on it!!!
How have others dealt with this problem? I've seen some stuff about moving the dalvik cache to the sd card, though there are much better arguments AGAINST doing that.
Any help is much appreciated!
Related commands (FYI):
df -k - Shows the storage allocation and usage by partition
du -hs <path> - Calculates the free space (recursively) for given path. Note: it will not include any data within any symlinks.

Change Download Location for Market/Play?

Apologies ahead of time if this has been answered before. I spent about 30 minutes Googling and trying solutions without any luck.
My situation is that I'm on MikG 3.11 and am using the built in A2SD to store all the apps on a 2GB SD-Ext partition. I have enough apps that the ~160MB internal /cache partition is pretty much filled with Dalvik Cache files in the /cache/dc subdirectory (only 3MB left on the partition).
Unfortunately, Google Play (formerly Market) seems to download app installs and updates into /cache with file names like "Download.apk" and "Download-1.apk" and then installs the apps from there. Since there is so little space, any app above 1.5MB or so fails to download and install (it seems to need the space for the download and then space to extract the download, so you can only get apps that are about 1/2 the size of the remaining partition space).
Is there any way to change where Google Play/Market downloads apps to install? I've got plenty of space on /data or the SD-Ext partition.
I found old directions to fix this issue by entering the following at terminal to create a sym link for Market to download on the SD card:
Code:
mkdir /mnt/sdcard/market-download-cache
su
cd /cache
mv download download.bak
ln -s /mnt/sdcard/market-download-cache download
ls -ahl
Unfortunately, Play/Market no longer uses a "download" sub-directory on /cache, so this won't work.
To fix the problem, I tried using "a2sd cachesd" to free up space on /cache by moving the Dalvik Cache to the SD-Ext partition, but that made for a really laggy experience (presumably because my SD card has bad random r/w access). I could also presumably just unmount the partition from /cache and make /cache a sym linke to a folder on the SD Ext card, but it doesn't seem that would perform much better.
My only thought at this point for a long term solution is to copy the current /cache contents to /system/sd/cache, mount the current partition on /cache at /mnt/cache (unmounting it from /cache first), create a sym link from /cache to /system/sd/cache, then set up a sym link from /mnt/cache/dc to /system/sd/cache/dc. All of this would have the effect of keeping the Dalvik Cache on the same internal partition where it currently resides while letting Play/Market have plenty of space in the new /cache which would actually be a directory on the SD-Ext partition. But, this seems kind of hacky and could negatively impact other things that might need /cache.
My short term solution is that every time I need to install or update apps, I just go into /cache/dc with Root Explorer and delete a bunch of the cached data to free up enough space for the app(s) and then do the update/install through Play/Market. The OS then seems to recreate the cached information the next time I run the app whose cached data I deleted (for example, I deleted the IMDB cached data and the next time I ran IMDB it took a long time to come up but then worked fine-- presumably the delay was recreating the cached data/app). The OS also seems to recreate the dalvik cached files on boot (not sure if that is a general feature or just in the MikG ROM I'm using).
In any case, I think all of the above is accurate so even if nobody has better solutions, maybe this will help others understand why they can't install/update apps even though it seems they have plenty of space.
If anybody is out there that has a good long term solution to this (like a place you can change the directory where Play/Market downloads), please let me know.
It's probably not cool to respond to your own post, but I had another idea for fixing this problem:
It looks like /data has 140MB of space left on it-- could I move the Dalvik Cache to that partition so there would be plenty of space on /cache to let Market/Play work?
As far as I can tell, /data/dalvik-cache is already a link (maybe a hard link?) to /cache/dc, so presumably I could just switch that to the Dalvik Cache was actually on /data?
Any thoughts on whether this would work and if it is a good idea or bad idea?

[1.4][AROMA][MOD][GB/ICS][Aug19-2012] DataSwap + Auto SD-EXT & SD-Swap Enabler

Tested Roms (will not test SD-SWAP on most)
These are some roms I've tried the enabler on, since I don't use a swap partition on my SD card I don't bother testing it and usually don't advise using SD-Swap. It's only in the enabler for sake of completeness. All sd-ext tests are done as ext4 unless otherwise specified.
Andromadus Slim Bean Build 6 (JB 4.2.2)
DataSwap - OK
SD-EXT - OK
SD-Swap - Untested
Andromadus Mimicry 1.3+ (CM9 ICS)
DataSwap - OK
SD-EXT - OK
SD-SWAP - Not Tested
Andromadus Test builds - Jelly Bean(CM10) - Build #61+
DataSwap - OK
SD-EXT - OK
SD-SWAP - Not Tested
Virtuous Infinity 1.31.0 Alpha3 (Full Sense 4.0)
DataSwap - ISSUES*
SD-EXT - OK
SD-SWAP - Not Tested
*The init script in /system/init.d/80dataswap didn't automatically execute upon boot. However when running it manually it worked fine. (might be fixed in 1.3, have not tested yet).
ILWT CM7 (Build 471) with ILWT CM7 Kernel
DataSwap - OK
SD-EXT (as ext4) - Not Working *
SD-EXT (as ext3) - OK
SD-SWAP - Not Tested
* When /sd-ext formated as ext4 was not working, I used 4EXT recovery to format it to ext3 under tools -> wipe/format => ext3, rebooted and it worked.
Gen.Y VisionX B4
DataSwap - FIXED*
SD-EXT - OK
SD-SWAP - Not Tested
*Fixed in 1.3 to include the busybox prefix, 1.4 to include shebang (#!) string.
UPDATED Aug 19th 2012
v1.4 Changes from 1.3
Added shebang (#!) string to dataswap scripts
Changed init script permissions from 750 to 755
v1.3 Changes from 1.2
Updated dataswap script to use busybox prefix for swapon/mkswap
Updated SD-Swap to use busybox prefix
v1.2 Changes from 1.1
Added addon.d support for supporting Roms
v1.1 Changes from 1.0
Fixed a bug where 96MB option installed 64MB
Added 128MB DataSwap Option
Added ability to enable SD-Swap (choose w/ Sd-Ext if SD-Ext partition exists, without w/o)
Changes from previous version (1.0):
Migrated to Aroma 2.50 Installer
Removed SD-Swap activation from SD-Ext Enabler Script
SD-Ext Init Script made smaller (Specific to HTC Vision/G2/Desire-Z now)
Now with the Aroma installer allowing for an easier selection of mods to be applied.
DataSwap Enabler
64MB DataSwap (Recommended for some Roms)
96MB Option (heavier multitasking)
Skip/Off (do nothing, skip to next mod)
Remove (removes the swap file and swap script)
SD-Ext Enabler
Enabled (detects and migrates /data/app and /data/app-private to /sd-ext)
Skip/Off (Do nothing, leaves as-is)
Revert (Moves all apps from sd-ext back to /data and removes script)
SD-Swap Enabler
Enabled w/ SD-Ext - does not enable Sd-EXT, simply enables SD-Swap correctly if SD-Ext partition also exists
Enabled w/o SD-Ext - enables SD-Swap when no SD-Ext partition exists on the SD card
Skip/Ignore - Does nothing/skips
Remove - Removes the SD-Swap enabling script
Do not enable SD-Swap if your Rom Already supports SD-Swap out of the box (elitemod, etc), so double check first.
If you don't have an SD-Ext partition, then Swap partition will be the 2nd partition on the SD Card, otherwise it's the 3rd. Thus why the installer makes the distinction for with and without SD-Ext when it comes to SD-Swap options.
Regarding addon.d support
In roms that support /system/addon.d, during an upgrade (flashing a new rom) shell scripts in /system/addon.d would be utilized by the backuptool allowing the ability to upgrade the rom without having to re-flash the extra roms.
For example in my /system/addon.d/ folder there will be a 60-kbeezie.sh script when flashing version 1.2. If you were to upgrade your rom (for example Mimicry 1.3.2 to 1.3.3), the dataswap, sd-ext, sd-swap init scripts will be backed up, and then restored after the new rom has been upgraded (the same way google apps is preserved in the 1.3.3 upgrade, so no need to re-flash google apps).
So on any roms that support addon.d, you'll be able to upgrade your rom to the next version without having to reflash the dataswap/sd-ext enabler.
What is DataSwap
Dramatically improves multitasking. (Can be used with or without SuperChargerV6).
In layman's terms it's a swapfile placed in the /data partition, where it should be faster than using a swap partition on the SD card. Unlike SDSwap repartitioning is not needed. Every reboot removes and re-adds the file so that the file isn't working on one specific part of the emmc chip all the time (one of the downsides to SD Swap).
More information can be found on the original DataSwap post by Nik3r
http://forum.xda-developers.com/showpost.php?p=27608489&postcount=153
What is SD-EXT
The /sd-ext mount is a partition on the SD card formatted as ext4 allowing you more app storage space. Unlike other means of running apps off an /sd-ext partition, this mod/script only maps /data/app and /data/app-private to the /sd-ext leaving caching and other features on the internal memory where it is most efficient.
Because SD-EXT in this case is replacing your /data/app and /data/app-private you want to ideally make it bigger than your /data partition (no less than 1.5GB, 2GB is a good fit). However bear in mind that if you wish to revert back to using only internal storage, you'll want to make sure that your /data partition has enough room for the applications to be moved back.
Why Both Together?
When all the user apps are placed on /sd-ext you are typically freed of roughly 600-700MB of storage on your /data partition. Doing so gives the swap file more room to move about the /data partition, but also splits the I/O (input/output traffic) between your SD card for apps, and internal memory for swap/cache, which may improve the overall experience (and may also prolong the life of your device... in theory).
Also You are not as likely to run the risk of /data suddenly running out of memory because a 64MB swap file is created on top of your app space. (i.e.: say you only have 70MB free in /data from all your apps, and you reboot to apply DataSwap but not SD-EXT, your /data would become dangerously close to being full when the swapfile is created). Hence DataSwap should be used in conjunction with SD-Ext.
Tips
If you currently use EliteMod ICS, you should be able to use this zip to revert a SD-Ext installation back to internal memory. Just make sure you re-partition the SD card after reverting so that EliteMod's init script doesn't automatically move the applications back to sd-ext upon the next reboot.
The effect of DataSwap will greatly depend on how your rom handles memory. For example on Mimicry with SuperChargerV6 option selected, the DataSwap will rarely be used, but it is handy for rapid burst of memory when apps need it. Without SuperChargerV6 the dataswap does get used a bit more often with more apps active in memory, but the extent of it varies on your rom's configuration.
If you're considering reverting SD-EXT apps back to the internal memory the following command will show you partition usage (can be run in either terminal emulator, or adb shell):
Code:
busybox df -hm
With an output similar to this:
Code:
Filesystem Size Used Available Use% Mounted on
tmpfs 183.6M 60.0K 183.5M 0% /dev
tmpfs 183.6M 0 183.6M 0% /mnt/asec
tmpfs 183.6M 0 183.6M 0% /mnt/obb
/dev/block/mmcblk0p25
549.2M 236.1M 313.1M 43% /system
/dev/block/mmcblk0p26
1.0G 239.8M 834.1M 22% /data
/dev/block/mmcblk0p27
295.3M 25.5M 269.7M 9% /cache
/dev/block/mmcblk0p28
20.6M 14.7M 5.9M 71% /devlog
/dev/block/mmcblk1p2 2.0G 374.4M 1.6G 19% /sd-ext
/dev/block/mmcblk1p2 2.0G 374.4M 1.6G 19% /data/app
/dev/block/mmcblk1p2 2.0G 374.4M 1.6G 19% /data/app-private
Note how above /data has 834MB available, and /sd-ext is using 374MB, meaning /data will have enough room for the apps if you wish to revert.
DISCLAIMER
There is no guarantee this will work with all Roms, I've only tested it on a small handful of ICS roms (mimicry 1.3.1, EliteMod ICS). It is known to be skittish/non-working with most GB roms.
Do not ask if this would work on JellyBean, there's quite a bit of work that still needs to be done with JellyBean, and trying this on an alpha/preview JB rom will not likely work, plus I won't provide any support for someone complaining that it doesn't work on JellyBean as I'm not using JB right now.
Credits and Thanks
Thanks to Nik3r who originally wrote both scripts for his own EliteMod ICS Rom which provides both of these features natively to the rom (DataSwap is a seperate zip, but the rom itself already has SD-Ext/Swap support built in).
Thanks to blk_jack for providing support and information regarding the Aroma installer and assistance in testing swap on mimicry.
Checking if it worked
Typing free in either Terminal Emulator or adb shell, should show the approximate dataswap size on the swap line:
Code:
total used free shared buffers
Mem: 375916 372156 3760 0 4352
-/+ buffers: 367804 8112
Swap: 65532 17132 48400
For checking to see if SD-EXT is active, you can use the following command in terminal emulator or adb shell
Code:
adb shell busybox df -hm
Code:
Filesystem Size Used Available Use% Mounted on
tmpfs 183.6M 60.0K 183.5M 0% /dev
tmpfs 183.6M 0 183.6M 0% /mnt/asec
tmpfs 183.6M 0 183.6M 0% /mnt/obb
/dev/block/mmcblk0p25
549.2M 235.9M 313.3M 43% /system
/dev/block/mmcblk0p26
1.0G 287.8M 786.1M 27% /data
/dev/block/mmcblk0p27
295.3M 73.9M 221.3M 25% /cache
/dev/block/mmcblk0p28
20.6M 8.8M 11.8M 43% /devlog
/dev/block/mmcblk1p2 2.0G 362.5M 1.6G 18% /sd-ext
/dev/block/mmcblk1p2 2.0G 362.5M 1.6G 18% /data/app
/dev/block/mmcblk1p2 2.0G 362.5M 1.6G 18% /data/app-private
/dev/block/vold/179:65
12.8G 7.8G 5.1G 61% /mnt/sdcard
/dev/block/vold/179:65
12.8G 7.8G 5.1G 61% /mnt/secure/asec
You'll see that /sd-ext /data/app /data/app-private are identical in their capacity, usage and free space.
AGAIN there is no garantee it will work in every rom, if you do find success with it, post what rom and version you are using.
ALWAYS PERFORM A NANDROID BACKUP BEFORE APPLYING MODS JUST IN CASE
MD5 Checksum for kbeezie_dsext_enablerv1.4.zip: b0d00d89f265c57ba2aee0d7dc5ead24
you've moved really fast i can't keep up
great job.
any support for GB? did anyone try that on GB? or is it impossible?
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Riro Zizo said:
you've moved really fast i can't keep up
great job.
any support for GB? did anyone try that on GB? or is it impossible?
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Click to expand...
Click to collapse
I supposed its possible both features are just init.d scripts. But I don't know enough about the shell scripting differences between GB and ICS to know whether or not there will be conflicts. In theory you could take the sdparts init from elitmod cm7 and replace it in the zip (or I can when I get home)
The data swap one is very simple and may work without a problem, I'm more concerned about the sdext part.
Sent from my T-Mobile G2
kbeezie said:
I supposed its possible both features are just init.d scripts. But I don't know enough about the shell scripting differences between GB and ICS to know whether or not there will be conflicts. In theory you could take the sdparts init from elitmod cm7 and replace it in the zip (or I can when I get home)
The data swap one is very simple and may work without a problem, I'm more concerned about the sdext part.
Sent from my T-Mobile G2
Click to expand...
Click to collapse
it's currently 2:07am here so you'll do it when you get home
at first try the data swap (since you have high hopes, and since i'm more interested in it), then try the sdext...
data swap can be used without sdext, but as you mentioned, using both allows the data swap file to have more physical space to move around on every reboot...
but if everything woked out, i'll be using the data swap without sdext... cuz i really don't have sd space (i dunno why)
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Riro Zizo said:
it's currently 2:07am here so you'll do it when you get home
at first try the data swap (since you have high hopes, and since i'm more interested in it), then try the sdext...
data swap can be used without sdext, but as you mentioned, using both allows the data swap file to have more physical space to move around on every reboot...
but if everything woked out, i'll be using the data swap without sdext... cuz i really don't have sd space (i dunno why)
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Click to expand...
Click to collapse
Yea I mean if you flash the zip and don't have an sd-ext partition, nothing should happen, since it'll only activate if it see's an sd-ext partition.
And to see what I mean about the dataswap init script, this is all it is:
Code:
# Enables swap on data partition
# file is /data/local/swap
# POI: this can be used along with sdcard swap partition
# the load will be automatically evenly divided between the two locations
mv /data/local/swap /data/local/swap.old
busybox dd if=/dev/zero of=/data/local/swap bs=1M count=64
chmod 0600 /data/local/swap
mkswap /data/local/swap
swapon /data/local/swap
rm -f /data/local/swap.old
All it does is move the swap file to old (which course only does it if it exists), create a file of 64MB, make it a swap file, and turn it on. Rinse and repeat every time you boot up the phone.
I doubt those commands changed much from GB to ICS. The 04sdcardparts file on the other hand is around 240 lines. I'll unpack the one from EliteMod CM7 and run a diff on them to see if they're any different (if not, its because he simply migrated his latest work from ICS that he's currently on, to CM7 to fix the bug, which I think you were the one to report initially).
But yea as long as you understand the caveats of using DataSwap without an sd-ext I don't think it would be a major problem (just probably wouldn't perform as well in my opinion since you're accessing the same device for both swap and standard apps).
kbeezie said:
Yea I mean if you flash the zip and don't have an sd-ext partition, nothing should happen, since it'll only activate if it see's an sd-ext partition.
And to see what I mean about the dataswap init script, this is all it is:
Code:
# Enables swap on data partition
# file is /data/local/swap
# POI: this can be used along with sdcard swap partition
# the load will be automatically evenly divided between the two locations
mv /data/local/swap /data/local/swap.old
busybox dd if=/dev/zero of=/data/local/swap bs=1M count=64
chmod 0600 /data/local/swap
mkswap /data/local/swap
swapon /data/local/swap
rm -f /data/local/swap.old
All it does is move the swap file to old (which course only does it if it exists), create a file of 64MB, make it a swap file, and turn it on. Rinse and repeat every time you boot up the phone.
I doubt those commands changed much from GB to ICS. The 04sdcardparts file on the other hand is around 240 lines. I'll unpack the one from EliteMod CM7 and run a diff on them to see if they're any different (if not, its because he simply migrated his latest work from ICS that he's currently on, to CM7 to fix the bug, which I think you were the one to report initially).
But yea as long as you understand the caveats of using DataSwap without an sd-ext I don't think it would be a major problem (just probably wouldn't perform as well in my opinion since you're accessing the same device for both swap and standard apps).
Click to expand...
Click to collapse
well, i have sdswap that is on too so this might increase multitasking and swap speed a little more...
the data swap commands, is this it? all of it? cuz i can just copy past them into a .sh file and execute the script at boot... is it legit if i do that?
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Riro Zizo said:
well, i have sdswap that is on too so this might increase multitasking and swap speed a little more...
the data swap commands, is this it? all of it? cuz i can just copy past them into a .sh file and execute the script at boot... is it legit if i do that?
Click to expand...
Click to collapse
Yea that's all of it, the zip basically installs it by doing:
Code:
...
package_extract_file("system/etc/init.d/80dataswap", "/system/etc/init.d/80dataswap");
package_extract_file("system/etc/init.d/04sdcardparts", "/system/etc/init.d/04sdcardparts");
ui_print("Modifying permissions...");
set_perm(0, 0, 0775, "/system/etc/init.d/80dataswap");
set_perm(0, 0, 0775, "/system/etc/init.d/04sdcardparts");
unmount("/system");
...
So technically if you want to do it manually all you have to do is save that as 80dataswap in /system/etc/init.d and make sure to set chmod 0775 on it, and reboot.
I just took a look at the one on EliteMod CM7, it's different and a heck of a lot smaller. It's a file called 10apps2sd and only 39 lines. I'm almost wondering though if other aspects of the /sd-ext partition are in other init scripts (i.e.: initialized variables and such set before reaching that level of the init).
Also the EliteMod CM7 thread doesn't seem to make any mentions of DataSwap, was probably only created for his ICS rom (though the script seems like it'd work on just about any rom supporting those commands and had enough free space to work with).
In fact because nothing has changed dataswap wise from his own dataswap zip you could just grab it from his thread whichever size you want and flash it. It'd be identical to this bundled one without the sd-ext.
well init.d commands are supported for all Vision ROMs, and i'm sure they are supported on CM builds. so now the problem only lies on auto-sdext for GB.
EDIT: ok, before i reboot:
i have a 128MB sd swap already active... how do i know that the 64MB data swap is active too?
you knew that by noticing the 64MB in "free"command ... but i already have a 128MB swap in "free" command
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Riro Zizo said:
well init.d commands are supported for all Vision ROMs, and i'm sure they are supported on CM builds. so now the problem only lies on auto-sdext for GB
Click to expand...
Click to collapse
Got a suggestion for a good GB-based rom you were thinking of?
kbeezie said:
Got a suggestion for a good GB-based rom you were thinking of?
Click to expand...
Click to collapse
lol, tsubus in his ILWT thread was talking about it 2 days ago... if it works, i might switch back to his ROM
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Riro Zizo said:
lol, tsubus in his ILWT thread was talking about it 2 days ago... if it works, i might switch back to his ROM
Click to expand...
Click to collapse
Well later tonight (i.e.: after the hours someone might likely call/text), I'll give ILWT a try. Will install it clean, install some apps, then apply the mod, then install some more apps so that I know 1) already installed apps get moved, and 2) it continues to work even if you reboot.
kbeezie said:
Well later tonight (i.e.: after the hours someone might likely call/text), I'll give ILWT a try. Will install it clean, install some apps, then apply the mod, then install some more apps so that I know 1) already installed apps get moved, and 2) it continues to work even if you reboot.
Click to expand...
Click to collapse
i've configured the dataswap script... i'll reboot and report now
EDIT: ready for the big news? IT WORKS!
before the reboot, i had about 128MB sdswap on, and 166MB free in the /data partition.
afterr reboot, i now have 197MB swap (which is 128MB + 64MB... + the extra numbers ) and 95MB free in /data...
now with the deletion of some bloat apps (i have about 210 apps) i might get over 100MB free in /data, that way the file could have some space to physically move...
i'll throw my 5 thanks of the day to you now
EDIT: whoa! now with that much extra RAM, i think i should bump up my VM heap size.
EDIT: something weirrd just happened:
while i uninstalled 2 apps (100 floors and its official cheats) i went to check /data's free memory and it showed me 163MB, that's only 3MB "eaten" by the dataswap. so i went to terminal and saw that the total is still 197MB... is it because the file has a "dynamic" size? (meaning it gets larger when it needs to) or is it a constant size... and if it has a constant (64MB) size, what just happened with my /data partition?
———————————————————
i didn't mean to mock you or to offend you in any kind of way
The dataswap file would be a prefixed size, i.e.: if it was created as 64MB it stays as 64MB, what it consumes internally may vary, but its always eating least 64MB of the /data partition.
You could always run something like du -hs /data/*
to see what is using what space.
In other news the swap seems to be maxing out on mimicry (but I wonder if it's because a 1.3GB app is being installed from the play store and is using all the ram and then some), on elitemod it normally wouldn't get higher than 40mb or so.
ok, i confirmed this, no need to test it yourself... it practically works on ILWT as there is not much difference between EMCM7 and ILWTCM7...so you might wanna change OP and put that data swap works on GB... although never tested on sense or MIUI.
i can see it's using it a little bit... i mean i opened root explorer, play store, settings, then tapatalk. and when going back to root explorer it restarted... it didn't keep root explorer cached... is there a way to increase swap caching? i mean if i were android i would start caching in swap until i at least use 75% of it
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Riro Zizo said:
ok, i confirmed this, no need to test it yourself... it practically works on ILWT as there is not much difference between EMCM7 and ILWTCM7...so you might wanna change OP and put that data swap works on GB... although never tested on sense or MIUI.
i can see it's using it a little bit... i mean i opened root explorer, play store, settings, then tapatalk. and when going back to root explorer it restarted... it didn't keep root explorer cached... is there a way to increase swap caching? i mean if i were android i would start caching in swap until i at least use 75% of it
———————————————————
i didn't mean to mock you or to offend you in any kind of way
Click to expand...
Click to collapse
I think it's going to vary by the app, the swap is only used when memory is being run out of which is the way you want it to work. Swap shouldn't be used as caching per-se, just mainly as a ceiling for when ram is being used up.
I noticed that when using SuperChargerV6 the swap usage is almost nil, but course SuperCharger may prevent apps from multitasking as much.
I think it's a good idea to use the init.d scripts from the CM9 compatible kernel if you didn't. It basically just removes the support for async init.d ordering but should work everywhere even on AOKP. I had to make sure the scripts run in an order for the ROM installation but alone they don't need the syncing code and it reportedly freezes on CM9.
(EDIT, nevermind, it doesn't really matter since this script is the first of the sequence. Still the extra lines are unnecessary)
Also an "OFF" package may be a good idea
The swap usage is due to the tweaks in elitemod_kernel.sh, when the swap gets full it will slow the phone down to a crawl. That's why supercharger causes problems with swap, it overrides something in there.
nik3r said:
Also an "OFF" package may be a good idea
Click to expand...
Click to collapse
I'd imagine off for dataswap would simply be your original OFF mod zip, since int wouldn't do anything differently. What would be interesting would be an "off" for sd-ext, which I guess would just be a edify script to move /sd-ext/app and /sd-ext/app-private back to /data and then the removal of the init script.
But yea not all roms are designed to be used with swap storage, those that don't normally have a means of using swap on their own may behave differently when that's introduced into the mix, where as your rom actually has been tweaked with the possibility of using swap in mind.
I still get the best battery life and smoothest swap transfer with EliteMod though. (on mimify for example ,the CPU steps are not as frequent, and is a minimum of 245mhz, with no vdd_levels exposed for undervolting).
Well I wonder if it can be done entirely in recovery. I suppose it's as simple as mounting /data and /sd-ext and copying the data, then wiping /sd-ext. All in one neat flashable package. I guess 4EXT is pretty smart about mount points so it may be as simple as
Code:
run_program("/sbin/busybox", "mount", "/sd-ext");
and maybe not
nik3r said:
Well I wonder if it can be done entirely in recovery. I suppose it's as simple as mounting /data and /sd-ext and copying the data, then wiping /sd-ext. All in one neat flashable package. I guess 4EXT is pretty smart about mount points so it may be as simple as
Code:
run_program("/sbin/busybox", "mount", "/sd-ext");
and maybe not
Click to expand...
Click to collapse
I would think so too, but course I'd be more concerned about checking to see if /data will be able to contain the apps stored in /sd-ext if someone went past the 1GB size. But ya I was thinking bout it being done completely in recovery, and just removing the init script from /system after the move and wipe has been done to sd-ext.
Could probably even run_program () a small shell script copied to /tmp.
Well even if it was impossible to check free space and filesizes directly from recovery you can still invoke shell scripts and use busybox. Something like
Code:
run_program("/sbin/su", "/tmp/script.sh");
Even do the move from there. And then share the flashable zip
I admit you are most likely better at shell than I am, I don't use desktop linux outside VM.

Categories

Resources