5,599,337 Members 38,122 Now Online
XDA Developers Android and Mobile Development Forum

Assistance with making a swap partition

Tip us?
 
TheReduxPL
Old
#1  
Senior Member - OP
Thanks Meter 13
Posts: 145
Join Date: Apr 2012
Default Assistance with making a swap partition

Hi!
Since my phone's memory amount doesn't seem to be enough even for browsing, I've decided to create a swap partition. But I need your assistance since I got many questions.
- Do I have to format the whole SD card and then split it to two partitions? Isn't that possible to just change the size of the existing partition and make a new one from free space acquired because of that?
- Is my SD card good for that? It's AData 32GB MicroSDHC Class 10.
- What's the risk of potential data loss because of swap being enabled?
- Will that break the apps that are moved to SD card?
and last:
- Which method will work with the newest build of CM 10.1 by NeverGone/RU?
Will really appreciate any assistance!

Wysłane z mojego HTC Vision przy użyciu Tapatalka
My English baaaaaad! Sorry!
 
bradley_e_smith
Old
#2  
bradley_e_smith's Avatar
Senior Member
Thanks Meter 65
Posts: 466
Join Date: Oct 2009
Location: Florida
While I don't think swap is needed (I have run both ways), when I did use swap (ICS,JB,KITKAT) I put the swap on the /cache mount point. I figured that putting swap on the sdcard might be slower and wear out the sdcard faster. Plus it appears that on 4.0+ Android the /cache file system is not used as much anymore.

So having said this, I would copy the file below to the /system/etc/init.d directory (making sure the permissions are correct).

-brad

===filename: 90cachswap
#!/system/bin/sh
# Enables swap on data partition

#
#
# file is /cache/swap

# POI: this can be used along with sdcard swap partition
# the load will be automatically evenly divided between the two locations
mv /cache/swap /cache/swap.old
busybox dd if=/dev/zero of=/cache/swap bs=1M count=128
chmod 0600 /cache/swap
mkswap /cache/swap
busybox swapon /cache/swap
rm /cache/swap.old
=======
Bradley Smith - T-mobile G2

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes