Skip to main content

Freeing up phone storage with Link2SD

Another more powerful way of freeing up phone storage is with Link2SD. Using this method requires you to have a rooted phone. If you don't, either root your phone or there isn't really much else you can do.

The idea behind Link2SD is simple. Remember Android is basically a modified version of Linux and the application files resides in /data (where '/' , or the root directory, is your phone storage). When more and more files are created in /data, your phone storage is slowly eaten up and very soon you will see the "Phone storage low" warning.

Link2SD lets you move some of the files in /data to the SD storage but retain a pointer or symbolic link in /data. This is a legitimate filesystem sleight-of-hand that retains the directory structure that Android expects, but with the bulk of the data moved to the SD card.

For example, after moving Angry Bird using Link2SD, the affected files are:

/data/app/com.rovio.angrybirds-1.apk -> /data/sdext2/com.rovio.angrybirds-1.apk
 

/data/data/com.rovio.angrybirds/lib/libangrybirds.so -> /data/sdext2/data/com.rovio.angrybirds/lib/libangrybirds.so
 

/data/dalvik-cache/data@app@com.rovio.angrybirds-1.apk@classes.dex -> /data/sdext2/dalvik-cache/data@app@com.rovio.angrybirds-1.apk@classes.dex

As you can see, the symbolic links point to a special partition on the SD card that is mounted as /data/sdext2.

Installing Link2SD is very simple. Before installing, create a second partition on your SD card. You can use a non-destructive partition manipulation tool such as MiniTool Partition Wizard to create the second partition. Depending on your needs, a partition size of 512MB to 1024MB should be sufficient. You can always increase the partition size later if necessary.

Now find Link2SD on the market and install it. After installation, reboot your phone. This will allow Link2SD to mount the partition. Now you are ready to use Link2SD. Launching Link2SD will bring you to a list of all the applications on your phone:


From there, you can choose which apps to link to the SD card. Apps which are already moved using Froyo's native A2SD method cannot be moved. You need to move them back to phone storage before you can run Link2SD on them.

I find a couple of menu functions rather useful. Under "Filter", you can choose to see only those apps that have not been linked ("Not Linked User"). Sorting that list in decreasing order of "Apk+Dex+Lib Size" using the "Sort" function will give you the top candidates for linking to the SD card (i.e. those apps that are using the most phone storage).

I also like to use Link2SD exclusively, so by using Move2SD Enabler to set the default installation location to "Internal", I don't have to deal with Froyo's A2SD mechanism again. You can also enable the "Auto link" function under Link2SD's "Settings", which will automatically link any newly installed app to the SD card. However, I did not enable this because I like to have more control over which apps I link to the SD card. Also remember that you should not link widgets, input methods, live wallpapers etc. to the SD card.

The limitation with Link2SD is that you cannot link system apps to the SD card. However, the author is working on this and this should be possible in a future release. Also, a future version may allow you to disable A2SD directly without using another app.

In summary, Link2SD is a pretty powerful tool for freeing up phone storage by linking application files to the SD card. You get a nice GUI for linking/unlinking application files, fine-grained control over which files to link (apk, dalvik cache, library files) if you wish, a set-and-forget option to automatically link applications to the SD card. All you need is a rooted phone, a few minutes to create a second partition on your SD card, and a few more minutes to install Link2SD, reboot and do a bit of linking. With minimal effort, you should never have to see the "Phone storage low" warning again.

Comments

  1. Very neat explanation. Best I've seen in my search to figure out whether I save more internal memory space by moving an app to SD or leaving it on phone and linking to SD. Well onward I go searching or not be so lazy and test the scenarios myself :-)

    ReplyDelete

Post a Comment

Popular posts from this blog

Adding "Stereo Mixer" to Windows 7 with Conexant sound card

This procedure worked for my laptop (Thinkpad E530) with a Conexant 20671 sound card, but I suspect it will work for other sound cards in the Conexant family. I was playing with CamStudio to do a video capture of a Flash-based cartoon so that I can put it on the WDTV media player and play it on the big screen in the living room for my kids. The video capture worked brilliantly, but to do a sound capture, I needed to do some hacking. Apparently, there was this recording device called "Stereo Mixer" that was pretty standard in the Windows XP days. This allowed you to capture whatever was played to the speaker in all its digital glory. Then under pressure from various organizations on the dark side of the force, Microsoft and soundcard makers starting disabling this wonderful feature from Windows Vista onwards. So after much Googling around, I found out that for most sound cards, the hardware feature is still there, just not enabled on the software side. Unfortunately, to

Hacking a USB-C to slim tip adapter cable to charge the Thinkpad T450s

This hack is inspired by this post . A year ago, I bought an adapter cable for my wife's Thinkpad X1 Carbon (2nd Gen) that allows her to power her laptop with a 60W-capable portable battery (20V x 3A). A USB-C cable goes from the battery into the adapter, which converts it to the slim tip output required by the laptop. Everything works out of the box, so I didn't give much thought about it. Recently, I decided to buy a similar cable for my Thinkpad T450s. I know technically it should work because the T450s can go as low as 45W (20V x 2.25A) in terms of charging (though I have the 65W charger - 20V x 3.25A).  I went with another adapter cable because it was cheaper and also I prefer the single cable design. So imagine my surprise when the cable came and I plugged it into my laptop and it didn't work! The power manager just cycle in and out of charging mode before giving up with an error message saying there is not enough power. After much research and reading the Thinkwiki

Using Google Dashboard to manage your Android device backup

I used to use AppBrain/Fast Web Install to keep track of which apps I have installed on my phone, and to make it easier to reinstall those apps when the phone gets wiped or replaced. But AppBrain had been going down the tubes, and Fast Web Install had always been a hit-and-miss affair. Android's own "backup to the cloud" system had previously been even more unusable. There isn't a place where you can see what has been backed up. And when you setup a new phone with your Google account, you just have to wait and pray that your favorite apps will be restored to the phone. Typically all the stars have to be aligned just right for this to happen. More often than not, after waiting for an hour or so and nothing happens, you just curse under your breath and proceed to install your favorites apps manually via the Play Store. But I just looked again recently and was pleasantly surprised that things are much more civilized now. Firstly there is a place now where you can loo