Why don't we move (on legacy a2sd) also /data/data folder to sdcard?
In this folder resides applications settings, and with 50apps on my desire the data partition (140mb) is used to 60% only for this data folder.
I think getting used to good apps, it's easy to reach 100 installed apps.
What do you think?
Moving data/data causes stability issues.
it can be done by symlinking a folder in your /system/sd ext partition but as the above said it causes stability issues.....
su
ln -s /system/sd/data2/ /data/data/
Click to expand...
Click to collapse
i think this is the command to do it....please someone correct me if i am wrong
Related
Guys,
I want to understand Android a bit better.
I'm running LeeDroid 2.2d A2SD, so all my apps are running on the SD
1) Now what is the difference between \System\app & \Data\app ?
2) Which of those two is redirected to the SD card?
3) Is there some good reasons to put an application in \system\app instead of \data\app, performance maybe ?
Thanks for the gurus that can answer these questions
/system/ is the system partition, under normal conditions, users do not have write access to this partion. Obviously rooting and s-off will allow write access to this partition, /data/ is the user partiton, it holds all downloaded apps in /data/app and all user data and settings in /data/data. When you use app2sd+ /data/app/ and the dalvik cache is moved to /system/sd/app and /system/sd/dalvik-cache. (the ext partition). Now although you can manually move apps to /system/app, these apps will not be updatable by normal methods, the only way to update apps on the /system/ partition is to manually replace the old .apk with the updated version. One great way ive found to increase space is to change the partition tables of the mtd partitions on your device. Basically reducing the size of the /system/ partition and adding that reclaimed space to data, there is a tut in the development section on this!
Sent from my HTC Desire using Tapatalk
QuestiOn
Ok so it is best to put launcher pro and beautifull widgets on the /system/app directory so that it can be loaded from memory instead of SD card.
So I tried to copy the launcherpro apk from /data/app to /system/app after putting the system directory in RW mount with root explorer.
But it doesnt seem to happen and after one minute the phone reboots and nothing has been done ...
Probably because launcher pro is running..
Question 1: How can I write the launcher pro and beautifull widgets apk to the /system/app directory
Question 2: What happens to the settings/data from launcher pro?
Finally I managed to get S-OFF and move the rest of my apps from /data/apps to /system/apps (instead of SD) (with simply Root Explorer and reboot) but there is this huge HTC_IME.apk which is my favourite keyboard but I can't activate it when it's moved to /system/apps, it force closes.
Is there a way to make it work from the /system partition?
I'm also working on to understand how to move the /dalvik-cache to /system or /cache but despite the symlink /data/dalvik-cache recreates after reboot. Should I really apply that script to /system/etc/init.d or is there any other way?
Thank you in advance.
I'm not S-OFF, so I can't really say about moving the dalvik cache to /system, but I do know there are scripts to move it to /cache (make sure your cache partition if big enough!) or to the sd card. Do a google search and you should find everything you need
About the HTC IME, I don't use this keyboard, but this is what I found while moving some of my apps to /system: some apps (such as Adobe Flash or SoundHound) install libraries which they require to work. This libraries are found in /data/data/package_name/lib, where package_name is the name of your app. For most apps, you can just copy the libs to /system/lib (not in any folder in lib), but I haven't managed to get Flash to work from there, although everything else works fine. I suppose there is another option to make a symlink from the lib folder in /data/data/some_apps_folder to /system/lib if the app won't find the lib after you moved it to the folder in /system, as I've read in some thread, but I haven't tested this, so I can't say if it works or not.
Good luck!
Thank you, I moved dalvik-cache and applied the script - it works, with Adobe Flash and some basic apps installed (a few of them moved to /system/apps including the 5MB HTC_IME.apk with its lib file) I have now 60MB free space (compared to the 15MB I had before. wow/lol). I think it's quite enough to get the feeling of freedom when it comes to trying out just a little more apps without getting a full storage warning.
I was also thinking about repartitioning the internal storage but I'm afraid it's better to leave it as it is because of warranty - just in case.
I've done some googling and I still don't understand the purpose of symlinks.
Is this user's comments correct? (link to post below)
http://forum.xda-developers.com/showpost.php?p=35147667&postcount=4
In this case, it's symlinked because of legacy reasons.
Android 4.2 introduced multiple users(on tables, but they use the same model for phones). Every user has a separate SDcard folder. The first user gets 0, the second gets 10(don't ask why). This means that in the root of your sdcard contains a folder 0 and a folder 10.
Because some apps don't use proper API's to retrieve the external storage folder, but instead they just use '/sdcard'. If Android didn't use symlinks to mount '/sdcard' to 'SDcard/0', those apps would write into the wrong folder. For example, if a music app did this, both users would have the same music(since the app reads from/writes to sdcard instead of sdcard/0 or sdcard/10). Or even worse, trusted documents could be accessible to all users, instead of just one.
So, symlinks can be used for legacy reasons. But they can also be used for convenience. If you need to have one file at two locations, you could simply copy the file and put it in both locations. But if one of the two changes, the other one isn't. They're not linked together, they're just 2 separate files.
But if you use symlinks instead of copying, there is just one file, and one symlinks which points to the original file. If the file changes, the symlink will point to the changed data.
That's a good point on the API and multi-user account.
I have some specific questions. There are two directories in my not rooted Nexus 7. Storage/emulated/legacy and storage/emulated/0
I'd like to know what is the purpose of creating these symlinks? Is it somehow related to managing multiple user accounts?
Using my file manager it is all very strange to me. There is an emulated folder and a legacy folder in the storage folder. But in the emulated folder, there is the 0 folder and the legacy folder. Legacy folder is also found in mnt and root. All folders mentioned except for emulated, leads to where all my data is stored.
I see no purpose of having the legacy folder in more than one place.
So legacy is a symlink to sdcard? And emulated/0 is a symlink to legacy?
poetryrocksalot said:
That's a good point on the API and multi-user account.
I have some specific questions. There are two directories in my not rooted Nexus 7. Storage/emulated/legacy and storage/emulated/0
I'd like to know what is the purpose of creating these symlinks? Is it somehow related to managing multiple user accounts?
Using my file manager it is all very strange to me. There is an emulated folder and a legacy folder in the storage folder. But in the emulated folder, there is the 0 folder and the legacy folder. Legacy folder is also found in mnt and root. All folders mentioned except for emulated, leads to where all my data is stored.
I see no purpose of having the legacy folder in more than one place.
Click to expand...
Click to collapse
storage/emulated/0 is specific for the first user, but storage/emulated/legacy is probably for some legacy reasons. Essentially they point to the same storage, but it's probably cleaner for development purposes(when they decided to create those symlinks). I'm not sure why they decided to do this, but they probably thought is was better for some reason.
poetryrocksalot said:
I hope this is partially correct.
We want to mount /sdcard to sdcard/0 or sdcard/10, depending on the current user.
We can't symlink /sdcard to /0 or /10, because is a subdirectory and is not the same as mounting. You can mount /sdcard to multiple directories but only one at a time. You can symlink /sdcard to only one directory. But /sdcard is the real directory so we don't want it to be a symlink.
storage/emulated/legacy is symlinked to /sdcard. And storage/emulated/0 is symlinked to storage/emulated/legacy with the primary account active. There has to be the legacy directory served as a symlink because of the fact that the user folders 0 and 10 are subdirectories of the sdcard folder.
When we are mounting /sdcard to sdcard/0, we are actually mounting legacy to sdcard/0
Because with my logic, if we mounted /sdcard to sdcard/0 then /sdcard would lose its contents which includes the subdirectory 0. Therefore we would be mounting an empty media.
LOL all this is confusing but I hope I get the general idea and some of it right.
Click to expand...
Click to collapse
You're partially correct. According to the link you provided in your first post, the (internal/external) sdcard is mounted at /data/media. This folder contains 0, 10, legacy and obb. Let's ignore the 'obb' folder. The /data/media folder is your internal sdcard(the /sdcard you were talking about). Depending on the current user, /sdcard is either /data/media/0 or /data/media/10. This way, we're not symlinking to a subdirectory(which is impossible), and the /sdcard folder actually contains data.
In addition, /storage/emulated is because we don't have a real sdcard, but we emulate one. Both the Nexus 7 and Galaxy Nexus only have internal storage, so we emulate the sdcard. Other devices with an SDcard probably also have /storage/emulatd, but that's because they both have an emulated sdcard and a real sdcard. The real sdcard will probably appear in /storage/sdcard1 (not sure about this).
Sounds like Google made it overly complicated for no reason.
tokuzumi said:
Sounds like Google made it overly complicated for no reason.
Click to expand...
Click to collapse
I disagree, it's pretty complicated, but building a system which is compatible with multiple users and multiple sdcard(internal and external) is complicated.
For most users, the current setup works great. Most users don't bother using a file manager since there's no need for it. There's an app for the downloads, and music/photos/video's are handled by the music and gallery apps. There is just a small portion of users actually using a file manager.
Its purpose is to have a file or directory in multiple places at the same time.
Hi
I'm trying to use a symlink from the internal SD card to the external one so I can use WikiDroyd on a larger disk. I have done this before to map google music to my extSDcard and it works great, using this command
ln -s /storage/extSdCard/googleMusic/ /data/data/com.google.android.music/files/music
but when I try
ln -s /storage/extSdCard/WikiDroyd/ /storage/emulated/0/WikiDroyd
I get Function not implemented. I'm guessing it's because /storage/emulated/0 doesn't support symlinks, is this because of it's disk format? Does anyone know how to find out it's format? Can I reformat it?
Note: I am using omega rom
Questions go in Q&A
Thread moved
Friendly Neighborhood Moderator
metronews said:
Hi
I'm trying to use a symlink from the internal SD card to the external one so I can use WikiDroyd on a larger disk. I have done this before to map google music to my extSDcard and it works great, using this command
ln -s /storage/extSdCard/googleMusic/ /data/data/com.google.android.music/files/music
but when I try
ln -s /storage/extSdCard/WikiDroyd/ /storage/emulated/0/WikiDroyd
I get Function not implemented. I'm guessing it's because /storage/emulated/0 doesn't support symlinks, is this because of it's disk format? Does anyone know how to find out it's format? Can I reformat it?
Note: I am using omega rom
Click to expand...
Click to collapse
Is /storage/emulated/0 the default directory for the app? If so, it may be failing due to trying to replace an existing directory with a symlink (particularly if that pre-existing directory is in use at the time).
If the app's directory setting can be altered, why not try putting the symlink elsewhere? Even if the app doesn't let you set a custom directory, creating your symlink elsewhere would, if successful, narrow down the likely causes of the error (unfortunately, if the app's directory setting is hard coded out otherwise unchangeable, then it would also prove that what you want to do is not possible, at least not through this approach)
Sent from my SPH-L710 using xda app-developers app
Are you sure that ln -s will work on non ext partitions? I don't think this won't work on FAT32/NTFS partitions.
lexridge said:
Are you sure that ln -s will work on non ext partitions? I don't think this won't work on FAT32/NTFS partitions.
Click to expand...
Click to collapse
That's a good point, I thought that certain configurations might work (like placing the link on an ext partition that points to a file on a fat 32 partition, since Linux can read both and Windows would never see the Linux-style link, for example) but I'll double check...
Sent from my SPH-L710 using xda app-developers app
styles420 said:
That's a good point, I thought that certain configurations might work (like placing the link on an ext partition that points to a file on a fat 32 partition, since Linux can read both and Windows would never see the Linux-style link, for example) but I'll double check...
Sent from my SPH-L710 using xda app-developers app
Click to expand...
Click to collapse
Just a thought, you might also try busybox ln -s and see if that works.
Hi guys, today i am here to tell you a method only tested on a galaxy y, but i hope it will work for all. this is a method to change the download location for play store.
WARNING!!!
1. WARRANTY IS NOW VOID.
2. NOT MY PROBLEM IF SOME APP FAIL.
3. PLEASE, PLEASE, PLEASE DO A NANDROID BACKUP BEFORE THIS.
This is a simple code but it needs root for sure. now the necessities are as follows:
1. A complete nandroid backup
2. Root Permissions
3. Any terminal emulator. e.g https://play.google.com/store/apps/details?id=hecticman.jsterm
4. You need to know the default download location and the mount point of sd card( if that is where you want the new download location )
Now let's start.
Just know this that mnt/sdcard will have to be replaced by your sdcard mount point and data/app will have to be replaced by the default download location. i underlined them for easy understanding.
NOT MY PROBLEM IF THIS FAILS AND YOUR PLAY STORE CRASHES. JUST DO A NANDROID RESTORE.
THERE WILL ALREADY BE A $ AT START SO U DON'T HAVE TO PUT IT.
$ su
# mkdir /mnt/sdcard/playstore
# cp -r /data/app/* /mnt/sdcard/playstore
# rm -rf /data/app
# ln -s /mnt/sdcard/playstore /data/app
Click to expand...
Click to collapse
what the code does:
1. Grant super user permissions
2. Make a directory in sdcard named playstore.
3. Copy all items (recursively) from data/app to sdcard/playstore
4.Symlink the new location to fake the original.
Hitting Thanks can help.
and once again PLEASE BACKUP BEFORE THIS AND RESTORE IF NOT SUCCESSFUL.
This is based on the code used by link2sd.
Could you please double check your code fragments?
For me it looks, like you create a directory "playstore", but then copy to a directory "playstore-temp", which will most like not exist at that moment.
The ln you're using can't realy work as long as the /data/app directory is still in place... so you would first need to delete /rename it.
Just my 2¢
thanks dude
DThought said:
Could you please double check your code fragments?
For me it looks, like you create a directory "playstore", but then copy to a directory "playstore-temp", which will most like not exist at that moment.
The ln you're using can't realy work as long as the /data/app directory is still in place... so you would first need to delete /rename it.
Just my 2¢
Click to expand...
Click to collapse
looks like i was drunk making so much mistakes . corrected it.
It's not so simple if you use Link2SD. If you link some apps to sdext partition, some files in /data/app are symlinks which cannont be copied to /mnt/sdcard/playstore as it's FAT32. You have to try to symlink /app/data to folder on sdext partition. Create a folder /data/sdext2/playstore, copy /data/app/* there, delete /data/app and symlink /data/sdext2/playstore as /data/app. Sdext partition uses linux filesystem and all symlinks should work properly. I haven't tested it yet, but will do in a minute.
EDIT:
It doesn't work with Link2SD. Phone hangs on boot. It's probably cause Link2SD app must be directly in internal memory (so in real /data/app, not symlinked). I'll try to symlink /data/data or /data/dalvik-cache to save some internal memory but I doubt it'll work.