How to partition your Androids SD card to install apps on it

by Ross McKillop on September 28, 2009

Android Windows

This tutorial will take you step by step through the process of partitioning the SD card in your Android phone so that you can save (and run) applications on/from it.

The process of installing programs on your SD card – knows as Apps2SD, App2SD and A2SD – not only allows you to install many more programs on your Android phone, but it keeps internal memory free so your device runs faster.

This tutorial will show you how to partition your SD card so that you can run programs from it.

  1. Before you even get started, here are the disclaimers. First, you’re going to be wiping your SD card completely clean. That means that every file you currently have saved on it, should be backed up before you even get started. Second, you’re going to need a rooted Android phone in order to take advantage of the partitioned SD card. Luckily we have a detailed tutorial that shows you just how to do that, if you haven’t already. Finally, you’ll need to have the Android SDK installed on your PC. And as you may have guessed, we have a tutorial for that as well (NOTE: you only need to follow the first 10 steps in the previously mentioned tutorial to install the SDK).
  2. Now that you’ve backed up your SD card, rooted and installed CyanogenMod (or any other mod that includes Apps2SD by default) and have the Android SDK installed on your PC – lets get started.

    Right-click on this link and save the file (sdparted.txt) to the root of your C:\ drive. Note: don’t save it to you’re My Documents folder, your Downloads folder or your Desktop. It needs to be saved right on your C:\ drive. This script (sdparted.txt) was developed by “51dusty” at the xda-developers forums. You may want to visit this thread at the xda forums and download the latest version of sdparted.txt, as it is updated somewhat frequently. The version I’ve provided is v0.5.2.


  3. sdparted.txt in the root of C:\

  4. Connect your Android phone to your PC via USB. Boot into cm-recovery by holding down the Home button on your phone when you hit the Power button. This should bring you into cm-recovery (see image below).
  5. Now locate your Android SDK folder. Inside the tools folder, copy the two files adb.exe and AdbWinApi.dll to your C:\windows\system32 folder.
  6. Now open a Windows Command Prompt (click Start > Run > enter cmd and click OK). At the prompt, type:

    adb push /sdparted.txt /sbin/sdparted

    Then enter:

    adb shell chmod 755 /sbin/sdparted


  7. click to enlarge

  8. Now enter the command adb shell. You should get a ‘new’ prompt as seen in the screenshot below.

  9. click to enlarge

  10. At this point you issue the command to partition your SD card. There are a number of ways to do this, but the most common is sdparted -efs ext4

    This will create a swap that’s 32MB, an ext4 partition that’s 512MB and the remainder of your card will be a fast32 partition. This allows for 512MB of apps to be installed on your SD card – which is plenty of space. If you’d like to set your card up differently, see all of the options listed here. For the sake of this tutorial, we’ll run:

    sdparted -efs ext4

    Right away you’ll be asked to confirm this action. Type Y and hit enter. Note: it’s important that you type a capital Y, not a lower case y.


  11. click to enlarge

  12. Again, you’ll be asked to confirm your action. Type Y.

  13. click to enlarge

  14. And yet again you’ll be asked to confirm your action. Type Y.

  15. click to enlarge

  16. Now you’ll be presented with a ‘print out’ of your newly partitioned SD card. It should look similar to the screenshot below (but not exact, unless you have an 8GB SD card, as I do). Type exit to leave the adb shell. Restart your phone.

  17. click to enlarge

  18. That’s it! You’re done! When you install apps now, they’ll be installed to your SD card instead of the interal phone memory – allowing you to install many, many more. You should also see a nice improvement in your phones speed.
  • rafa

    when i try to run command, it says device not found. but my phone is plugged to computer with usb.

  • Tom

    ^ I’m having the same issue.

    adb push /sdparted.txt /sbin/sdparted works fine, but adb shell chmod 755 /sbin/sdparted gives me a “device not found” error

  • Bigtex

    Okay, a while ago I was messing with my phone and setting it up to act as a proxy server while plugged in. Here are 2 tips I found.

    First, be sure you’re using the USB cord that came WITH the phone, others fit it and have No problem transferring files, charging and what not. But, the cord (as you can see if you compare) is actually different and is a better cord than standard. For development modes and doing this you’ll need to use the real cord.

    Second, if you’re using Vista (I use Ultimate x64) there is NO true, proper driver and thus the device is Not found. Yes, your device is plugged in, you can transfer files normally on SD Card, BUT for the developer stuff it doesn’t.

    Now, there is a driver someone put out, which does work However you can’t run it in normal vista, you have to boot vista into a safe mode deal that will have notifiers on the edges of your computer screen. THEN the drive will be allowed use (this is due to the person not wanting to pay to sign the drivers, and vista only using unsigned drivers in this mode).

    So if you’re using Vista (I’m running Windows 7 right now and will Assume it has the same problem) be sure that you’re using the proper cord, the x64 updated driver, in the special mode. Then, and only then, will your device be found in console as such (and you’re right on track to using your phone as a proxy server if its any use to you).

    Otherwise, if you’re on XP x86, I have no clue why it’d not find the device property.

  • xenophone

    two tips might work. Found them at http://forum.xda-developers.com/showthread.php?t=543985
    a. before typing adb push, enter console on the phone(ALT-X)

    b. Skip the pc altogether and copy the file to sd card and then to the phone. This method worked for me..not requiring any SDK/Java installs on the computer. Method listed on the link above. Also posted here (thanks to 51Dusty for this method!)
    1. download sdparted.txt below to root of sdcard. (get downloadcrutch if needed*thnx lycoln)
    2. boot into cm-recovery-v1.4, goto console(alt-x)
    3. at # prompt type: mount /sdcard
    4. then, mv /sdcard/sdparted.txt /sbin/sdparted
    5. then, chmod 755 /sbin/sdparted
    6. you can now run script (ie. sdparted -efs ext4).

  • carlos

    hello thanks for all your help im runnining cyanogen 4.199. Im am trying to partition my 88 gig trascend sd card
    when i type the above command on console i get ” no such file or directory” i have verified that the sdparted file is on root. What can i do. thanks.

  • Bigtex

    Thanks for that tip Xeno, I’m going to give that a shot soon myself.

  • gussde

    @ xenophone… excellent instructions. Worked perfectly on my G1 with cyanogen 4.1999 with a 8GB sd card. Thanks much!

  • Blackmantis

    Hello,
    Just got Apps2SD working (8GB Class 6 Card) on my phone.
    Thnx you guys ROCK!

  • Pingback: rooting my G1 and flashing to CyanogenMod « Teh Tech Blogz0r by Luke Meyer

  • KL

    I already do this procedure successful but not using the adb.

    1. copy the sdparted.txt in my sdcard.
    2. power off the my G1 and enter to recovery (home+end call)
    3. enter console (alt+x)
    4. hit enter once then i type “mount /sdcard”
    5. mv /sdcard/sdparted.txt /sbin/sdparted
    6. chmod 755 /sbin/sdparted
    7. i type “sdparted” then anwer some question with “Y” no “y”
    8. reboot my G1

    when i checked my secondary storage it says “Unavailable”

    Anyone can fixed this annoying output.

    Thanks

  • JJ

    I got stuck at ‘adb devices’ with a “create process failure error 2″ … it turns out that you don’t need step 4 IF when, after installing the Android SDK, you added it to the System Environment Path. If you do copy it to the windows system32 you get this error message. So I deleted both adb.exe and the DLL from that folder, and it worked fine.

  • cookie

    before i go ahead and try all this ….feedback would be nice if anyones done it one a HTC Desire running droid 2.1

  • Pingback: Como instalar o Android 2.1 no Motorola Dext | Droid Brasil

  • Pingback: Partitionieren der sd-Karte im Recovery schl

  • http://www.thomasrye.com Thomas Rye

    When I typed in:
    sdparted -efs ext4

    I get:
    checking script requirements…
    err: /sbin/parted does not exist!

  • Julia

    I get the same as Thomas

  • polaroid

    I’m scared. HTC Eris. I need more room on my phone memory but I don’t wanna mess it up :(

  • Pingback: SD partition - Android Forums

  • http://www.pbs.org onix

    @Thomas/Julia-

    I was running ClockworkMod Recoery 2.5.0.1 for a while on an HTC Magic (32B) not knowing that maybe it was unstable — memory issues I think. ROM Manager on the phone itself allowed me to reinstall what I upgraded from before RA-sapphire-v1.7.0G. Getting back into recovery with this, allowed me to get sdparted to work.

    Hope that helps — your same error was driving me crazy for several days.

  • emeo

    does this work forn sony ericsson xperia x10 mini pro

  • get.siri

    Can anyone help me how to partition my 2 gb sd card in windows xp for my Xperia x10i mini

  • Pingback: Saving Android Apps. to SD card « Mukut Saha

  • asgar

    could i use it for htc wildfire?

  • asgar

    can i use it for my wildfire?

  • u-bm

    Después de tanto buscar y buscar hay les dejo los nombres de los programas q se usan para guardar apps en la sd y para hacer la partición en la sd espero y les sirvan ya q a mi m funcionaron muy bien

    link2sd: para guardar las apps en la sd.
    MiniTool Partition Wizard Home Edition: para hacer la partición de la sd
    Los otros programas como el norton partition magic etc… Son basura te ponen muchas trabas o no arranca o no reconoce la sd bueno los dejo y saludos chavos hehe

  • Joseph

    much easier option is to use minitool partitioning software, it’s free too

  • Pingback: Help me please with rooting my phone - Android Forums

  • Pingback: Braucht man noch eine sd-ext Partition? - Seite 2 - Android-Hilfe.de

  • sumant

    cn we use it on 16 gb sd acrs plz tell ……………
    i m confused:(

  • sumant

    its 16 gb sd card

  • Leon Hernandez

    I already copied AdbWinApi.dll to my C:\windows\system32 folder cheked and they are there… but when i run the cmd thing it says they are not there and closes…

    what can I do?

  • arnab

    Hi I download mini tool for Partition but i can not partition plz tell me how i do it it really need to do but i am very new to android
    device=micromax a60

  • Pingback: SD Karte partitionieren - Android-Hilfe.de

  • Kat

    Looking at doing this when my phone is rooted, will the partition essentially be looked at as part of the phones internal memory, so I can install apps to it that usually will not go on a card?

  • Napphuong

    thank you so much ^^ <3

  • Napphuong

    sdparted -es 1.5G -ss 256M -efs ext4 will give you 1.5G ext4, 256M swap and FAT32(remain)