15 April 2015

Android Angles: Sony Xperia C insufficient disk space woes and a general intro. on Android file systems

[ EDIT - some widgets won't function properly when moved to SD card, so bear that in mind ]

I recently said goodbye to my BlackBerry love affair. It wasn't like I wanted to go off BlackBerry but there just wasn't anything available to replace my (really run into the ground) 9800. If I was going to get a touch screen I figured I may as well try out Android (iPhone was too expensive).

Anyway, I ended up with the Sony Xperia C - a budget phone with reasonable spec's. The real downside (and at the time, all the advice I got said this could be fixed by installing an SD card) is the small memory partition - device memory of 1GB which is clearly not enough, especially when apps store their data in this same 1GB partition.

It was not long after using the phone that I started to get errors trying to install applications - "error: insufficient disk space". Hitting my limit on the 1GB!

0.98GB of device memory is just simply not enough
(in this picture I have cleared the cached data and already moved most apps off)

The big problem is, this 1GB partition is meant to store your cache, apps, and app data.

Trying to move apps off the internal 1GB to the 32GB SD card didn't help much either because the bloatware apps had the "Move to SD card" greyed out.

Move to SD card is greyed out

Assuming it was an OS problem, I checked on friends' Android devices and found the same hitch with moving to SD card - theirs were also greyed out. I concluded this is an Android limitation and not just my phone. Thankfully, there are ways around this, which is how I have managed to move off most of my apps to the SD card - and here's what you need to understand.

/system is read-only

The apps that cannot move to SD card are actually "system apps" by virtue of the fact that they are stored in a /system partition on the phone. The /system partition is designed to store the operating system and any mission critical applications but some vendors (most?) also store their pre-installed apps here. The /system partition is read-only to protect the user from losing essential services. There's one snag with this read-only attribute, though, and that is that you cannot move or uninstall any of these /system apps. You will find most of the bloatware apps are in /system/app ...

/data is free-for-all

There are some apps that deploy to /data (also called userdata), like most of your downloaded apps. If you wipe /data you are essentially running a factory reset on your device, since /system is untouched.

Using certain apps (e.g. Link2SD) you can actually convert /system apps to /data apps, which is really just moving the app from /system (read-only) to /data (read/write). Once they are in /data you can move them to SD card.

I have avoided moving all of my apps to /data because I believe some are system-critical and are probably best to be kept safe from prying trojans and tomfoolery.

Anyway, once I understood that /data and /system were different partitions with different file permissions, I was able to understand how to move some apps that could not allow move to SD card to the SD card - it just took a conversion to a User app, and then a move from the internal storage to the SD. 

Now, I am still finding that I run out of space because all of the apps still want to store some data to the main internal memory. My next challenge is to repartition that internal storage to device memory, since I use the SD card as my storage and the 1.20GB is sitting there more or less untouched...

All your space are belong to me!

No comments: