Before proceding, please consider learning from Garfield :
(Thanx to MuertoKo for this educational image)
I have spend numerous hours making this mod ... and writing this OP, so please have the decency to at least read it before asking questions.
REMEMBER
FIRST OF ALL, do a Nandroid backup, as well as a backup of your sd-card content !
You're doing this at your very own risk, I'm not to be held responsible if something goes wrong
There's another little warning I need to add to this, using part of your sd-card as swap space will cause that part of your card to undergo lots of read/writes, thus shortening the life of that part of the card...
I've been using hard swap for quite a long time now, no issues to report, but don't tell me I didn't warn you
Now that said, let's get going
In case somebody wants to check it out, here is the swap activation script I wrote (attached) as well as explanations on how to make it all work :
I. Hard swap v2.3 (using a swap partition on the SD card)
(This is the alternative I recommend, considering the SD card being worn to be cheaper than the internal Sensation memory to be worn)
Initially this was a script and a guide that explained how to format and use a swap partition, but I've gone further in the meantime, since this now is a flashable MOD that will, if you have a swap partition on your SD-card, format that partition and install a swap activation script in system startup for you.
Here is how to use this mod :
1) Have I mentiond to backup your system (Nandroid) and SD-card ?! Cause now would be a real good time to do so
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
2) Partition your SD-card (Minitool Partition Wizard, 4ext, CWM...) - for a step by step documentation have a look [url="http://forum.xda-developers.com/wiki/index.php?title=SD_card_partitioning"]here[/url].
You can create as many partitions as you like/can, as long as all are primary partitions. This MOD will look for the swap partiton and find it even if it's not the last, though it's common practice for swap to be the last partition.
Just please don't create more than one swap partition, I don't know how the script would react if there were more than one ! You've been warned !
3) Download "Hard-Swap-Yank555.lu_Flasher-v2.3.zip" and put it onto your SD-card
4) Boot into recovery
5) Flash "Hard-Swap-Yank555.lu_Flasher-v2.3.zip" from your SD-card (like a ROM or kernel)
6) Reboot and enjoy !!
To check if all went fine, start a terminal and type "free", you'll need to see something different than 0 in your swap line, look at the attached print-screen
![Wink ;)](./images/smilies/icon_e_wink.gif)
Enjoy and please let me know how it worked for you !
BTW, I've successfully tested this on Android Revolution HD 6.6.5 XE and Virtuous Inquisition 4.0.2.
If on the other hand you'd like to remove this hard swap mod, just download and flash the attached "Hard-Swap-Yank555.lu_Uninstall.zip" file.
PS: You can find the thread for hard swap for the htc HD2 [url="http://forum.xda-developers.com/showthread.php?t=1630083"]here[/url].
-----------------------------------------------------Previous-versions-----------------------------------------------------
I. Hard swap v1.1 (using a swap partition on the SD card)
(This is the alternative I recommend, considering the SD card being worn to be cheaper than the internal Sensation memory to be worn)
1) Partition your sd-card (Minitool Partition Wizard, 4ext, CWM...)
Backup your DATA first !! I won't be responsible for your lost data
I suggest to use a partition of 256Mb to start with. I tested with 1Gb partition, was way too big, so this is up to you !
(maybe 512Mb if you do lots of multitasking)
2) Boot your system with the partitionned sd-card
I suppose in this scenario that you only have a FAT and a swap partition on the sd-card (2 partitions in total)
This means "/dev/block/mmcblk1p2" is the second partition on your sd-card and is the swap partition you've created in step 1.
NB: If you have an sd-ext or even sd-ext2, your swap partition will be "/dev/block/mmcblk1p3" or "/dev/block/mmcblk1p4"
3) Install the init.rd script
Download "98swap-v1.1.zip", unzip it and put the "98swap" file onto the root of your SD card.
Open a terminal and type the following :
NB: Change "mkswap /dev/block/mmcblk1p2" accordingly to point to the swap partition you've created in step 1.
su -
mount -o remount,rw /system
cp /mnt/sdcard/98swap /system/etc/init.d
chmod 755 /system/etc/init.d/98swap
chown 0:2000 /system/etc/init.d/98swap
mkswap /dev/block/mmcblk1p2
mount -o remount,ro /system
exit
4) Reboot your Sensation, start a terminal again and type free, you'll need to see something different than 0 in your swap line, like this
![Wink ;)](./images/smilies/icon_e_wink.gif)
![Image](http://img.tapatalk.com/555dc368-1521-0767.jpg)
Swappiness will be set to 60 by the script, which is a rather conservative swap use, made sense to me since SD-swap is slower than zram, better not to use it too agressively. Feel free to experiment with the swappiness variable in the script
![Wink ;)](./images/smilies/icon_e_wink.gif)
I. Hard swap v1.0 (using a swap partition on the SD card)
(This is the alternative I recommend, considering the SD card being worn to be cheaper than the internal Sensation memory to be worn)
1) Partition your sd-card (Minitool Partition Wizard, 4ext, CWM...)
Backup your DATA first !! I won't be responsible for your lost data
I suggest to use a partition of 256Mb to start with. I tested with 1Gb partition, was way too big, so this is up to you !
(maybe 512Mb if you do lots of multitasking)
2) Boot your system with the partitionned sd-card
I suppose in this scenario that you only have a FAT and a swap partition on the sd-card (2 partitions in total)
This means "/dev/block/mmcblk1p2" is the second partition on your sd-card and is the swap partition you've created in step 1.
NB: If you have an sd-ext or even sd-ext2, you need to change the "swap_partition" variable in the beginning of the script accordingly to "/dev/block/mmcblk1p3" or "/dev/block/mmcblk1p4", pointing to wherever your swap partition is !
3) If necessary customize the 98swap script (attached to this post) and then put it onto your sd-card's root folder, you'll need it while executing the commands in step 4.
4) Install the init.rd script
Download "98swap-v1.0.zip", unzip it and put the "98swap" file onto the root of your SD card.
Open a terminal and type the following :
NB: Change "mkswap /dev/block/mmcblk1p2" accordingly to point to the swap partition you've created in step 1.
su -
mount -o remount,rw /system
cp /mnt/sdcard/98swap /system/etc/init.d
chmod 755 /system/etc/init.d/98swap
chown 0:2000 /system/etc/init.d/98swap
mkswap /dev/block/mmcblk1p2
mount -o remount,ro /system
exit
5) Reboot your Sensation, start a terminal again and type free, you'll need to see something different than 0 in your swap line, like this
![Wink ;)](./images/smilies/icon_e_wink.gif)
![Image](http://img.tapatalk.com/555dc368-1521-0767.jpg)
Swappiness will be set to 50 by the script, which is a rather conservative swap use, made sense to me since SD-swap is slower than zram, better not to use it too agressively. Feel free to experiment with the swappiness variable in the script
![Wink ;)](./images/smilies/icon_e_wink.gif)