Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,173 Members 41,261 Now Online
XDA Developers Android and Mobile Development Forum

[TUTORIAL] Partitioning your sd-card correctly

Tip us?
 
abaaaabbbb63
Old
(Last edited by abaaaabbbb63; 25th May 2013 at 11:56 AM.)
#1  
abaaaabbbb63's Avatar
Recognized Contributor - OP
Thanks Meter 2907
Posts: 3,705
Join Date: Nov 2011
Location: Somewhere Over The Rainbow
Default [TUTORIAL] Partitioning your sd-card correctly

Correctly partition your sd-card for extended memory use




Many users on this forum don't know how to partition their sd-cards correctly, resulting in later problems with ROMs, like lag issues, or data losses. This guide will help you partition your sd-card correctly.

There are several potential partitions where app-data can be installed to, usually the internal memory-partition is used for that. Unfortunately, the Desire's internal memory if only 147mb in size, and can only be increased by a maximum of 100mb with a hboot change. With apps increasing in size in the last few years, and devs not caring anymore about their app size, this small internal memory can't hold more than 10-20 relatively small apps.

Since Android 2.2 Froyo, users have been able to move part of the apps on the sd-card, but it's still not enough, with most of the data and dalvik cache filling up the internal memory. Therefore most custom ROMs incorporate an extension that allow additional partition on the sd-card to be used exclusively as an extension to the internal memory partition 'data', which is referrred to as 'sd-ext'.


----------------WARNING----------------

Everything on your sd-card will be wiped. Backup your sd-card before proceeding.

I do not take responsibility for anything that happens with your phone/ sd-card.




----------------INFO----------------

There are two methods to correctly create an ext partition on your sd-card. These are:

- 4ext Recovery method
This method requires you to be S-OFF, but it's the easiest one.

-Gparted method
This can be done, regardless of being S-OFF or not.


These two methods are the best ones to use. Other means could result in sd-card damaging, or other problems. Do not use:
ROM Manager, CWM Recovery, Windows Minitool Partition Wizard etc.


All you need for this process:
A 4ext recovery compatible phone ( for the 4ext method)
A Micro Sd-card.
A computer.
A writable CD (For Gparted Method)
A rom with init.d scripts support.
A brain.

----------------4ext Method----------------

This method consists in flashing a new recovery on your phone, and it requires you to be S-OFF.
If you aren't S-OFF, check this out:
http://forum.xda-developers.com/showthread.php?t=805811

Now. let's start.

[1] For Rooted ROMs

1. Go here: http://4ext.net/

2. Click on "4EXT Recovery Updater" and download the .apk.

3. Put the .apk on your sd-card.

4. Install the app, and open it.

5. Select "Online Install | upgrade". Confirm your phone model.

6. Select the latest "Touch" recovery, or "Classic", depending on your preferences.
Skip to [4]

[2] For ROMs that are not rooted (PB99IMG)

1. Go to this thread :http://forum.xda-developers.com/show....php?t=1751258

2. Download the file: PB99IMG.zip

3. Place the file on the root of your sd-card (like... not in any folder)

4. Power off your phone

5. Boot in hboot (Power Down + Volume Down) or, if Vol Down is broken, in fastboot (Power Button + Back button) and select
"Bootloader".

6. Wait until a message appeares. Select yes.

Skip to [4]

[3] For ROMs that are not rooted (Fastboot)

This requires you to have ADB and Fastboot installed. Check out this guide : Long link

1. Download the PB99IMG from this thread :http://forum.xda-developers.com/show....php?t=1751258

2. Extract the .img from inside the zip.

3. Put it on the the C:/ drive.

4. Boot your phone in fastboot (Power + Back button), then connect it to your PC.

5. Open CMD

6. Type "fastboot flash recovery C:/recovery.img"

Go to step [4]

[4] Partitioning your sd-card through recovery.

Now, you have installed 4ext recovery. We can continue.

1. Boot in recovery. (Power + Volume Down, then select "recovery")

2. Select "Tools".



3. Select "partition sd-card"



4. Select "Remove all partitions and start from scratch" (Hope you backed up your sd-card)



5. Select your sd-ext partition size. Recommended : minimum 512mb.



6. Skip sd-ext 2 (If asked for it)



7. Skip swap. (If the rom you want to install requires swap, then select 128 mb)



8. Choose Ext4 as your partition type. (Ext4 is faster than Ext3)



Voila, now you have an ext partition.

Skip to "Using the ext partition".

----------------Gparted Method----------------

1. Download gparted Live CD (.iso) from here: http://gparted.sourceforge.net/download.php

2. Once downloaded, burn it on a CD using a burning software.

3. Connect your phone to your PC, and select "Hard Disk" mode.

