Guide: Partitioning SD-Card 4 apps2sd & swap partition, the easy way.

Search This thread

lrakkarl

Senior Member
Dec 13, 2011
105
527
Ok. I do not mean any offence to junghyun01.
However this is another method & the one that I personally use.

This requires: stock kernel & dual mode recovery (ClockWorkMod).
Some version of ClockWorkMod that come with custom kernels do not include the necessary options to format your sd-card.
To return to stock kernel on gingerbread or froyo, follow this guide:
http://xdaforums.com/showpost.php?p=21238366&postcount=2


This is the easiest way to create sd-ext/2nd partition+swap partition on sdcard with our phones:
1: Backup all data from sdcard to computer *Important*.
2: Boot into ClockWorkMod by tapping touch-screen while on Sony Ericsson screen
WARNING: We will now delete all data on sdcard, that is why you made a backup.
3: Advanced => Partition SD Card => 512M or 1024M (depending how many apps you want to install & the size of your sdcard) => 0mb for swap size (or if using a custom kernel you can set a swap size of 128m) => Yes to format.
4:Power Off phone.
5:Remove sdcard and put into computer, put the files that you backed up to the computer back on the sdcard.
6:Insert sdcard back into phone and power on. Click thanks.:D


How to enable swap? Warning: This can & will shorten your sd-cards life. Read post #2!
(Swap will only work on a custom kernel!)
After flashing the rom of your choice, flash the add-on "x8EnableSwapPartition2.zip" in ClockWorkMod to enable swap or download ResetSwap from the market.

Credits:
junghyun01 go on give him a thanks for giving me the motivation to create this thread.
lrakkarl@xda(me): Flashable add-on zip, guide, time, information. Click thanks!

x8EnableSwapPartition2.zip=Swappiness set at 40%.
x8EnableSwapPartition.zip=Swappiness set at Android default 60% or whatever % your rom developer has set it at.
 

Attachments

  • x8EnableSwapPartition.zip
    126.2 KB · Views: 2,895
  • x8EnableSwapPartition2.zip
    126.2 KB · Views: 1,436
Last edited:

lrakkarl

Senior Member
Dec 13, 2011
105
527
More Information: (You don't really need to read this but if you are interested...)

Stock Kernel?? Oh man...
I personally think it is worth it for all users to flash back to stock kernel & dual mode recovery. Why? Just so they can partition their sd-card like this, as sd-ext will be formatted in Ext4.
Ext4=Best speed/reliability overall. Why would you still be using ext2/3???

Why only 128mb swap size?
Because it is wasteful to create a larger swap partition. It never gets used. I have never seen 128mb's of swap used on our phone & that is even with heavy games/apps running in the background. You are just making your sd-card size smaller for no benefit.

Why not just use Swapper2 from the market with a swap(.swp) file?
Swapper2 is notorious for slowing down your phone as it likes to auto-start all the time also a swap file will not be as fast as a swap partition.

Will SWAP shorten SD-card lifespan???
Yes it undoubtedly will. Will you be able to notice this in any way? Most probably not.
Using swap will cause intensive reading/writing in one region of the sd-card. All flash memory devices (including our NAND internal memory) have limited write cycles. Excessive reading/writing causes bad blocks on your sd-card. Some sd-cards have extremely poor write cycles, so they can & will burn out when using swap.
Some people believe it would take a full year or even longer of using swap to actually cause any noticeable effect on your sd-card. Even if it does cause bad blocks on you sd-card, when formatting your sd-card with most modern-day file systems, these blocks will be marked as bad blocks and they wont be used. This equals to an extremely slow decrease in total capacity of your sd-card (which will be close to unnoticeable) .
Having said all of that there has been reported cases where SD-Cards have burned out and stopped working almost directly after enabling swap. Coincidence? Who knows but...What you do & flash to your phone is your own decision & no one else is in any way responsible for what happens except you.
 
Last edited:

lrakkarl

Senior Member
Dec 13, 2011
105
527
Last edited:

aries77

Senior Member
Feb 6, 2007
324
32
I use alf kernel + Gdx 21
I already partition my sd card using mini tool partition wizard as follow
1. primary Fat32
2. primary Ext4
3. primary LinuxSwap

already flash the addon , but still no swap active when i check on terminal.
i see on your zip that it make swap on /dev/block/mmcblk0p3
but in mine there's only /dev/block/vold -> which is empty also
I don't know if my swap partition is load .

still there's /sys/dev/blok/179:3 which refer to mmcblk0p3
and on sys/block/mmcblk0
I'm not familiar with linux , so please give me a guide what to do.

thanks
 

kakho55

Senior Member
I use alf kernel + Gdx 21
I already partition my sd card using mini tool partition wizard as follow
1. primary Fat32
2. primary Ext4
3. primary LinuxSwap

already flash the addon , but still no swap active when i check on terminal.
i see on your zip that it make swap on /dev/block/mmcblk0p3
but in mine there's only /dev/block/vold -> which is empty also
I don't know if my swap partition is load .

still there's /sys/dev/blok/179:3 which refer to mmcblk0p3
and on sys/block/mmcblk0
I'm not familiar with linux , so please give me a guide what to do.

thanks

How to u check if swap is running or not?? Type wat code on terminal..

Sent from my E15i using xda premium
 

kakho55

Senior Member
export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$free
total used free shared buffers
Mem: 186704 183584 3120 0 132
-/+ buffers: 183452 3252
Swap: 33596 25304 8292
$

So it work or not? ?

Sent from my E15i using xda premium
 

8xfan

Senior Member
Oct 24, 2011
322
48
Kulim
export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$free
total used free shared buffers
Mem: 186704 183584 3120 0 132
-/+ buffers: 183452 3252
Swap: 33596 25304 8292
$

So it work or not? ?

Sent from my E15i using xda premium

Swap: 33596 25304 8292
yes it work..
 

lrakkarl

Senior Member
Dec 13, 2011
105
527
I have updated both post #1 & #2 with the information requested. Please give it a read.

@kakho55
Swap allows you to run more apps/processes at any one time. The android operating system will still use all of your real ram too.
 
  • Like
Reactions: kakho55 and 8xfan

gdeliana

Senior Member
Feb 21, 2011
392
105
Tirana
What about the swapping coefficient, in the script is not defined. This number is showed in procent and defines the ratio of swap partition being used by the system.
 

lrakkarl

Senior Member
Dec 13, 2011
105
527
What about the swapping coefficient, in the script is not defined. This number is showed in procent and defines the ratio of swap partition being used by the system.
Uploaded new add-on & modified first post to answer your question.:)
(if no value specified then Android default setting is 60%)

One question,i using Reset Swap and everytime i reboot i need to go to app and activate swap again,thats normal?And if i flash the EnableSwap.zip?
Yes that is normal if using ResetSwap. This is because it never auto-starts by itself.
If you flash the add-on zip then swap will be auto enabled every boot.
 
  • Like
Reactions: khaidir84

Top Liked Posts

  • There are no posts matching your filters.
  • 46
    Ok. I do not mean any offence to junghyun01.
    However this is another method & the one that I personally use.

    This requires: stock kernel & dual mode recovery (ClockWorkMod).
    Some version of ClockWorkMod that come with custom kernels do not include the necessary options to format your sd-card.
    To return to stock kernel on gingerbread or froyo, follow this guide:
    http://xdaforums.com/showpost.php?p=21238366&postcount=2


    This is the easiest way to create sd-ext/2nd partition+swap partition on sdcard with our phones:
    1: Backup all data from sdcard to computer *Important*.
    2: Boot into ClockWorkMod by tapping touch-screen while on Sony Ericsson screen
    WARNING: We will now delete all data on sdcard, that is why you made a backup.
    3: Advanced => Partition SD Card => 512M or 1024M (depending how many apps you want to install & the size of your sdcard) => 0mb for swap size (or if using a custom kernel you can set a swap size of 128m) => Yes to format.
    4:Power Off phone.
    5:Remove sdcard and put into computer, put the files that you backed up to the computer back on the sdcard.
    6:Insert sdcard back into phone and power on. Click thanks.:D


    How to enable swap? Warning: This can & will shorten your sd-cards life. Read post #2!
    (Swap will only work on a custom kernel!)
    After flashing the rom of your choice, flash the add-on "x8EnableSwapPartition2.zip" in ClockWorkMod to enable swap or download ResetSwap from the market.

    Credits:
    junghyun01 go on give him a thanks for giving me the motivation to create this thread.
    lrakkarl@xda(me): Flashable add-on zip, guide, time, information. Click thanks!

    x8EnableSwapPartition2.zip=Swappiness set at 40%.
    x8EnableSwapPartition.zip=Swappiness set at Android default 60% or whatever % your rom developer has set it at.
    15
    More Information: (You don't really need to read this but if you are interested...)

    Stock Kernel?? Oh man...
    I personally think it is worth it for all users to flash back to stock kernel & dual mode recovery. Why? Just so they can partition their sd-card like this, as sd-ext will be formatted in Ext4.
    Ext4=Best speed/reliability overall. Why would you still be using ext2/3???

    Why only 128mb swap size?
    Because it is wasteful to create a larger swap partition. It never gets used. I have never seen 128mb's of swap used on our phone & that is even with heavy games/apps running in the background. You are just making your sd-card size smaller for no benefit.

    Why not just use Swapper2 from the market with a swap(.swp) file?
    Swapper2 is notorious for slowing down your phone as it likes to auto-start all the time also a swap file will not be as fast as a swap partition.

    Will SWAP shorten SD-card lifespan???
    Yes it undoubtedly will. Will you be able to notice this in any way? Most probably not.
    Using swap will cause intensive reading/writing in one region of the sd-card. All flash memory devices (including our NAND internal memory) have limited write cycles. Excessive reading/writing causes bad blocks on your sd-card. Some sd-cards have extremely poor write cycles, so they can & will burn out when using swap.
    Some people believe it would take a full year or even longer of using swap to actually cause any noticeable effect on your sd-card. Even if it does cause bad blocks on you sd-card, when formatting your sd-card with most modern-day file systems, these blocks will be marked as bad blocks and they wont be used. This equals to an extremely slow decrease in total capacity of your sd-card (which will be close to unnoticeable) .
    Having said all of that there has been reported cases where SD-Cards have burned out and stopped working almost directly after enabling swap. Coincidence? Who knows but...What you do & flash to your phone is your own decision & no one else is in any way responsible for what happens except you.
    3
    And another method if you need it:
    http://xdaforums.com/showthread.php?t=1445543

    Or guide with pictures:
    You can create an ext partition on your sdcard in windows by downloading the newest Easeus Partition Manager Here or at their Homepage.
    After installing the program use the guide found here:
    http://xdaforums.com/showthread.php?p=10654666
    I have tried this method and it works with Ext2 and Ext3.
    2
    I use alf kernel + Gdx 21
    I already partition my sd card using mini tool partition wizard as follow
    1. primary Fat32
    2. primary Ext4
    3. primary LinuxSwap

    already flash the addon , but still no swap active when i check on terminal.
    i see on your zip that it make swap on /dev/block/mmcblk0p3
    but in mine there's only /dev/block/vold -> which is empty also
    I don't know if my swap partition is load .

    still there's /sys/dev/blok/179:3 which refer to mmcblk0p3
    and on sys/block/mmcblk0
    I'm not familiar with linux , so please give me a guide what to do.

    thanks
    2
    I have updated both post #1 & #2 with the information requested. Please give it a read.

    @kakho55
    Swap allows you to run more apps/processes at any one time. The android operating system will still use all of your real ram too.