Apr 092013
 
Article Android

Owners of android devices often find that, after installing some apps, start receiving warnings about the internal storage being almost full. Sometimes, this problem prevents the installation of updates of some “heavy” apps, such as Google Maps. In this post we will review some actions that can be performed to fix this issue.

How to analyze the usage of the internal storage

The internal storage in an android device is mainly divided into two partitions, /system and /data. It may happen that one of the partitions is almost full, even if there is enough free space in the other.

To perform a detailed analysis of the memory usage, we can install the “DiskUsage” app from the Play Store.

In a rooted device, this app allows us to find out exactly how much free space is available in each of those partitions, and what is using the rest:

DiskUsage

 

In the above sample image, we can see that there are:

  • A 180,9 MB /data partition, with just 34.2 MB free. 56,4 MB are used by the “dalvik-cache”, and 8,38 MB are used by the web browser cache.
  • A 208 MB /system partition, with just 18,1 MB free. The ‘/system’ partition contains all the ‘.apk’ files that hold the code of the installed apps.

We could free part of the occupied space in the ‘/data’ partition, moving the ‘cache’ directories used by many apps to the SD card.

To free space from the ‘/system’ partition, we must either delete some apps, or else move them to the SD card.

The next sections explain the detailed procedures to follow to perform these operations.

Moving cache directories to the SD card

This operation requires a rooted android device. Besides, we must be able to access the device in command-line mode. This can be achieved by installing the “Terminal Emulator” app, o else connecting from a computer, using ADB.

Once connected, we can move the generic ‘/cache’ directory, and app-specific cache directories, to the SD card:

To move ‘/cache’:

To move the cache directory of the browser:

Google Maps

Google StreetView

Google Play

Gmail

Voice Search

Moving apps to the SD card

1. Partition the SD card

To be able to move some apps to the SD cards, it must be previously partitioned.

NOTE: This operation erases all the content of the card. Before proceeding, we must make a backup copy of any information that we want to preserve.

There are several Windows tools available to perform disk partitioning. In this post we will use the free application MiniTool Partition Wizard.

In principle, it is enough to create two partitions. The first partition is a “standard” partition. This partition will be accessible from a computer when the android device is connected to it with the USB cable. The second partition is where apps in the phone’s internal storage will be moved.

NOTE: Optionally, a third partition can be created to be used as “swap”. This partition will only be used if a “custom ROM” with support for swap is installed in the device (the stock android system does not have support for swap). To learn more about using swap partitions, searching in Google for the app “Swapper 2 (for root users)” should return some useful pages.

After inserting the SD card in the computer, start the Partition Wizard. In our case, the card appears as “Disk 2” (E:) with a 7.45 GB partition of type FAT32.

Partition-Wizard-1-EN

 

Select the partition in the SD card, and press “Delete” in the menu at the top.

Next, select the free space in “Disk 2”, and click on “Create” in the top menu. A popup is displayed, where we can configure a new partition of type FAT32, with a size of 6000 MB, labelled “Data”

Partition-Wizard-2-EN

 

Repeat the operation to create a second partition, Primary, type Ext2, using the remaining 1.59 GB, labelled “Apps”. The Partition Wizard will display a message notifying that this second partition cannot be used in Windows:

Partition-Wizard-3-EN

Just acknowledge the message by clicking “Yes”.

After doing this, the SD card’s partition table is as shown below:

Partition-Wizard-4-EN

 

Once we are satisfied with the setup of the partition table, click on “Apply” in the top menu, and wait until the partitioning finished. The dialog box informs about the progress of the operation:

Partition-Wizard-5-EN

 

Once the partitioning completes, use the windows explorer to restore into the first partition the backup of the previously existing data, if any.

Now we can extract the card from the computer and insert it in the android device.

 

2. Installing Link2SD and moving apps to the card

Next, install in the phone link2sd. This apps will allow us to choose which apps to move to the ext2 partition in the SD card.

When it is run for the first time, link2sd asks us to select the filesystem type of the second partition in the SD card. After selecting “ext2” and pressing “Accept”, the phone reboots.

The second time link2sd is executed, it displays the changes in the last release, and then lists the apps that can be moved to the SD card:

link2sd-01-ENlin2sd-03-EN

 

When we select an app to be moved, such as “Maps”, a new screen is displayed with options “Move to the SD card” or “Create link”. Choose “Create link”. In the next screen we are requested to confirm the creation of links for the app, the “dalvik-cache” and the libraries (the checkbox for the libraries is disabled because “Maps” does not use them).

link2sd-04-EN link2sd-05-EN

 

Repeat the same procedure for any other application that we want to move to the SD, and that’s it!.

 Posted by at 2:56 pm

 Leave a Reply

(required)

(required)