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.

3D Printer Filament Joiner

I have been looking at various ways of joining 3D printing filaments. One method involves running one end of a filament through a short PTFE tubing, melting it with a lighter or candle, retracting it back into the tubing and immediately plunging the filament to be fused into the tubing: One problem with this method is that you can't really control the temperature at which you melt the filament, so you frequently end up with a brittle joint that breaks upon the slightest bend. Aliexpress even sells a contraption that works along the same line. As it uses a lighter or candle as well, it suffers from the same weakness. I am not even sure why you need a special contraption when a short PTFE tubing will work just as well. Another method involves using shrink tubing/aluminium foil, and a heat gun: But a heat gun is rather expensive, so I wanted to explore other alternatives. The candle + PTFE tubing method actually works quite well when you happen to melt it at the rig

Attiny85 timer programming using Timer1

This Arduino sketch uses Timer1 to drive the LED blinker: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 /* * Program ATTiny85 to blink LED connected to PB1 at 1s interval. * Assumes ATTiny85 is running at 1MHz internal clock speed. */ #include <avr/io.h> #include <avr/wdt.h> #include <avr/sleep.h> #include <avr/interrupt.h> bool timer1 = false , led = true ; // Interrupt service routine for timer1 ISR(TIMER1_COMPA_vect) { timer1 = true ; } void setup() { // Setup output pins pinMode( 1 , OUTPUT); digitalWrite( 1 , led); set_sleep_mode(SLEEP_MODE_IDLE); // Setup timer1 to interrupt every second TCCR1 = 0 ; // Stop timer TCNT1 = 0 ; // Zero timer GTCCR = _BV(PSR1); // Reset prescaler OCR1A = 243 ; // T = prescaler / 1MHz = 0.004096s; OCR1A = (1s/T) - 1 = 243 OCR1C = 243 ; // Set to same value to reset timer1 to