3. Restart your computer and enter boot menu (usually by pressing F2/F12)

4. In boot menu change the boot order to bring your CD drive on the top, save settings and exit.

5. Restart your computer. You will get some options. Select the one that says to boot Gparted, or something like that.

6. Select your language by entering a given number.

7. You will next have 3 options. Type 0 and hit enter.

8. Now you should be booted in Gparted. You should see your sd-card info, together with your PC's partitions. Select your sd-card.

9. After selecting, you can see your sd-card on the main screen, along with partitions. Delete all partitions, for a clean start.

10. Right click on the "Unallocated space", and click "New"

11. A box will appear. First, create a Fat32 partition. Click the drop down box and select "Fat32". Now write in the "Free space following" box the size of your future ext partition, and, if the ROM you want to install requires a swap partition, add 30 mb to that value. (Example: 1024mb+30mb= 1054mb)

*In order for especially windows-systems being able to mount your sd-card when connecting your device to a pc, sd-ext should be following your first sd-card partition (typically Fat32). Like... create the Fat32 partition first.

12. Now you'll see 2 partitions. Right click on the unallocated one again, write 30mb in the "Free space following" box, then select what kind of partition you would like between Ext 2,3 or 4 ( 4 recommended).

13. Now, right click on the unallocated 30 mb, and create a "Linux swap" partition, just in case.(Optional, only of ROM requires swap)

14. Click "Apply".

15. On the top left of your screen you can see an icon named as exit/turn off, click on it. You now finished partitioning.

Video for better understanding:





And yes, now you may copy back your stuff. (Again, hope you backed up)


----------------Using the Ext partition----------------

After creating an ext partition, you have to actually use it. Most ROMs have a2sd scripts incorporated that use your ext automatically (check the ROM thread), but some ROMs don't, or you just want another type of a2sd scripts.

You can use the following a2sd scripts:

Mounts2sd
This is a script that lets you choose what you move to sd-ext.
http://forum.xda-developers.com/show....php?t=1342387

CronMod
Another set of scripts. Each one has a description. Read it carefully.
http://forum.xda-developers.com/show....php?t=1716124

Before flashing any scripts, remember to:
Do a nandroid backup
Delete any other a2sd scripts from the folder : /system/etc/init.d
Wipe cache and dalvik cache after installing a script.

Tip:
Unless you have a fast sd-card (Class 6 or Class 10), you should let your /data partition on your internal memory. Moving it to sd-ext could cause slowness. Move dalvik cache and system/app instead.

After you install one of these scripts, you can finally enjoy the extended memory of your phone.

Note: For most scripts, you will not see the actual ext partition as a memory extension (like, instead of 148 mb, you will not have 1148mb), but it will be there, doing its job.
To actually see your sd-ext, install a storage app, like this one : https://play.google.com/store/apps/d...ikun.freespace.



----------------Problems?----------------

Still getting low memory warning?
1. Use the above suggested app to check your partition.
2. Are you using the correct hboot for your ROM?
3. Did you actually install a script? Did you configure it correctly (Mounts2sd)?
4. You may be having way too many apps, even for your extended memory. Uninstall some. Remember that memory is still limited.
5. Maybe your ROM doesn't support init.d scripts (needed for a2sd). Check out this thread :
http://forum.xda-developers.com/show....php?t=1710980
6. If none of above work, start from the beginning, or use another method.



---------------------------------------Thanks---------------------------------------

-pyroblazer
-madmaxx
-AndroidGX

Special thanks:
-eddiehk6
-jmcclue

P.S. If you see anything wrong with this guide, or if you think I should add something, please tell me. Thanks.
The Following 73 Users Say Thank You to abaaaabbbb63 For This Useful Post: [ Click to Expand ]
 
DigginGraves
Old
#2  
Account currently disabled
Thanks Meter 21
Posts: 81
Join Date: Dec 2012
Very nice, and neat too.

This is one of the best guides of this type I've ever seen.

Thanks!
 
jmcclue
Old
#3  
jmcclue's Avatar
Recognized Contributor
Thanks Meter 1307
Posts: 3,392
Join Date: Apr 2012
Default Re: [GUIDE] Partitioning your sd-card correctly

Very good :thumbup:

1 thing tho, regarding 5 and 6 using 4ext recovery.

5. Choose mb size for ext...ok
6. Skip swap...ok

In 4ext recovery, after choosing first partition size, it asks u to choose second partition size then swap size. So maybe should be...

5 - 512mb - 1.5gb
6 - Skip
7 - Skip

Done.

Very good guide tho, bout time someone wrote it. Good job

Sent from my HTC Desire
RSK Sattelite SuperSense4.1
The Following 2 Users Say Thank You to jmcclue For This Useful Post: [ Click to Expand ]
 
