So we had a couple apps2sd discussions going on in various threads around here so I figured it was about time it got its own dedicated topic. I'll talk about the apps2sd methods I have tried and what I like and don't like about them and then hopefully other people will chime in and we can get a good discussion going and figure out what the best options are.
First there is what is known as Froyo apps2sd (but it is also in Gingerbread and presumably any future android OS releases). It is what you can do on CM7 by default and it moves the apk into a secure folder on your sdcard in the main fat32 partition. This is useful because it clears up some space on your phones internal memory and it is the easiest method because it doesn't require you to partition your sdcard. It is also managed natively by android and you can have apps automatically install to the sdcard so it is convenient. It has some disadvantages though that prompted the search for a better apps2sd method: First of all not all apps can be moved by default, although in CM settings you can force the OS to allow any apps to be moved and there are some apps such as Ti Backup that will force move apps if you are on another rom. Second each app you install will still have some data on the phone's internal memory so you can still potentially fill up your internal memory even if you are moving all of your apps over. Finally the biggest problems stem from the fact that they are just stored on the sdcard's main fat32 partition. This causes the apps to load more slowly at boot and every time you plug in your phone to a pc and mount your sdcard the phone temporarily loses all of these apps and then finds them again when you unplug the sdcard. This can cause problems for some apps especially those with widgets since your home keeps running and now the widget apps are gone so it is recommended you don't move any of the apps with widgets that you use.
The other methods will require you to partition your sdcard, which means if your sdcard is currently full of data you will need to back up all of your data because partitioning requires a complete wipe of the sdcard. I did this when I got a new 32gb card so it was blank to begin with. One way to partition your sdcard is with rom manager. You can choose partition sdcard and it will ask you what size you want for your ext space then what size you want for your swap space. I chose 512MB and 128MB respectively but you can choose whatever you'd like, many people may not want to use sdcard swap so you can just not create a swap space if you want. Using this creates an ext3 partition and a linuxswap partition on your sdcard. Another way to partition your sdcard is to use a program on your computer, such as MiniTool Partition Wizard Home Edition. With this app you can make fat32, ext2, ext3, ext4, and linuxswap partitions of whatever size you like on your sdcard (all the partitions you make should be listed as 'primary' and the order should be fat32, ext*, linuxswap). Generally you want most of your card as fat32, then a portion that is one of the ext* types for apps2sdext (make sure your rom and apps2sd method supports the type you choose, ext4 is currently not supported by many roms), then a small part for linuxswap if you want to try it out (sdcard swap may shorten your sdcard's lifespan).
The first method I tried after Froyo apps2sd was S2E (simple2ext). This is an app, available on the market, written for CM7 that basically just installs some scripts that can be used to link entire folders to your sdext partition. It has four options for folders that you can move: /data/app, /data/app-private, /data/dalvik-cache, and /cache/download. Currently if you move /data/app or /data/app-private it cannot simply be undone but the dev has said they are working on an undo script for future releases, the other two folders can already be moved back. It will work fine with the ext3 partition created by rom manager (I don't know about ext2 or ext4). I liked this program because it was easy to use and once you ran it all future apps will go into the sdext space. One thing to mention is you need to make sure you choose in CM settings to have your apps installed to internal memory otherwise your phone will still use Froyo apps2sd in addition to your sdext method completely ruining any advantages gained from using S2E. You may also want to go into manage applications and check to see if any apps are installed to the sdcard and if they are move them to the phone (which is really now your sdext partition, I know it can get confusing lol). Although this was great I kind of like the idea of keeping some of my apps like Gmail, Handcent, ADW EX, and apps with widgets I use on the phone's internal rom, which lead me to my next method: Link2sd.
Link2sd is another market app that will allow you to move individual apks and their corresponding dalvik-cache files to your sdext partition. As I mentioned before I like the idea of keeping some of my apps on my phone's internal memory (I'm not sure if there is a real benefit or not but it just makes me feel all warm and fuzzy inside lol). Once you get this app set up properly it is easy to use. You just open the app and it gives you a list of all of your installed apps. You can sort by name, size, or date and there are filters to show only unlinked apps or all downloaded apps so finding the apps you want to move is a breeze. Also when you update an app it will first install to the phone's internal memory and then link2sd will automatically move the new apk to your sdext partition in the background if you had linked it before. Plus it can easily move apps back to the phone's internal memory if you want. It isn't perfect though, one downside is like froyo apps2sd all of your apps will still have some data on the phone's internal memory so you could fill up the phone's rom even though you link most of your apps (most apps don't leave much behind but certain apps like Google Earth still take up a significant amount of space in /data). Also after you move an app you must restart the phone before you can use the app (same goes if you updated a linked app). This is a minor annoyance but since you probably aren't moving apps back and forth all the time it shouldn't be a big deal, but maybe it will bother some people more than it bothers me. The other problem is it doesn't work right out of the box and will take a little tinkering to get set up on CM7:
When you first run link2sd it is supposed to scan your sdcard and find ext partitions and then create a script to mount them. It is supposed to work with ext2, ext3, or ext4 but was originally designed just for ext2 so I used MiniTool partition wizard to make my ext3 partition into an ext2 partition to have the best chance at making things work (luckily since the space was already allocated the main fat32 partition is untouched so you don't need to worry about your data). Unfortunately for me at least it would not find my ext partition so I turned to everyone's favorite source for finding answers: Google! After searching around I came across this thread where people were having the same problem and they said basically you could just create the script yourself and put it in init.d and it would mount the ext partition on boot and link2sd will be able to see it. I attached the script I used, called 99complete (unzip it and place in /system/etc/init.d/ with root explorer or other method, permissions for mine are rwxr-x---). Before you copy over this script you can check if it will work by using terminal emulator:
su
mkdir /data/sdext2
mount -o rw,nosuid,nodev,noatime,nodiratime /dev/block/vold/179:2 /data/sdext2
1st line: gives superuser permissions
2nd line: creates a folder in /data called sdext2
3rd line: mounts the sdext partition as /data/sdext2
After running these three lines you should be able to go into link2sd and it should now find your sdcard partition. If it works you should copy the 99complete script into init.d so that it will remount your sdext partition every time you boot your phone (otherwise none of the apps you moved over will show up because the partition won't get mounted).
If it doesn't work it may have to do with a difference in how your partitions are set up or defined. I think there are some different ways that the sdext partition can be defined and I'm not completely clear on the differences. Sometimes I see the sdext mounted using "/dev/block/mmcblk0p2" instead of "/dev/block/vold/179:2". I don't really know what the difference is, maybe one of the more knowledgeable members like Prime could shed a little light on the subject. I know in the thread I linked there is another script after the one I use that has lines with /dev/block/mmcblk0p2 and contains lines that are commented out with /dev/block/vold/179:2. The script I attached works for me, my partitions are fat32, ext2, linuxswap. I am currently using Link2sd and even updated my rom and kernel without wiping and still have all of my apps functioning. I added the 99complete script into the /system/etc/init.d folder of the new CM update.zip before I flashed it so when my phone booted for the first time it mounted the partition properly and everything just worked!
So that is what I have used. There are some other methods that use scripts to set up Apps2sdext that I have not tried. There is DarkTremor's Script, which people have reported success using on CM7. There is also a script by Firerat that does apps2sdext. There are probably some others too that I don't know about. As far as I know DarkTremor's script moves all of your apps similar to the way Simple2ext works. Firerat was working on his script specifically for CM but one of the mods over there made him mad and I haven't seen him posting much there anymore but he still seems to be on xda. I read once that Firerat's script creates another folder called /data/app-i where you can choose to keep some of your apps on the phone's internal rom if you want but like I said I haven't personally used his script and don't know much about it. I would love to hear from people that have used alternative methods and what they think of them.
Also one thing I was wondering about was if a rom could be modified so that froyo apps2sd used the sdext partition rather than a folder on the main fat32 partition. That would be cool since we could still use android's management of apps2sd but we would get the advantages of having them on an ext2 partition so they wouldn't be 'lost' when the sdcard was mounted to a pc. It would seem like it wouldn't be that hard to move the location for froyo apps2sd (I of course have no clue maybe it would be difficult). Also I wonder if Android would purposely 'turn off' the apps somehow when you used the mounted the sdcard with a pc because it was expecting them to be 'lost' due to the sdcard getting mounted.
Well if anyone bothered to read all that hopefully you have gained some information about apps2sd. I hope people will chime in with their experiences and use this as a place to get help with app2sdext problems so the other threads don't get too sidetracked.
Happy Modding!

LinkBack URL
About LinkBacks
Reply With Quote
