Put system apps on internal app partition - Android Software/Hacking General [Developers Only]

Hi !
I've made a search but I've found nothing about that. Maybe I don't use the good term...
I'm currently trying to build a ROM for a tablet device (kyros mid 8127) but this model have a really limited system partition of 180mb. It's really small considering porting serious ROM or even just install gapps in system apps...
On the other hand, the app storage partition is far enough for me with its 700mb approximatly.
First, I though to change the mtd partitions. But this is to scary for me as there is no pre-made solution for this model and I don't want to brick my device ^^
So, I'm wondering if it's possible to store system apps on app partition instead of system partition ?
Don't know if this is really possible, but do you guys think I could extract the /system/app folder somewhere on internal app storage partition during ROM installation and symlink the /system/app folder to this place ?

data/app
Swyped on my blade

Yes, data/app is a solution for secondary apps. But I need to move all system apps to free space for framework etc... I've read that all system app can't be moved to data/app cause they'll not work properly from there.
So I'm wondering if we can trick the system just by symlinking system/app to an other location.

Related

Moving apps back to internal memory

I haven't yet found an answer on how to move apps back to internal memory after applying MoDaCo's ROM. Does anyone have the answer?
Can you not adb pull the app off of the sdcard and the adb push them to /system/app?
ekinnee said:
Can you not adb pull the app off of the sdcard and the adb push them to /system/app?
Click to expand...
Click to collapse
format your memory card to fat32 and then do a "factory reset"
ap2sd doesn't support fat32 and it will just place your apps "where they should be" trying to reverse ap2sd would be a big pain in the ass
*note this will wipe your phone*
But why /system/app?
The /system partition only shows 12 MB free for me. The /data partition is where apps normally are, right? My /data partition shows 91 MB free when I df -h, and my phone reports that it has 91 MB of free internal memory. So they should go on the /data partition, right?
I am new to the site and I dont know how to create a new post so I am going to address my issue here. the other day I downloaded a Iphone theme for my touch pro (Raphael) and now I cannot figure out how to restore it bak to the factory settings. I have done numerous hard resets and nothing has worked!!! HELP ME PLEASE!
At least put it in the right forum. This is the Hero forum.
jonnythan said:
But why /system/app?
The /system partition only shows 12 MB free for me. The /data partition is where apps normally are, right? My /data partition shows 91 MB free when I df -h, and my phone reports that it has 91 MB of free internal memory. So they should go on the /data partition, right?
Click to expand...
Click to collapse
are you talking about stock apps or market apps.... they are located in 2 different areas
/system/app -stock
/data/app -market
OR if you wanna get fancy /system/sd/app -market apps with ap2sd installed
I am talking about market apps. I want to move, for example, EasyMoney back to internal memory. There appears to be no way to do it though.
you must be pretty serious about moving them....alright well don't say I didn't warn you about it being a PITA
Code:
mv /system/sd/app/{name of your app} /data/local
*reboot phone with sd card removed*
*hope phone doesn't lock up on you*
Code:
mv /data/local/{name of your app} /data/app
*reboot into recovery and format sd card to fat32 only*
/data/app is a symlink to /system/sd/app.
If I move something to /data/app it goes into /system/sd/app. Which is right where it started.
I'm not sure I'm being understood here. We have apps2sd, which is great. I have a 500 MB partition for my apps. But now I've got 100 MB of internal memory on the phone that I can't use for apps.
I'd like to use some of that for my most frequently used apps.
jonnythan said:
/data/app is a symlink to /system/sd/app.
If I move something to /data/app it goes into /system/sd/app. Which is right where it started.
I'm not sure I'm being understood here. We have apps2sd, which is great. I have a 500 MB partition for my apps. But now I've got 100 MB of internal memory on the phone that I can't use for apps.
I'd like to use some of that for my most frequently used apps.
Click to expand...
Click to collapse
what I was suggesting was moving it from the link on the sd card to local storage, breaking the link, then moving it to where the link originally pointed before ap2sd. Then finally making it so the link will not be recreated.
I understand what you are saying now, but I don't know how you set that variable.... or if it that can even be done. If so, it can't be done easily.
what you're asking is like makeing a raid setup with your nand and your sd card... that's well beyond what I'm capable of doing.
I've moved several stock apps back and forth between /system/sd/app and /system/app without any problems. Reboot after move is a good idea though.
For market apps there might be an issue when upgrading if they are in the /system/app directory, but I haven't tested that.
flactemnad said:
I've moved several stock apps back and forth between /system/sd/app and /system/app without any problems. Reboot after move is a good idea though.
For market apps there might be an issue when upgrading if they are in the /system/app directory, but I haven't tested that.
Click to expand...
Click to collapse
there will be a problem, android market will not mount /system/app when it goes to update an app from the market. I tried this by accident by copying a a stock app and installing it over it's self (was testing a way to easily remove a stock app) locked the phone up.
There is probally no HUGE advantage in having the stock apps on the sd card as most of them (the ones accessed frequently... widgets etc) would be accessed from the much slower sd card as apposed to the much faster NAND.
The reboot is almost required if the app is running, if you do manage to move the file that's not in the middle of a read you'll get the dreaded com.android.core popup (infinately repeated unable to work around) So it's highly suggested that the app is not running in the backround, or widget on the desktop.
I also highly reccomend the restart when attempting to move apps from your /data/app or /system/sd/app note /system/sd/app is mounted... but not to be confused with any other part of /system
by mistake i deleted the visual voicemail app that comes with the phone and i was wondering if somebody could help me putting it back into the phone, i have the .apk file on my computer already
johnsongrantr said:
there will be a problem, android market will not mount /system/app when it goes to update an app from the market. I tried this by accident by copying a a stock app and installing it over it's self (was testing a way to easily remove a stock app) locked the phone up.
...
Click to expand...
Click to collapse
Thanks for the heads up. I don't have any market apps installed under /system/app, but I do have some stock apps on the sd that I can easily move back to straighten things out to a more proper setup.
aim1126 said:
by mistake i deleted the visual voicemail app that comes with the phone and i was wondering if somebody could help me putting it back into the phone, i have the .apk file on my computer already
Click to expand...
Click to collapse
nvm found an app on the market called apk installer, worked perfectly

