• News
  • 5 August, 2009
Share

Using Cyanogen’s Recovery Tools to Partition a 16GB SD Card for Apps2SD

After waiting and waiting I decided it was time to setup and Ext3 partition and give Apps2SD a try. I have a 16GB Class 4 SD card and had read that using a Class 4 card would be slower but it would work. I was previously under the impression that using a Class 4 SD card could cause problems, but that seems to have been old news (or news that was invalid).  So I went ahead and decided to try it out and in the process wrote this guide.

Please read this COMPLETE GUIDE before using any of the commands

It ‘s much easier today using the recovery tools provided in Cyanogen’s latest recovery image available at the XDA forums or here in our downloads section (v1.4 is the version I was using for this guide).

The rrecovery image includes the following tools to help you manage your partitions:

PARTED:
Parted allows you to manage your partitions so you can easily create and delete partitions without having to use Linux or other complicated methods.

MKE2FS:
mke2fs is used to create an ext2/ext3 filesystem.

UPGRADE_FS:
Upgrade_fs is used to upgrade your existing Ext partition to Ext3

The hardest part is working out what parameters should be used in parted to create your partitions.  I hunted around and found lots of information on the number of blocks to use on an 8GB SD card but I wouldn’t find anything for a 16GB.  It appeared that it wasn’t as simple as just doubling the block sizes for an 8GB SD card so trial and error was required.

Before you do any partition work, I recommend that you backup anything you have alternatively is a good idea to use a new SD card so you know if anything goes wrong you can just take out the bad card and insert your old card and be back up and working again.

The number I have used leave room for linux-swap partition.

Even if you don’t use this right now, I was informed it would be a good to plan out my partition sizing with this in mind so I left 128MB at the end of the SD Card.

So the first you have to do is boot your phone into Cyanogen’s Recovery Tools using the Home and Powerbuttons and then select the “go to console” option..

I can’t say for sure that these parameters are correct for every 16GB card (maybe someone can confirm and explain this better) but the commands and parameters I used where as follows:

parted /dev/block/mmcblk0
print

This will give you a list of any existing partitions on your SD Card.  Each partition is numbered and you to use the

rm #

command to remove each partition.  Where # is the partition number shown on the list from the print command

mkpartfs primary fat32 0 15292
mkpartfs primary ext2 15292 15804

If you want the linux-swap partition, run the following command, otherwise just skip this partition creation and the space will still be there if you want to add in the future.

mkpartfs primary linux-swap 15804 15932

quit
upgrade_fs
recovery

I’m not an Android OS /  linux guru but after much research in XDA and other place on the Internet, these steps are what worked for me.

I cannot guarantee that this guide will work for you and I am not responsible for any issues that may arise from following this guide.
** TRY THIS AT YOUR OWN RISK **

To find out more about Cyanogen’s Recovery image, head over to Cyangen’s Recovery Image XDA thread.