Quantcast
Channel: xda-developers - Galaxy S Plus I9001 Android Development
Viewing all articles
Browse latest Browse all 315

[MOD][init.d] Swap Partition[TUTORIAL]

$
0
0
Backup your sdcard
This mod needs an kernel with swap support
This tutorial implies that you have already partitioned your sdcard


Q: Why use a swap-partition instead of a swap-file?
A: You are able to mount your first partition on computer, with swapfile you are not.

mmcblk1 = external_sdcard if you use mmcblk0 you will hardbrick your phone. Some apps like swapper 2 use mmcblk0pX as default value, if you want to use these apps make sure to change this in settings.

1. Find your swappartition
fdisk -l /dev/block/mmcblk1
Output:
Code:

              Device Boot Start    End        Blocks  Id    System
/dev/block/mmcblk1p1          1    3849      30916015+    c    Win95 Fat32 (LBA)
/dev/block/mmcblk1p2      3849    3880        250084  82    Linux swap

2. Activate Swap (Linux swap)
swapon /dev/block/mmcblk1p2
3.Optional change swappiness
echo 10 > /proc/sys/vm/swappiness //default value is 60
4. Test if all works
free //There should be some numbers behind swap
cat /proc/sys/vm/swappiness //current swappiness value
5. init.d script
Code:

#!/system/bin/sh
swapon /dev/block/mmcblk1p2
echo 10 > /proc/sys/vm/swappiness


Attached Files
File Type: txt 07swap.txt - [Click for QR Code] (78 Bytes)

Viewing all articles
Browse latest Browse all 315

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>