How to get more internal space on galaxy fit

firstly I'm not responsible for any kind of damage caused to you
but I have tried all the things on my galaxy fit before explaining here
It's not copied from somewhere instead It's based on my experience on my galaxy fit.
For Non Rooted Devices
There is nothing other then using app2sd apps. Then move all the movable items to sd card. After installing app2sd all newly installed apps are automatically moved to external storege.
I uses app2sd by sam lu.
But for non rooted users I will highly recommend to root there device and make the best use of this smartphone.
for beginners everything about rooting/custom roms/nandroid backups etc is explained in this thread
http://forum.xda-developers.com/showthread.php?t=1606380
thanks a lot to A.cid for this wonderful guide
For Rooted Device
apps required
1.Root explorer or similiar
2.Link2SD (Link2sd Setup is explained later in this post)
step 1.Removing Useless system apps from stock or custom rom
go to /system/app using root explorer and mount as r/w
now delete unwanted apps
I will prefer freezing the app first using link2sd and then if phone is working fine then you can unfreeze and then delete that app
Step 2. Removing dalvik cache files
go to /data/dalvik-cache
now search for the dalvik cache files of deleted system apps
it will having name like
[email protected]@[email protected]
delete this file
Step 3. Linking files to Sd-ext or second partition of Sd card
if you have finished Link2sd setup then you can proceed further
open link2sd and then create Link for all the apps you want to linked to sd card
check all the 3 box 1. link apk 2. link dex 3. link lib files
and then your app will be moved to the sd-ext partition
if there are apps which are used very frequently then i prefer not linking dex files to sd card. link only apk for them.
currently system apps can't be linked using link2sd
In the case if app is not working properly after linking then remove links for that app.
Plz help me to improve this article.
suggestions and questions are welcomed.
forgive me for my poor english
Plz help in improving this article. If there is anything wrong in this post let me know. and if you have any other simple method to do this plz post here and help beginners to get more space. But try not to post complicated method which beginners find hard to perform
this post is for beginners
Link2SD steup on galaxy fit
Copied from A.cid main article from
http://forum.xda-developers.com/showthread.php?t=1606380
There are a lot of ways and scripts to transfer apps from your internal memory to the sd ext partition, but the most consistent method I found was Link2sd.
This method works across all roms (rooted stock and custom, both) that I’ve tried, even on all variations of CyanogenMod7 (CM7) as well as on ICS CM9, and is very easy to setup and use.
However, if a custom rom already has DarkTremor's a2sd (a2sdgui app will be present) or any similar script, then DO NOT configure them.
for example: Creeds v3 has a2sdgui, and if i want to use Link2sd, then after flashing Creeds, i SHOULD NOT run a2sdgui, and directly install (and configure) Link2sd...if you run/configure a2sdgui, then it will clash with the working of Link2sd.
Similarly, if any custom rom has any memory hack already implemented, then you cannot use Link2sd...
Steps to setup Link2sd:
• Download Link2sd from Play Store (it’s a free app).
• After it gets installed, run it, and allow root access.
• You will get a message to select the format of your sd partition, select “ext3”.
• Link2sd will then automatically create mount scripts that it requires to work, and will then tell you to reboot your phone.
• Do a proper reboot, and not a ‘hot reboot’.
• After rebooting, open up Link2sd, press menu then select “settings”.
• Select/check the options “automatically link newly installed applications to sd”, “auto link notification”, “relink lib files at boot” (and “fast scroll”, if you want).
• For “install location” option, select “internal”.
• Then go to “auto link settings” and select/check all the three options (you can skip/ unselect “link dalvik-cache file” if you wish)
• Done
Now, every new app that you will install will automatically be moved to your sd ext partition.
Link2sd is also an excellent (and fast loading) app manager, with which you can freeze, uninstall, re-install…though you can move only user apps to sd-ext partition.
Also, there is no point in having your entire phone memory empty, so you probably should unlink the dex (dalvik cache) of your apps. I usually link only the apk and lib files, and leave the dex files unlinked and on the phone storage, so as to avoid any sluggishness in operation., though if your phone memory still fills up, you can link the dex of your rarely-used apps, and leave the dex of important and frequently used apps on the phone storage.
Suppose a custom rom has s2e/app2sd pre-implemented, then after a fresh install, FREEZE the app (rather than uninstall), and then install Link2sd...
Also, if you get error "mount script not created", then choose partition as ext4 (rather than ext3 mentioned below), even though your partition might be ext3...(don't know why this happens with some roms )
In some custom Roms Link2sd doesn't mount sd-ext partition even after selecting correct type of partition in that case try to select other types whether they are working or not
Like in Chocobread v3.2 it worked after selecting partition as ext4
Plz view this thread if you are still facing any problem
Go through this thread
http://forum.xda-developers.com/showthread.php?t=1698813
What happens when we install a new app??
I'm not a developer but this is what I experienced
/data directory is the space which is shown as Internal Storage in phone
/system directory has nothing to do with this internal storage
when we install a new app then it during the installation process three things happens
1.it creates an apk file in /data/app
2.creates an .dex file in /data/dalvik-cache
3.creates one folder in /data/data
when we move apps to sd that apk file moved to sd storage in
.android secure folder and creates an .asec file there
so basically that .dex file and data files are responsible for eating our internal space and for the apps which can't be moved to sd that apk file is also responsible.
we can't use widgets if app is on sd storage.
so in order to use widgets we have to move back to internal storage.
this is where Link2sd helps us
link2sd links selected files to sd-ext partition and for system it still appears in internal storage but it's not there actually.
While for system apps
.apk files remains in /system/app
only .dex files are in data/data directory
we can use widgets of system apps even apk files are not in /data/app directory
so it is recommended that if you want to use widget of the app but you don't want it on internal space(as it is using much more space while it is in internal memory)
here is the solution
create an apk file for that app using any backup app
then move that file to /system/app
change the permissions to rw-r--r--
for this simply see the permissions of any other system app and apply same here
to system
Simply partition your sd card via cwm.. U can get as much internal space as u want..
amn_grg said:
Simply partition your sd card via cwm.. U can get as much internal space as u want..
Click to expand...
Click to collapse
Let consider your post now tell me how to install 100 apps having size more than 500 mb
Without using link2sd or a2sd or any simliar app
Sent from my GT-S5670 using xda premium
Nikhil_G said:
Let consider your post now tell me how to install 100 apps having size more than 500 mb
Without using link2sd or a2sd or any simliar app
Sent from my GT-S5670 using xda premium
Click to expand...
Click to collapse
By symlinking apps manually, one by one...:beer:
Possible - yes
Feasible - no
Everything is possible bro!
Typed using a small touchscreen
a.cid said:
By symlinking apps manually, one by one...:beer:
Possible - yes
Feasible - no
Everything is possible bro!
Typed using a small touchscreen
Click to expand...
Click to collapse
Yeah right...
Informative Thread
amn_grg said:
Simply partition your sd card via cwm.. U can get as much internal space as u want..
Click to expand...
Click to collapse
can you detail the procedure please.
vikrant prabhakar said:
can you detail the procedure please.
Click to expand...
Click to collapse
partition ur sd card through cm recovery then install s2e from play store now all cm7 rom come with pre install s2e script .
Another way is to use terminal emulator .
Download terminal emulator from the PlayStore and then run the following codes:
Code:
su
*grant/allow superuser permissions*
Code:
pm set-Install-Location 2
exit
exit
Note: sometimes if you get an error you may have to run
Code:
pm setInstallLocation 2
if it fails.
All this does is it allows moving many apps that aren't normally movable to the SD card. After running these codes you should be able to move apps to the SD card via Settings>Apps.
This code also sets the default location for apps to install into as the SD card.
What i do for more internal memory..!
Partitioning your sd card is an option. But if you have a sd card of less storage then this option is ruled out. I use a 2gb sd card and partitioning it is not very feasible for me. so...
1. If I'm on a stock gingerbread ROM i use this script http://forum.xda-developers.com/showthread.php?t=2303856 .
(I dont use it very often. Only if necessary.) And i odex the ROM if it is de-odexed by using http://forum.xda-developers.com/showthread.php?t=2303856 Universal Odex Script by MatrixDJ96. Odexing works very well!!! :good:
2. For a custom ROM not many modifications are needed. I just remove the unwanted apps using Link2SD. :good:

[Q] System space

Got my Huawei Shine U8836D / Ascend G500 Pro and installed customs rom created by bgcngm - Recognized Developer. The customs rom created by him is excellent and out of the world. How can the system/app space can be increased to 500mb plus. I don't prefer to link to SD card with A2SD apk, prefer to have a real/permanent storage space increase.
Solution to my problem will be really appreciated.
akkhyd said:
How can the system/app space can be increased to 500mb plus. I don't prefer to link to SD card with A2SD apk, prefer to have a real/permanent storage space increase.
Solution to my problem will be really appreciated.
Click to expand...
Click to collapse
Y do u want 500mb in the system/app?
There is no use of it unless u wanna have apps at system level.
And I believe only 500mb is allotted for /system folder ( may be more on different phones)
If you move apps to SD, it will give you more space on internal memory. Not on /system.
To get space in /system, delete any bloatware and stuff from there. (be careful while deleting, if you delete an essential one, the consequences will be bad)
LIFE! IT'S WHAT YOU MAKE OUT OF IT!
Thanks
Thanks a lot for your quick reply. I prefer to place some of the required apk in system, so that it stays even after factory reset.
akkhyd said:
Thanks a lot for your quick reply. I prefer to place some of the required apk in system, so that it stays even after factory reset.
Click to expand...
Click to collapse
andord's internal memory's partition is fixed; i mean the amount reserved for system and memory part can not be changed even if you delete some system apps...
the only thing you can do is, deleting some system files which are safe to delete, and use that place to insert your apk's...
System space
Lifehacker7 said:
Y do u want 500mb in the system/app?
There is no use of it unless u wanna have apps at system level.
And I believe only 500mb is allotted for /system folder ( may be more on different phones)
If you move apps to SD, it will give you more space on internal memory. Not on /system.
To get space in /system, delete any bloatware and stuff from there. (be careful while deleting, if you delete an essential one, the consequences will be bad)
LIFE! IT'S WHAT YOU MAKE OUT OF IT!
Click to expand...
Click to collapse
Thanks for the reply. I prefer to have more space in system.

[Q] Link2SD problem on Pranjal's Rom v4.2

Hey! I have been following the forum pretty well for months now and I love it that there's so much of progress. I am a big fan of Pranjal's Rom and am currently running v4.2 which has Link2SD as a sys app (which btw is a sexy app )
Ok so here's the problem :| When I tried to update a couple of apps I found that my internal storage is almost full This was surprising to me coz i autolink all my apps using Link2SD. I don't even have that much files. So I formatted my second partition, made it ext 4 and again installed a couple of apps.
Here's the thing. The apps seem to be linking to the second partition, but annoyingly enough they are also taking space in my internal storage. Can someone help? I really need space :|
 @pranjal18
madmanmatt616 said:
Hey! I have been following the forum pretty well for months now and I love it that there's so much of progress. I am a big fan of Pranjal's Rom and am currently running v4.2 which has Link2SD as a sys app (which btw is a sexy app )
Ok so here's the problem :| When I tried to update a couple of apps I found that my internal storage is almost full This was surprising to me coz i autolink all my apps using Link2SD. I don't even have that much files. So I formatted my second partition, made it ext 4 and again installed a couple of apps.
Here's the thing. The apps seem to be linking to the second partition, but annoyingly enough they are also taking space in my internal storage. Can someone help? I really need space :|
@pranjal18
Click to expand...
Click to collapse
that's normall.....extend ur ext-sd partition....ow....and try hd2sd by @hillbeast ....it'll move ur dalvik-cache and more of apps tobur ext-sd than link2sd ....or...use kyrillos13's app2sdv2 script ....it does the same
Sent fom my S-II running >>SlimBean build 6.2 WEEKLY<< powered with >>DorimanX kernel 9.31<<
madmanmatt616 said:
Hey! I have been following the forum pretty well for months now and I love it that there's so much of progress. I am a big fan of Pranjal's Rom and am currently running v4.2 which has Link2SD as a sys app (which btw is a sexy app )
Ok so here's the problem :| When I tried to update a couple of apps I found that my internal storage is almost full This was surprising to me coz i autolink all my apps using Link2SD. I don't even have that much files. So I formatted my second partition, made it ext 4 and again installed a couple of apps.
Here's the thing. The apps seem to be linking to the second partition, but annoyingly enough they are also taking space in my internal storage. Can someone help? I really need space :|
@pranjal18
Click to expand...
Click to collapse
thanks @madmanmatt616
since you've formatted your partition, i would suggest you to reflash the whole rom again and run the script in terminal emulator (mentioned in read me file)
your problem had a very easy solution
in link2sd press menu>>more
here you have a few options...touch all the options below "recreate mount scripts"...and , "link dalvik-cache files" and "clean up teh dalvik cache" will give you more internal space!!
the problem could be that the data of the apps are collected in /data/data/"appfolder"
you can figure out with Titanium, which apps are using most space: menu-> overview of app storage use. then u can outsource the folder to sd-ext and make a symlink in /data/data to the outsourced folder.
mankokoma said:
the problem could be that the data of the apps are collected in /data/data/"appfolder"
you can figure out with Titanium, which apps are using most space: menu-> overview of app storage use. then u can outsource the folder to sd-ext and make a symlink in /data/data to the outsourced folder.
Click to expand...
Click to collapse
Can you tell me exactly how to outsource to sd-ext? Just a copy paste would do? Then you suggested a symlink. I do understand why you told this, thing is I am clueless on how to link only one. As far as I could understand, link2sd creates such links from /data/app to the sd-ext. How do I create a link for /data/data/"appfolder" ?
I hope what I said makes sense . Thank you
sorry, so short on time...
MAKE A BACKUP FIRST, JUST IN CASE!
- copy & paste the whole folder to sd-ext with terminal emulator or adb shell:
cp -Rp /data/data/nameoffolder /sd-ext/nameoffolder
- delete the folder in /data/data:
rm -rf /data/data/nameoffolder
symlink:
ln -s /sd-ext/nameoffolder /data/data/nameoffolder

What is /data/app and why is app file there?

I have some app in /data/app folder and only there? Some apps are simply not there. Why is this? Can I move the /data/app folder? I want to free some disk space.
Phpdna said:
I have some app in /data/app folder and only there? Some apps are simply not there. Why is this? Can I move the /data/app folder? I want to free some disk space.
Click to expand...
Click to collapse
Some apks are in /data/app and some are in /system/app.
Remove the ones that are unecessary to free up disk space and remove the respective dex file the dalvik-cache for the app.
Edit: Be careful to not remove required applications packages as you might cause instability or boot-loops among other issues. (A.K.A I'm not responsible for any of your problems)
No, you cannot move the folder.
However you could try https://play.google.com/store/apps/details?id=com.buak.Link2SD or My favorite: https://play.google.com/store/apps/details?id=com.spazedog.mounts2sd
O.k. I know that I also tried mount2sd but it left my mobile unusuable. It doesn't explain why there is this /data/app folder. Some apks isn't there. For example downloaded apks sometimes install in /data/app and sometimes not. Can I move the apks from /data/app to system/app? Can it work? Is it possible it has to do with the search path? When I add /data/app to the search path can it work?
Phpdna said:
O.k. I know that I also tried mount2sd but it left my mobile unusuable. It doesn't explain why there is this /data/app folder. Some apks isn't there. For example downloaded apks sometimes install in /data/app and sometimes not. Can I move the apks from /data/app to system/app? Can it work? Is it possible it has to do with the search path? When I add /data/app to the search path can it work?
Click to expand...
Click to collapse
Depending on your phone its partitioning might allow you to free space on your data partition by copying apps from data to system (depending on if they have separate partitions in your phones memory). One drawback is that you will be unable to remove the apps using normal app management. It also might be the case that updates are not installed for those 'system' apps or the updates are installed in the data folder again. For samsung the /system/ partition is mounted read only so for those i'm quite positive that updates will not be placed in the system partition.
The 'easiest' solution to your storageproblem is using some kind of link2sd or mount2sd (the latter including a separate partition on your SD). Be careful choosing the right script because many are old and outdated and might fail. Also you will be unable to switch sd-cards because you cannot easily unmount the app partition and if you remove the sd without unmounting it you have a big risk of damaging the filesystem (been there done that :crying
My best experience back when i had to use a mount2sd script was with this app: https://play.google.com/store/apps/details?id=com.spazedog.mounts2sd
In the app description you find a quite clear list of requirements for your phone to use the app effective.
P.S. for the mount2sd app it is my recommendation to move it to /system/app because if it is in /data/app and your data is moved to your SD and for some reason the startup (init.d) script fails you will be unable to use Mount2SD because it was not loaded from sd. Moving it to system/app ensures you that it is available even if the startup script failed.
Qaatloz said:
Depending on your phone its partitioning might allow you to free space on your data partition by copying apps from data to system (depending on if they have separate partitions in your phones memory). One drawback is that you will be unable to remove the apps using normal app management. It also might be the case that updates are not installed for those 'system' apps or the updates are installed in the data folder again. For samsung the /system/ partition is mounted read only so for those i'm quite positive that updates will not be placed in the system partition.
The 'easiest' solution to your storageproblem is using some kind of link2sd or mount2sd (the latter including a separate partition on your SD). Be careful choosing the right script because many are old and outdated and might fail. Also you will be unable to switch sd-cards because you cannot easily unmount the app partition and if you remove the sd without unmounting it you have a big risk of damaging the filesystem (been there done that :crying
My best experience back when i had to use a mount2sd script was with this app: https://play.google.com/store/apps/details?id=com.spazedog.mounts2sd
In the app description you find a quite clear list of requirements for your phone to use the app effective.
P.S. for the mount2sd app it is my recommendation to move it to /system/app because if it is in /data/app and your data is moved to your SD and for some reason the startup (init.d) script fails you will be unable to use Mount2SD because it was not loaded from sd. Moving it to system/app ensures you that it is available even if the startup script failed.
Click to expand...
Click to collapse
I'm not going to try the app from spazdog again it left my mobile unusable and the uninstall was not easy. So,the apk can moved to system/app? Good to know, I find a solution to my problem because I moved the apk's to my sdcard. BTW. the problem was that moved apks are not in /data/app!!! Only the other apk's are in /data/app.... I wonder if I'm the only one? My next question is why is some apk's not moveable? It could help a lot of people to free disk space but some apks can't be move (with normal effort). Thanks for reading.

Categories

Resources