Migrating G1 Apps to SD

18 June 2009

After adding yet another app to my G1 I recieved my first “Low Disk Space” warning. I decided to see what options exist for moving the apps from internal storage to the SD card and found a few how-tos out there that describe the process. I ended up following the A2SD guide, with little problem.

The first step is to repartition your microSDHC card from one large Fat32 partition into two partitions: the first remains Fat32, the second is formated ext2. Since I don’t have a Linux box at work (and I was hoping to get this done over my lunch break), I fired up a VM and ran GParted, an open source Linux live CD that we use at work for resizing VM partitions. Using GParted, I was able to shrink the Fat32 partition from 4GB down to 3GB, and created the necessary ext2 partition from the remaining space. I should note that I used the phone as an microSDHC reader – it was on and functioning the entire time.

Since the Android SDK was already installed, the next step was relatively simple to complete. I fired up the command prompt on my Windows 7 box, and ran adb shell (this opens the shell on the phone).

To make sure the partition was correctly set, I ran busybox df -h and verified that the ext2 partition was showing up in the mount table.

App2SD_VerifyPartition

Since I only want to move the apps (not their cache) to the microSDHC card, I only had to run one command busybox cp -a /data/app /system/sd. This copies all the existing app data from the phone storage over to the microSDHC card.

The next step didn’t appear to work for me… but for completeness sake:

I then booted my phone into the JF Recovery mode by shutting down my phone, then starting it up holding the Power and Home buttons. I pressed Alt-X to get to the phone’s terminal and ran the following commands:

mount data
rm -rf /data/app
ln -s /system/sd/app /data/app
reboot

I’m not sure what the first command does (mounts whatever device is mapped to data in the mountd.conf file I’d assume). The second command removes all apps from the phone. The next command creates a symlink from the microSDHC partition to the directory Android is expecting the apps to be located. Lastly, the phone is rebooted.

When I did these steps, it didn’t take – the applications were still on my phone memory (as evidenced by the free space available). As I think back, I may have forgotten to mount data (but one would assume I would have gotten some errors while trying to delete the contents of /data/app. I verified the apps were still located in phone memory by once again plugging my phone in via USB and running adb shell. I reran the last three commands above (from rm -rf through to reboot) and everything had successfully moved off to the microSDHC card.

Now I’m running over 70 apps, and the phone actually appears to be responding faster.

Comments (1) Trackback Leave a comment
  1. KonstantinMiller July 6th, 2009 at 15:02 | #1

    Hello. I think the article is really interesting. I am even interested in reading more. How soon will you update your blog?

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">
  1. No trackbacks yet.