abaaaabbbb63
Old
#4  
abaaaabbbb63's Avatar
Recognized Contributor - OP
Thanks Meter 2907
Posts: 3,705
Join Date: Nov 2011
Location: Somewhere Over The Rainbow
Quote:
Originally Posted by jmcclue View Post
Very good :thumbup:

1 thing tho, regarding 5 and 6 using 4ext recovery.

5. Choose mb size for ext...ok
6. Skip swap...ok

In 4ext recovery, after choosing first partition size, it asks u to choose second partition size then swap size. So maybe should be...

5 - 512mb - 1.5gb
6 - Skip
7 - Skip

Done.

Very good guide tho, bout time someone wrote it. Good job

Sent from my HTC Desire
RSK Sattelite SuperSense4.1
Thanks.

Weirdly enough, I partitioned an older 4 gb class 2 sd-card just to see step to step what happens, and 4 ext didn't ask for a second ext partition. Maybe the latest versions are this way.

Anyways, i made the modifications.
The Following 3 Users Say Thank You to abaaaabbbb63 For This Useful Post: [ Click to Expand ]
 
eddiehk6
Old
(Last edited by eddiehk6; 30th January 2013 at 06:49 PM.)
#5  
eddiehk6's Avatar
Senior Member
Thanks Meter 551
Posts: 1,305
Join Date: Dec 2010
Location: London
good stuff, very clear. should be made a sticky

few suggestions after also reading many Q&A threads:

- recommended size of partition
simply depends on how many apps users want to install, surprising how some users don't understand this.

- gparted section,
might as well link a video, always much easier to follow once you've seen it.

- using the ext partition
  • a lot of users expect their internal memory to read "internal + ext partition", when actually the partition is already in use without flashing any additional scripts. recommend first to check the ext partition is in use by installing various apps: diskusage, quick system info pro or titanium backup.
  • In many cases users won't have to 'use the move to sd' function, just keep apps on internal will trick apps to ext-partition. again this depends on the script, but can be checked as above.
  • when flashing different a2sd script, is it not necessary to delete the previous script first in /system/etc/init.d? not tried this myself but i would assume it may cause conflicts. definitely recommend nandroid backup and dalvik wipe before flashing any of these!
  • could also add a note to say that generally it is better to keep app data on the /data partition for stability and performance, unless they have fast sd card.

- add a "still getting low memory warning?" section?
  • use diskusage as suggested to check the partitions
  • make sure you are using the correct hboot for your rom (requires s-off), check the rom's system size using 7zip, or read each rom's OP or search within each thread for optimal hboot.
  • you may have too many apps, no matter which script you use there is still a limit. uninstall some apps you don't need
these aren't anything major, just fine tuning if you want to include
Device: Nexus 5 | ROM: SlimKat | Recovery: PhilZ Touch
Retired: HTC Desire
_____________________________________________
let's all try to get along ...but remember to search first...
The Following User Says Thank You to eddiehk6 For This Useful Post: [ Click to Expand ]
 
jmcclue
Old
#6  
jmcclue's Avatar
Recognized Contributor
Thanks Meter 1307
Posts: 3,392
Join Date: Apr 2012
Default Re: [GUIDE] Partitioning your sd-card correctly

Quote:
Originally Posted by abaaaabbbb63 View Post
Thanks.

Weirdly enough, I partitioned an older 4 gb class 2 sd-card just to see step to step what happens, and 4 ext didn't ask for a second ext partition. Maybe the latest versions are this way.

Anyways, i made the modifications.
Yh it says at the top just below the status bar, its very small so alot of people probably dont see/notice it. Like when u press to "remove all partitions and start from scratch" then u choose, lets say 1024, the next part press skip, but when u press skip the screen doesnt change apart from the wee writing at the top so some people think when they pressed skip nothing happend so they press skip again then it partitions sdcard. Hope that makes sense lol

And yh like eddie said it should be made a sticky or atleast u could ask Mr.Mefisto to add it to his everything desire guide.

Il add it to my sig anyway if thats ok with u?

Sent from my HTC Desire
RSK Sattelite SuperSense4.1
 
abaaaabbbb63
Old
#7  
abaaaabbbb63's Avatar
Recognized Contributor - OP
Thanks Meter 2907
Posts: 3,705
Join Date: Nov 2011
Location: Somewhere Over The Rainbow
Quote:
Originally Posted by eddiehk6 View Post
good stuff, very clear. should be made a sticky

few suggestions after also reading many Q&A threads:

- recommended size of partition
simply depends on how many apps users want to install, surprising how some users don't understand this.

- gparted section,
might as well link a video, always much easier to follow once you've seen it.

- using the ext partition
  • a lot of users expect their internal memory to read "internal + ext partition", when actually the partition is already in use without flashing any additional scripts. recommend first to check the ext partition is in use by installing various apps: diskusage, quick system info pro or titanium backup.
  • In many cases users won't have to 'use the move to sd' function, just keep apps on internal will trick apps to ext-partition. again this depends on the script, but can be checked as above.
  • when flashing different a2sd script, is it not necessary to delete the previous script first in /system/etc/init.d? not tried this myself but i would assume it may cause conflicts. definitely recommend nandroid backup and dalvik wipe before flashing any of these!
  • could also add a note to say that generally it is better to keep app data on the /data partition for stability and performance, unless they have fast sd card.

- add a "still getting low memory warning?" section?
  • use diskusage as suggested to check the partitions
  • make sure you are using the correct hboot for your rom (requires s-off), check the rom's system size using 7zip, or read each rom's OP or search within each thread for optimal hboot.
  • you may have too many apps, no matter which script you use there is still a limit. uninstall some apps you don't need
these aren't anything major, just fine tuning if you want to include

Thanks for the suggestions!! Added everything.


Quote:
Originally Posted by jmcclue View Post
Yh it says at the top just below the status bar, its very small so alot of people probably dont see/notice it. Like when u press to "remove all partitions and start from scratch" then u choose, lets say 1024, the next part press skip, but when u press skip the screen doesnt change apart from the wee writing at the top so some people think when they pressed skip nothing happend so they press skip again then it partitions sdcard. Hope that makes sense lol

And yh like eddie said it should be made a sticky or atleast u could ask Mr.Mefisto to add it to his everything desire guide.

Il add it to my sig anyway if thats ok with u?

Sent from my HTC Desire
RSK Sattelite SuperSense4.1
I'm more than ok with adding it to your sig

Apparently, the user DigginGraves already suggested it to Mr. Mefisto.
The Following 2 Users Say Thank You to abaaaabbbb63 For This Useful Post: [ Click to Expand ]
 
jmcclue
Old
#8  
jmcclue's Avatar
Recognized Contributor
Thanks Meter 1307
Posts: 3,392
Join Date: Apr 2012
Default Re: [GUIDE] Partitioning your sd-card correctly

Quote:
Originally Posted by abaaaabbbb63 View Post
Thanks for the suggestions!! Added everything.




I'm more than ok with adding it to your sig

Apparently, the user DigginGraves already suggested it to Mr. Mefisto.
Cool, will add it later.

Sent from my HTC Desire
RSK Sattelite SuperSense4.1
 
eddiehk6
Old
(Last edited by eddiehk6; 31st January 2013 at 02:50 PM.)
#9  
eddiehk6's Avatar
Senior Member
Thanks Meter 551
Posts: 1,305
Join Date: Dec 2010
Location: London
one last thing i just spotted in gparted section steps 11 - 13:

just type free space following as the ext4 partition, briefly explain that ext4 is recommended as it should be slightly faster.

you can ask someone a bit more senior and with more knowledge to confirm, but i think you should remove the bit about swap, it's not necessary. It doesn't extend the memory in any way, in come cases can confuse the system. the custom rom would surely need a way to utilise swap, and most don't even bother afaik. you could in fact add a note to not include swap in case users were thinking about it.

another argument is that you instruct to skip swap in the 4ext recovery method, so should be consistent with gparted.
Device: Nexus 5 | ROM: SlimKat | Recovery: PhilZ Touch
Retired: HTC Desire
_____________________________________________
let's all try to get along ...but remember to search first...
The Following User Says Thank You to eddiehk6 For This Useful Post: [ Click to Expand ]
 
abaaaabbbb63
Old
#10  
abaaaabbbb63's Avatar
Recognized Contributor - OP
Thanks Meter 2907
Posts: 3,705
Join Date: Nov 2011
Location: Somewhere Over The Rainbow
Quote:
Originally Posted by eddiehk6 View Post
one last thing i just spotted in gparted section steps 11 - 13:

just type free space following as the ext4 partition, briefly explain that ext4 is recommended as it should be slightly faster.

you can ask someone a bit more senior and with more knowledge to confirm, but i think you should remove the bit about swap, it's not necessary. It doesn't extend the memory in any way, in come cases can confuse the system. the custom rom would surely need a way to utilise swap, and most don't even bother afaik. you could in fact add a note [to I]not[/I] include swap in case users were thinking about it.

another argument is that you instruct to skip swap in the 4ext recovery method, so should be consistent with gparted.
Thanks for the observation.

Made it so everyone is happy

The Following User Says Thank You to abaaaabbbb63 For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes