• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root SD card mod SWAP partion

Incakola

Android Enthusiast
Hey guys, not really the creator of this concept but I thought it might help us with our limited 865mb of ram. It has gave me a slight improvement (60mb more free) because I mostly use up all the ram until apps start closing down during the time of use so it may not help you if your never at peak ram use. Here's the deal:
RAM
What is RAM
Random Access Memory (RAM) is temporary data storage that the CPU uses during calculations. The more RAM a device has, the more calculated results the CPU can store - which means less time the CPU has to do the same thing over and over again. In other words, the CPU can check RAM to see if it has already made a particular calculation in the recent past. If it has, it can use the pre-computed results instead of wasting processing time recomputing the same calculation. In short, more RAM means a more efficient (and faster) device.
SWAP
What is SWAP
Swap is, in short, virtual RAM. With swap, a small portion of the hard drive is set aside and used like RAM. The computer will attempt to keep as much information as possible in RAM until the RAM is full. At that point, the computer will begin moving inactive blocks of memory (called pages) to the hard disk, freeing up RAM for active processes. If one of the pages on the hard disk needs to be accessed again, it will be moved back into RAM, and a different inactive page in RAM will be moved onto the hard disk ('swapped'). The trade off is disks and SD cards are considerably slower than physical RAM, so when something needs to be swapped, there is a noticeable performance hit.
Unlike traditional swap, Android's Memory Manager kills inactive processes to free up memory. Android signals to the process, then the process will usually write out a small bit of specific information about its state (for example, Google Maps may write out the map view coordinates; Browser might write the URL of the page being viewed) and then the process exits. When you next access that application, it is restarted: the application is loaded from storage, and retrieves the state information that it saved when it last closed. In some applications, this makes it seem as if the application never closed at all. This is not much different from traditional swap, except that Android apps are specially programmed to write out very specific information, making Android's Memory Manager more efficient that swap.

This mod is only useful if your setup takes up almost the entire RAM memory during the entire runtime of the device.


The only app that can accomplish this is: https://play.google.com/store/apps/details?id=com.sylkat.AParted&hl=en (it looks outdated but it works).

First before launching the app, unmount your SD card.

METHOD1 without link2sd functionality

During first launch it will install the necessary files to assist with it's function. After it's done it will restart and launch normally by first showing the dev's logo then it shows an ad and then your in after you gave SU permission.

Now you'll see 3 sections: create, tools, and configuration tabs (you'll be using tools tab the entire process).
-check part 1
-select "resize" in the dropdown menu
-select apply
-make freed space around 300mb
-select part 2 and select create
-select "swap" as format
-select part 2 again but select "swap" in drop dowm menu
-you don't need the extra app for this so just hit cancel when prompted then select swap on
-kill the app if you can't get out of that menu
-you're done
You may need to reapply the swap drop down step again after reboots

METHOD 2
same as method 1 but before making the swap, shrink the fat32 volume down 1gb at least for link2sd to store apps (you could shrink it down more if your putting a lot of apps like games). Then create a partition in part 2 with filesystem of ext4 and then you could add the swap space after if you like. (To be able to link data in link2sd you'll need the doner version to accomplish this, there is possibly another app that has this feature for free).

I thought this could also be accomplished by using windows diskpart console but I realized swap file systems is a linux thing...
 
Last edited:
Very cool! I would use this myself but I'm not a heavy user and I've already messed things up today from having corrupted files on my SD card that was using Link2SD which led to a very unstable OS.

For heavy users this should be very helpful, thanks for sharing!
 
Very cool! I would use this myself but I'm not a heavy user and I've already messed things up today from having corrupted files on my SD card that was using Link2SD which led to a very unstable OS.

For heavy users this should be very helpful, thanks for sharing!
Hmm you made a second partition on your SD? Usually the way I revert the link2sd setup is by formating via android settings then either on windows or a-part app, I delete the formatted partition then reboot and reformat again.
 
Hmm you made a second partition on your SD? Usually the way I revert the link2sd setup is by formating via android settings then either on windows or a-part app, I delete the formatted partition then reboot and reformat again.

Yeah I had the second partition setup and everything was working great. Then I decided to try FolderMount too and somehow that caused some major problems. Even when I did a factory reset things were still messed up until I realised it was a problem with the SD card. Took it out and made some backups then formatted the card and now everything is working fine again with Link2SD.
 
Do we have to mount the SD card again after starting the app in method 1?
Oh I forgot to mention that the SD card has to be unmounted the entire process. After you've created a swap partition (no bigger than 300mb, after using this mod I never saw it surpass above 300) and your done using the app you can mount the SD. I used amemboost to quickly enable swap after each reboot because aparted took so long to access (you can uninstall aparted once your done partitioning).
 
Back
Top Bottom