Tips
How to create a 2nd partition to install Android apps on an SD card
September 8, 2009 | by Andrew Kameka
Android Hacks, Android Tutorials
If you’ve rooted your Android phone, it may have been because you wanted to free up space and install apps on your SD card. Certain ROM’s have this feature built into, so all a user has to do is create a second partition on his or her SD card. This tutorial will show how to partition an SD card without installing any programs or SDK’s.
Before we go any further, you will need to root your phone for this to work. For the 1,000th time, THIS IS RISKY, CAN DESTORY YOUR PHONE, AND CAN VOID YOUR WARRANTY. Androinica.com accepts absolutely no responsibility if problems arise from rooting your phone; you root at your own risk. If you need instructions on how to root, AndroidAndMe has an excellent explanation.
Now onto the partition. Some like to use a Linux live CD, the Android SDK, or programs like Paragon Partition Manager. Or you can just do it manually through Android like I’ll show here. To give credit where’s it’s due, this tutorial is directly based on this great explanation available at XDA.
How to create a second partition directly from your G1
Make sure that you have the following:
- A T-Mobile G1/HTC Dream (use the AndroidAndMe SDK tutorial if you don’t have a physical keyboard on your phone)
- cm-recovery-1.4 (Recovery image that came with the one-click root method)
- SD card, preferably class 6. SD cards are labeled according to speed. Class 6 [6 MB/s - 40x] cards are great to have but not required. I highly advise upgrading to an 8GB SD card if you haven’t already.
- A ROM that supports ext3/4 and swap (your ROM will tell you. If you have CyanogenMod, its’ there)
Warning: Copy the SD card to your computer if there’s anything you want to save. This will wipe everything off your card.
If you make a mistake while in parted mode, you can typically follow prompts to get help or you can enter “quit” to return to the console and start over.
1. Turn off your phone and then enter recovery mode
Power off, and then hold the Home and Power buttons at the same time
2. Go to the console and then press enter
- Scroll to and select [Alt+X Go to Console]
- Once in console, you should see a command telling you to “Press <enter>” Do it and you’ll see this screen
3. Type “parted /dev/block/mmcblk0″ (Note: That’s a zero, not the letter ‘O’)
You should then see a screen welcoming you to parted.
- Type “print” and press enter
Numbers will vary depending on the size of your SD card, but you should see a screen like this:
4. Delete existing partitions
The rows labeled “Number 1″ and “Number 2″ must be deleted before proceeding.
- Type “rm 1″ and press enter.
- Type “rm 2″ and press enter.
5. Do the math for each partition
Look on the fourth row and note the exact size of your SD card. The example used for this tutorial is 2033 MB. You will need to break this number into three sections:
- fat32 (VARIES) – This will be the remaining space where you store music, photos, etc.
- ext 2 (500 MB) – This is the partition where apps will install. 500MB should typically be enough space to store every app that you desire.
- Linux swap (32 MB) – It’s generally recommended to set aside 32 MB for a linux swap. You may find that a ROM requires a different number. Always read and follow what your ROM developer recommends.
So if we have a 2033 MB card, we perform these basic equations
2033 – 32 = 2001 (linux-swap)
2001 – 500 = 1501 (ext2)
Remember these numbers for the next step.
6. Create partitions
You MUST create partitions in this order: fat32, ext2, and then linux-swap. Type in the command for each one at a time. The commands should look like this:
- mkpartfs primary fat32 0 1501
- mkpartfs primary ext2 1501 2001
- mkpartfs primary linux-swap 2001 2033
Need more explanation? Did you run into a problem?
7. Confirm that everything went according to plan
Enter “print” and you should now see something like this:
8. Close parted by typing “quit”
You need to exit parted in order to upgrade the SD Card. Don’t worry if a message about updating fstab appears.
9.a Convert ext2 to ext3
You’ll probably need to upgrade to ext3 or ext4 for your ROM to install apps to the SD card. What’s the difference? They perform the same basic functions and you can easily get by on ext3 without any problems; ext4 is just the next version that includes improved performance. More info available here.
- Convert to ext3
Type “upgrade_fs” and press enter.
You are now DONE! You can re-enter parted and enter “print” to confirm the change took place or proceed to step 10 to exit.
9.b. Upgrade to ext4
This is an OPTIONAL step. After you have upgraded to ext3, you can choose to go to ext4 by typing the following commands. They are case sensitive, so make sure that you type upper-case letters when necessary. Remember that typing in console is different from what you normally do in a G1. Rather than pressing the up arrow button once and then a letter to capitalize, you must hold down the arrow button and then press the letter.
- tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
- e2fsck -fpDC0 /dev/block/mmcblk0p2
Once file check is done, you can re-enter parted and enter “print” to confirm the change took place or proceed to step 10 to exit.
10. Exit and return to recovery screen
If you followed all the instructions, your SD card should know have an SD partition. As you start installing apps, you’ll notice that those pesky running out of space errors will be a distant memory.
- If you’re in parted still, enter “quit”
- Enter “recovery” and you’ll be returned to the recovery screen.
- Reboot your Android phone by selecting “[Home + Back”


















I must say that using gparted on linux was nice and easy. As much as I love the terminal, gparted is the way to go.
GNU parted supports non-destructive resizing of partitions using the ‘resize’ command. If you start with just a FAT32 partition (as most people will rather than this example which for some reason starts with an SD card that’s already got an ext2 partition) you can very likely just resize the FAT partition instead of deleting it. Still a good idea to back it up first though.
This is an excellent tutorial! I had tried another methiod first that didn't include the linux-swap command and it simply wouldnt work. Your directions were precise and worked perfectly. Thanks so much!!
Its a nice one for all who wants to try android but i want try it until I am sure about the safety of my phone because loosing warranty might cause many bucks.
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. Susan http://carusbcharger.com
Awesome guide. I tried it with the stock 1GB card that came with the phone. It worked perfectly.
Thank you so much! only place I have found that gave clear and to the point directions that ACTUALLY WORKED!
yeah gr8 job man i was looking to do this in so many places but everywhere i went i was getting confusing info thnks a lot!!!!
i need help! I have the stock 1gb sd card and i did everything but when i get to the linux part it says "error the location 1024 is outside of the device /dev/block/mmcblk0" I dont know what this means everything worked good
Are you sure you removed the earlier partitions and did the math right when figuring how much space you have. What does your screen say?
With the stock sd card your actual size is 1016 so your partitions should look something like this: 0 484 484 984 984 1016
Ok… doing the math was a bit tricky remembering which was which… fats32/linux/ext2…. but it all worked in the end… like every one else stated.. this was step by step at its best!
When I try to partion according to the math, it tells me that my partions are too big/small My setup= 16.1 gigs. Isn't that 16,100-32= 16,068 (linux-swap) 16,068-1024=15,044 (ext 2) That's make my Fat32 15,044 leftover, no? I'm lost. This 16gb sdcard is throwing me for a loop here.
Could you please add a link for phones without a physical keyboard. I did a search for AndroidAndMe SDK tutorial and I couldn't find what I needed.
Thank you very much! Very easy howto even for me german!
Very good job!
Easily, one of the best things I’ve read today! Subscribed.
I do not have parted installed on my phone (Oxygen 1.0.4). Is there a way to get parted installed?
fdisk used to be the standard linux command for repartitioning, parted seems similar although im not sure u can tag filesystems to the extent that fdisk did. there should be some quick in command help?
I know this seems like a silly question, but I can't figure out how to hold the home button down on a Galaxy Prevail..there are not many tutorials on this phone either. Does anyone else have this phone? My recent post Google PageRank Update June 27th, 2011
I'm having problems with this,it says that I can't delete the partition while is mounted
how to create the 3 partition such that windows explorer can see the FAT32 partition when put the sd-card into the card reader?
Just using Easeus Partition Manager. very easy and fast. I can create a new partition in my sd card easily.
please use ROM manager for partitioning the sd card. Download it from Market. its very easy.
All this is way over my haed. All I am trying to understand is how to get my Gal. Nexus S to work as it did before I upgraded to JellyBean. Cant answer my unit the same way as before, with a swipe of the phone symbol for one thing. Is there any place I can look to get information on how to’s on recovering after the upgrade??????