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

Update: Line adapter for Ozito Blade Trimmer

Update (Dec 2021): If you access to a 3D printer, I would now recommend this solution , which makes it super easy to replace the trimmer line. I have been using it for a few months now with zero issue.

Filament Joiner Part 2 (With Display and Knob)

Thanks to the current corona-virus crisis, the parts I ordered for the filament joiner project were taking forever to arrive. But now that they have finally arrived, I can put them to good use. These were the parts ordered: 0.96" OLED display SSD1306 Rotary switch encoder KY-040 Here is the final circuit diagram: The OLED display is connected to the SCK and SDA pins of the Nano (A2 and A3 respectively), and powered by 5V and GND. The rotary switch encoder is connected as follows: VCC => 5V GND = > GND CLK => D9 DT => D8 SW => D2 My prototype board now looks like this: The updated code for driving the knob and display is available in  heater-with-display.ino in the Github repository . We now have a fairly compact (about 7cm x 5cm) and independent filament joiner (no need to connect to PC) that is driven solely by a 12V power supply. Here's how to use it to join printer filaments. More usage details in my previous post .

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