[script] 98swapon by -FuFu-

Search This thread

-FuFu-

Senior Member
hmm, strange...
with what editor you have edit the swapon.conf? maybe with Windows editor?
if so, please open terminal and type in
Code:
dos2unix -u /sdcard/swapon.conf

i think i must include this to the script that there are no errors in case of using windows editor ;)


if that not fix your problem i dont know what to do at the moment, i have the script on 2 devices and booth works with it



///EDIT///
i edit the script and at the dos2unix line
http://droid-world.bplaced.net/load.php?file=download/scripts/98swaponV11or.zip

now i hope there is no problem by edit the swapon.conf with windows editor or notepad... but for me the best way to edit the file is rootexplorer ;) or notepad++
 
Last edited:
  • Like
Reactions: hearts king101

Erovia

Senior Member
Sep 16, 2012
818
262
@FuFu I think including dos2unix would be a good idea. Most people use windows and EOL char was always a mess things up between windows and unix-based system.

In case someone is interested, here is my concern about using internal storage for swapping:
(I wrote it in another topic.)

I'm not sure it is as good idea as it sounds first.
Memories based on flash technology are degrading when writing on it. (I know they are degrading anyway.)
Swapping means a lot of writing and reading and while you can easily buy a new SD-Card you cannot change your phone's internal memory.

Maybe my fears are baseless, but i don't wanna risk.
May someone with better knowledge correct me.
 

-FuFu-

Senior Member
yes, but the browser cache is also on internal memory and write much data if you use the browser... but no one realy knows how long it takes to degrading the life of internal memory...
and if died some sectors on internal memory not to complety memory will be die and cache is only use for OTA updates and downloads from play store, so for me there is no big problem

but that each must decide for themselves


and V11 is only ;) with dos2unix ;)
 

Ricfil

Senior Member
Dec 16, 2010
330
67
O´Porto
yes, but the browser cache is also on internal memory and write much data if you use the browser... but no one realy knows how long it takes to degrading the life of internal memory...

"Memory wear

Another limitation is that flash memory has a finite number of program-erase cycles (typically written as P/E cycles). Most commercially available flash products are guaranteed to withstand around 100,000 P/E cycles, before the wear begins to deteriorate the integrity of the storage."

Wikipedia


Granted it also depends on the way people use their devices but it is guaranteed Flash IC chips come to an end. And when they do, I also agree, if it happens, may it happen on a micro SD card chip rather than on a soldered one on our devices :D.

Also granted that 100,000 P/E cycles is ALOT of read/write info..and in the end, we may have bought a new device when the wear presents itself :good:
 
Last edited:

Ricfil

Senior Member
Dec 16, 2010
330
67
O´Porto
Can anyone please help on a doubt relating this script? I´ve been using the script fon a swap partition and it is working fine. I´m trying to disable swap using the swap off comand on terminal emulator, but when I use "swapoff -a it spits back the "/etc/fstab: no such file or directory" Any idea what else is required to turn swap on and off on a regualr basis?

Thanks for any idea:good:
 

Ricfil

Senior Member
Dec 16, 2010
330
67
O´Porto
to disable swap you must use
swapoff /dev/block/mmcblk0p3

cause we have no swap entry in fstab, also if use a swapfile you must use
swapoff /sdcard/swapfile (or where else is the file)

Thank you:good:. Works great. Now that your script has got swap on/off option through Terminal Emulator I think I´m gonna stick with it. I rather have the option to turn swap on only for games (where it does most of its magic as far as I can tell on my Milestone) :D. Since Kabaldan´s CM9 is getting pretty stable and fast on my Milestone, for me it is the best way to go.

Great work:good:

Thanks again.
 

_crAss_

Senior Member
Sep 19, 2009
336
52
I am a happy user of your script for a long time.
Would it be possible to add the option to choose the size when you have a swap partition on the SDCard?
E.g. I have a 512 MB swap partition and I would want to use only 64 MB on that partition.
Thank you in advance.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hi there,
    here now the official thread for my 98swapon script...

    Latest Version: V11
    Download: http://droid-world.bplaced.net/index.php?cat=Downloads&page=Scripte
    there you will always find the latest version

    Infos about the Script you can find here: http://droid-world.bplaced.net/index.php?cat=Milestone&page=Swap Aktivieren
    but its German ;)

    here a translation using google translate (so please excuse the bad english, but i think my english is not much better then google translate)
    Simply download the latest zip and copy to /sdcard/Open Recovery/updates and then run in the Open Recovery by apply update.

    Best done previously a Nandroid backup of your current system, which you can import in case of problems again.

    UPDATE
    As of Version 9, there is on the SD card, the file swapon.conf with which you can adjust the different variables of the script, so it's no longer necessary to directly edit the script.

    SWAPSIZE is the amount of swap in MB
    If you put SWAPINT to 1, the internal memory is used for swap.
    Swapdev determines which internal partition to use, possible / are cache and / data, all other partitions were too small to use it for swap.
    RESETSWAP at 1 and at every reboot the swapfile is created, what is nützlch when changing SWAPSIZE.
    SWAPIONLY set to 1 and it will only set the value for swappiness with boats, the rest are ignored.

    For the rest of the values ​​consulted with Google, I can not say at all what may.

    To edit the swapon.conf please use Notepad + + or it may cause problems.
    i only test the script on cm7 and there it works fine...
    if you have problems or find some issues, please let me know...

    please post your swapon.log from /cache if you have a problem, and also your swapon.conf from sdcard.



    changelog
    V11
    - add dos2unix to script, so that is now also possible to edit the swapon.conf with windows editor

    V10
    - add disable funktion to the script
    - script now work on cm7 and cm10
    3
    yes, but the browser cache is also on internal memory and write much data if you use the browser... but no one realy knows how long it takes to degrading the life of internal memory...
    and if died some sectors on internal memory not to complety memory will be die and cache is only use for OTA updates and downloads from play store, so for me there is no big problem

    but that each must decide for themselves


    and V11 is only ;) with dos2unix ;)
    3
    i think i found the right command ;)
    maybe you can test it and confirme?
    use
    Code:
    mount -t vfat /dev/block/mmcblk0p1 /sdcard
    here it works, i reboot now 10 times and on every boot it mounts sdcard

    if you confirm, i will update the script ;) so that all can be test it ^^

    now i just must test if it also works for cm7 :D
    1
    Works perfectly on CM10.
    1
    to disable swap you must use
    swapoff /dev/block/mmcblk0p3

    cause we have no swap entry in fstab, also if use a swapfile you must use
    swapoff /sdcard/swapfile (or where else is the file)