yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Spiricore:
I just upgraded to the latest KT (as of posting) and was having trouble with Turbo ZRAM so I'm deciding to give this a shot. Have you considered creating an AROMA installer for it for those flashing to make things a little more user friendly and customizable without use of the terminal?
[Android Software/Hacking General [Developers Only]] defiant07:
I have considered aroma, but decided against it as it would limit the compatibility to those able to use aroma (my previous device was incompatible).

However, now that I have a compatible device I would be able to test it and offer it as a third option, which as you said would make things more user friendly. IF (<<<and this is a big if) I feel like messing with it and have the time, I may implement this...it would be a new challenge :D.
[Android Software/Hacking General [Developers Only]] SuganAnbalagan:
I've changed the swapon -p 32000 /data/swapfile in the init.d script to swapon /data/swapfile, was I right in activating the script? Priority being 32000 is very high isn't, so why keep it like that? And why that boot log always empty?
[Android Software/Hacking General [Developers Only]] josuemf:
running this script on my Xperia SP, setting the swap file on the /Cache doesn't seem to work

or how do you check when the script is working properly?

I'm used to the FREE command to see if the swap is active or not, but it just returns 0 swap.
[Android Software/Hacking General [Developers Only]] eushaun99:
Check BootLog_SwapOn.log and Ran_SwapOn.log to see if there's any errors.
[Android Software/Hacking General [Developers Only]] defiant07:
Sorry for the super delayed replay...have been busy and lazy :silly:, which is needless to say a bad combination.

At any rate, it does not matter if you changed that line - things will function fine, especially if you're only using one swapfile.

If you're using more than one swapfile it may impact how the swapfiles are used. In my tests I found priorities are relative; meaning there was no difference between using 32000/16000/0 and 2/1/0 for the priorities - there was no difference in how the usage was divided amongst the files (the highest priority got about 50% and the other two about 25% each). But, when using multiple swapfiles without priorities usage was more evenly divided; this is probably what you have done if making similar edits for multiple swapfiles.

Regarding the boot log: An empty boot log is a good thing; it means there were no errors.

Again...Sorry for the super delayed replay...have been busy and lazy :silly:, which is needless to say a bad combination.

/cache may not work well on all devices (it is a temp directory located in ram on some devices). Does it work if you use different locations? Are there any errors in /data/BootLog_SwapItOn.log?

The best way to check in this case would be [cat /proc/swaps] being that it will show the swapfile location(s).
[Android Software/Hacking General [Developers Only]] defiant07:
Thanks for trying to pick up my slack in my time of negligence ;).

========

To all other lost souls who stumble upon and read this thread...peep my new script, TrimDropOff.
[Android Software/Hacking General [Developers Only]] nerdyblonde:
Wow..This is awesome [MENTION=5146220]defiant07[/MENTION]... Worked like a charm on my E980 running Beanstalk 4.4 (running a custom kernel). Many thanks!!
[Android Software/Hacking General [Developers Only]] defiant07:
You're most welcome, glad you found it useful. Thanks for the feedback :).
[Android Software/Hacking General [Developers Only]] matcho13579:
[MENTION=5146220]defiant07[/MENTION] If I write 'free' command, it should show me some numbers right?
[Android Software/Hacking General [Developers Only]] defiant07:
Correct, the bottom row (labeled "swap") should have at least one non-zero value if it is functioning properly :).
[Android Software/Hacking General [Developers Only]] ivcha90:
I install this via smanager, follow tutorial but one thing iss weard, in terminal when i write free, in swap total, used and free i get 0, is that ok or something is wrong?
[Android Software/Hacking General [Developers Only]] juancollado2003:
for me "swapon -p" give an error so I'd to change it by "swapon -a" and I'd to use v12 because v13 says there's a syntax error, something about some quots, thx
[Android Software/Hacking General [Developers Only]] ivcha90:
How to change, just to write in terminal "swapon -a"?

I get error "swapon: invalid option --p "
[Android Software/Hacking General [Developers Only]] juancollado2003:
open the script you downloaded from here with a text editor, replace "swapon -p" by "swapon -a"
[Android Software/Hacking General [Developers Only]] defiant07:
The issue both of you are having is the swapon applet in your busybox does not support the priority flag (-p N)...I am quite certain there are no syntax errors.

The solution, if you want prioritized swapfiles, is to change busybox versions. If you don't care about prioritization/are using only one swapfile making the edit suggested by [MENTION=3737127]juancollado2003[/MENTION] would also work.
[Android Software/Hacking General [Developers Only]] smeejaytee:
Hi I'm using your mod and it works well but I wondered if your using a rom which has nightly builds and you have to flash a new rom quite regular will the swap files and settings stick or do you have to install again of this is the case is there a simple way to go about it thanks for your time and effort
[Android Software/Hacking General [Developers Only]] lkirra:
hi guys, i just want to ask how to know if the swapping is working/running?
[Android Software/Hacking General [Developers Only]] smeejaytee:
In terminal just type free
[Android Software/Hacking General [Developers Only]] smeejaytee:
I truly hope this mod hasn't been discontinued as I only just found it and since turboboost is no more this is a great alternative if anything this is better hippie your still continuing development this is great work than you

sent from my blower
[Android Software/Hacking General [Developers Only]] Mrinal Roy:
How to know its working or not? i tried typing "free" in tetminal Emulator and the swap value is zero.
[Android Software/Hacking General [Developers Only]] smeejaytee:
Then it's not working I'm afraid you'll have to try again it took me a few tries before it worked for me

sent from my blower
[Android Software/Hacking General [Developers Only]] iXanza:
Hey I tried using this with /data and it worked however I would like to use my internal SDCard which has 16gb and 13gb free. I tried

/storage/sdcard0

/sdcard

/mnt/sdcard0

but it all tells me "oops you do not have enough space" I'm trying to create a 512mb swap and I have 13gb free.
[Android Software/Hacking General [Developers Only]] VitorMSA:
Great script. Works very well on Xperia T with 4.3 and on internal storage (/storage/sdcard0)

Enviado do meu LT30p através de Tapatalk
[Android Software/Hacking General [Developers Only]] iZLeeP:
Something new to try, didn't know up till now that my device support swap after looking at the output of "cat /proc/cpuinfo". Thanks dev!
[Android Software/Hacking General [Developers Only]] jam90:
doesn't work on kitkat 4.4.4 (paranoid android)
[Android Software/Hacking General [Developers Only]] jam90:
It gives me those two errors, cm 11, android 4.4.4
[Android Software/Hacking General [Developers Only]] famewolf:
I'm attempting to install the swapfile on a Kyocera Hydro (ICS) phone. The boot log shows:

shell@android:/data # more BootLog_SwapOn.log

swapon: invalid option -- p

BusyBox v1.22.1-Stericson (2014-01-25 17:27:18 CET) multi-call binary.

Usage: swapon [-a] [DEVICE]

Start swapping on DEVICE

-a Start swapping on all swap devices

shell@android:/data #

I understand from my linux box that -p is supposed to set priority of the swap....so which version of busybox are you running that DOES support -p? ICS (Ice Cream Sandwich) also doesn't have an /etc/fstab so is this script now jellybean/kitkat only?
[Android Software/Hacking General [Developers Only]] CrimsonCrap:
same for me too.I've had a different error before and now after updating busybox through stericson installer i've got a different error.But both result in the free command giving swap as zero.Can anyone anyone tell me which version of busybox they are using?I'm on a Sony Xperia SP (C5303).

Help would be appreciated.

Thanks.

UPDATE:After trying different version of busybox, now I'm getting a new error

ERROR: (etc/fstab: no such directory)

I

I have honestly lost hope.It worked so easily on my previous phone.

I am on Xperia SP with JB 4.3.

Help would be appreciated.
[Android Software/Hacking General [Developers Only]] veerusayz:
It created swap successfully...then Im getting segmentation fault (core dumped)..kindly help

thanks for ur help in advance

---------- Post added at 09:56 AM ---------- Previous post was at 09:53 AM ----------

getting this error

/sqlite_stmt_journals/....

no such file or directory
[Android Software/Hacking General [Developers Only]] veerusayz:
any update? plsss
[Android Software/Hacking General [Developers Only]] AgentSmith:
It worked flawlessly on my Galaxy Nexus with recent cm11 nightly and fancy kernel. It advised a 374 MB swap file which I followed through. After a day use the free command now reports about 65 MB being used.

I set swappiness to 50 (seemed nicely in the middle ;)) and I haven't enabled the minfree option.

So far apps seem to reload less than before. I'm guessing less used processes are in swap now leaving more space for the regular apps.

I have yet to dig through this topic to find hints to optimal settings but of course I wouldn't mind if someone could provide a synopsis. ;)
[Android Software/Hacking General [Developers Only]] physcodelic:
Thanks for the script, tho the script failed because of "swapon -p" I guess.

Edited the script, and remove all -p priority option, work for me Evercoss A7T+ JB 4.2 and A7E KK 4.4.2 tho I dont know if this kind of swap intefere with ZRAM or not (tried with latest busybox).
[Android Software/Hacking General [Developers Only]] omike123:
Is it necessary to create all three partition ( primary, secondary, and tertiary ) respectively?
[Android Software/Hacking General [Developers Only]] chief:
WHY i can't make partition on Micro SD Card? It says i have not enough space (so path is good because then i tried with extSdCard and no path like that and script reaches the end) o.o that's weird because i have 60gigs free

i typed this location: /storage/external_SD/swp and wanted 256mb
[Android Software/Hacking General [Developers Only]] popthosegaskets:
The script still works with primary partition only. The secondary and tertiary partitions are optional.

Did you check the path for external SD?
[Android Software/Hacking General [Developers Only]] chief:
of course, when I tried paths from different devices it said the path is not correct.
[Android Software/Hacking General [Developers Only]] SPHM900:
/storage/external_SD worked just fine for me
[Android Software/Hacking General [Developers Only]] Anupam_Dey:
-- cat not found

[MENTION=5146220]defiant07[/MENTION]

Whenever I try to run the command --cat /proc/sys/vm/swappiness in terminal emulator it says "--cat not found".
[Android Software/Hacking General [Developers Only]] eushaun99:
Its cat not --cat.
[Android Software/Hacking General [Developers Only]] Anupam_Dey:
Thanks !! :)

I didn't realise that "--" was to separate the command from ordinary text:p
[Android Software/Hacking General [Developers Only]] exodius48:
[MENTION=5146220]defiant07[/MENTION] I already have swap partition in my memory card, do i need repartition/remove it before use this script?
[Android Software/Hacking General [Developers Only]] AlphaUMi:
I have a problem with the script. My prerequisites are:

- Huawei Ascend Y300 with stock Android 4.1.1 Jellybean

- Root access

- Busybox 1.22.1

- Init.d support

When the script performs its checks it stats everything is OK (and additionally in Terminal when I type "cat /proc/cpuinfo" under features I read "swp"), and the installation competes successfully. I choose "no" when asked to set minfree values since I have SuperCharger too.

This is the log after a reboot:

swapon: invalid option -- p
BusyBox v1.22.1-Stericson (2014-01-25 17:27:18 CET) multi-call binary.

Usage: swapon [-a] [DEVICE]

Start swapping on DEVICE

-a	Start swapping on all swap devices

/system/etc/init.d/Z99SwapOn[82]: cat: /proc/swaps: No such file or directory

Problem is, I don't have a swap directory in /proc and I am unable to write to that folder and create one. I set permissions with my File Manager, and it seems ok, but cannot write to that folder. I tried to use chmod and mkdir with terminal, but I receive an error stating "no such file or directory".

Please, what can I do to make this script to work?
[Android Software/Hacking General [Developers Only]] Zeuszoos:
Defiant07,

Okay, I am trying to figure all of this out.

Goal: Swap File on External SD Card

Device: Samsung Galaxy (SGH-M819N) Mega 6.3"

KitKat 4.4.4, Rooted, PhilZ/CWM Rec 6.59.0/6.0.5.1

I am also using "Universal Init.d

My phone currently uses a Swap of 1 GB at /dev/block/vnswap0

I would like to get rid of that and use just one single swap located at:

/storage/extSdCard (that's how the path shows, exactly)

I can use either a script, or a flashable, but I am not an expert and I am getting confused. For example, you talk about "configuring it". But I've never seen a script install, nor flashed a Zip and had it ask me about options settings.

I'm obviously missing something simple here. Could you please take pity on the stupid here and help me out a bit more to accomplish this goal? I have literally spent the last week on this and no matter what I have tried, I still get the same result (above) when I type "free" in terminal. Same size and location for swap. My device does support swap, obviously.

I really want to get this done, as my External SD is way faster than my Internal Storage and if swapping wears out my storage faster, it's a lot easier to replace an SD Card, than to replace your phone (especially when you can't afford a new phone)!

I appreciate your time! I'll do whatever you tell me and write things down for future reference. I can understand, once I'm given a bit of "talk to me like I'm 6" help one time. <lol>

Just FYI, I've even tried a bunch of different apps (Swapper2, et al), but it still reports it as 1 GB, in /dev/block/vnswap0

Thank You!

---------- Post added at 04:14 PM ---------- Previous post was at 03:26 PM ----------

Defiant07,

P.S.: When I run the script and it asks me to choose a location, it doesn't even mention my External SD Card. I do have one (I ran the script from it in the script manager you recommended).

It only offers: [D]ata, [C]ache, ystem & [K]ustom

My Ext SD is locate at:

/storage/extSdCard

Thanks!
[Android Software/Hacking General [Developers Only]] Zeuszoos:
Defiant07,

Update: I said what the heck and tried "Custom".

The script ran fine. It created the swap file on:

/storage/extSdCard

I did reboot into Recovery, wiped Dalvik Cache & Cache.

Rebooted and opened Terminal, but when I typed "free", it shows the "Swap" as Zeroes all the way across (Free, Total, etc.).

Maybe it's reporting on the old, default swap?

I don't know what command to use to check if it's using the swap that the script created on my External SD Card.

Or does it mean that it's just not working?

I did tell the script to use a delay, just in case.

Thanks!
[Android Software/Hacking General [Developers Only]] adhawk:
Delete the init.d script Z99swapon

I ran the swapiton v13 script completely with suggested script manager to where if you are patient enough you can see a print of a cannabis weed plant in the end xD However, the script still didn't enable swap because my rom's busybox 1.21.1-jb doesn't have the priority -p option for the swapon command input arguments i.e swapon [-a] [device] only. But that has been solved by running the swapiton shift script using stericson's busybox. And yes i have 2 busybox within my rom, the one preinstalled by my rom is located in /sbin, while the stericson busybox is in installed in /system/xbin. i don't know if its ok or not to have many version of busybox installed in a rom but i just can't install the stericson busybox in /sbin because once the phone is rebooted the files in /sbin automatically turns back to jb busybox. Its a kernel thing maybe idk. That also means the rom will be unable to run the script z99swapon in init.d folder during boot although this rom has init.d support just because of the preinstalled busybox running in boot lacks the -p option for the swapon command.

So now here's my question, can i delete the z99swapon script in the init.d folder? does running the shift scripts (e.g swapiton, swapitoff, swapxxx, tweakstb) in /system/xbin requires the existence of the z99swapon script? I really don't mind if the script can't be run during boot to maintain the swap configs, i can just run the shift scripts manually.
[Android Software/Hacking General [Developers Only]] eclyptos:
My only problem is to run Swap at boot, any idea how to do that on Xperia Z1? I have swap partition on sd and manually I can run that easy but not on boot. :confused:
[Android Software/Hacking General [Developers Only]] kingwaqar:
GT-i8262

I have done all steps greatly in GT-I8262 but i am having an error when i try to open swapiton and check free or cat /proc/........ both not working please tell me but i saw the file is there

my cpu supports swp

---------- Post added at 10:41 PM ---------- Previous post was at 10:34 PM ----------

same problem
[Android Software/Hacking General [Developers Only]] yashg1:
Hey, first of all thankyou so much for the Tweak.

I am using a custom ROM on grand prime. I've installed this tweak and works well but whenever I reboot the swap goes and I've to do the whole process again!

Is there anyway to get rid out of this?
[Android Software/Hacking General [Developers Only]] puturaya20:
working for 4.4.4 ?
[Android Software/Hacking General [Developers Only]] josuesim1:
/system/xbin/swapit[565]: 1707

6320

6320

6320

6320

6320

6320 - 20: unexpected '6320'

You knwo the deal. Keep your panties on

and wait . . .patience is a virtue

what i have to do
[Android Software/Hacking General [Developers Only]] -Rye-:
AMAZING.

And very pretty (Eat that, Supercharger)

Finally a swap file tool that works on the G3s :D.

All the others threw invalid arguments at me.

Strangely Poweramp gets killed awfully lot since I used this. Maybe LMK

One question though, I know you dislije using a custom path,

but why does /storage/external_SD always error out at the very end with "no free space" when I have 4 gb free ?
[Android Software/Hacking General [Developers Only]] Devmountsu77:
Hello sir when I use this I get permission denied even though I have root
[Android Software/Hacking General [Developers Only]] Prakash2000:
Awesome

Thank you for this script. I used it on my gts7392 and boosted up my ram by 700 mb. The swap will not work like the real ram but it will definitely increase performance. Very cool! Better than that roehsoft ram expander app because of four reasons - it is paid on playstore (although smart people know how to get it for free), the max limit of swap file is 4 gb , you have to enable swap every time you boot up and the app takes up extra space in ram. I am using script with script manager. Thanks a lot! :good:
[Android Software/Hacking General [Developers Only]] lilcrazynt1989:
Input your desired size in mb as an integer

for the primary swap file: 32

FIX ME! implement getmntent() bionic/libc/bionic/stubs.c:354 Oops...you do not have enough space...

...try again...bye :p.

Help me
[Android Software/Hacking General [Developers Only]] lilcrazynt1989:
Help me galaxy light t399 4.4.2
[Android Software/Hacking General [Developers Only]] zeppelinrox:
Have you at least read along?

Plus you have posted zero concrete info/output.

This isn't ESP Developers.
[Android Software/Hacking General [Developers Only]] clnzx2:
I posted my issue and defiant 7 posted some questions /ideas of which I responded to and did not get an answer. Yes i have read the entire thread. I have attached a screenshot that shows exactly what I have already said. I also tried swapon /data/media/0/swapfile with the same results
[Android Software/Hacking General [Developers Only]] defiant07:
TY yet again...Zep and his famous one liners...you're like the Rodney Dangerfield of bash, lol :laugh:.

I go to sleep and you solve all my problems :p. I'm getting tired of saying it, but...thanks, your efforts are most appreciated.

nice glad to hear it...I will edit and attach a new test version to this post sometime today, which should fix this jb related issue and give the script full functionality...it seems jb migrates data to /data/media/0.

##### Uploaded TEST_2, Which Should Help With Some JB Related Swapon Errors :fingers-crossed: #####​

I'm fairly optimistic about this and hope it will be the next official update; so here's a rough draft of the change log:

​
[Android Software/Hacking General [Developers Only]] defiant07:
Sorry...went to sleep.

So swapon /data/media/0/swapfile worked? No errors? Swap is working?

If yes, then see my above reply to [MENTION=5113073]eushaun99[/MENTION].
[Android Software/Hacking General [Developers Only]] clnzx2:
Using a Samsung Galaxy Nexus (toro) running uxylon jb 4.2.2

I tried the commands posted to find storage location and got these results...
[Android Software/Hacking General [Developers Only]] clnzx2:
Swap does not work with that command either. The swap file is created but not enabled. And no worries on not responding injustice saying i had provided some info. Glad you responded and don't care how long it took lol. Thanks
[Android Software/Hacking General [Developers Only]] zeppelinrox:
You're welcome.

I like a challenge lol

Well if the sdcard search comes up empty, you don't have to use that /0 folder and just just /data instead but it's don't matter really.

So you can do something like:

storage=`busybox mount | awk '/vold/&&/sdcard/{print $3}' | awk 'NR==1'`
if [ ! "$storage" ]; then storage=/data; fi

Or you can go nuts and if there is an external sdcard found, give the user a choice to use the sdcard or /data (/data is faster than an ext sdcard BUT of course is a tad riskier)

So that would look like:

storage=`busybox mount | awk '/vold/&&/sdcard/{print $3}' | awk 'NR==1'`
if [ "$storage" ]; then
echo " Pick (e)xternal sd card or (d)ata partition? "
read location
case $location in
e|E);;
d|D)storage=/data;;
*)Learn how to type!;;
esac
else storage=/data
fi

/system or /data or /cache don't show up?

Also do su first, just in case.

Googling the function error indicates that the kernel doesn't support it so do:

su
cat /proc/cpuinfo

Just to be sure
[Android Software/Hacking General [Developers Only]] defiant07:
That output from the mount command looks straight funny style to me for the reasons noted by Zep.

If the vTEST_2, which I will post after I give it a test run, does not work for you (note: I doubt it will work since you seem to lack /data): look around on your device and there should be at least one other place where all the contents of /storage/emulated/legacy are mirrored. Give me the name(s) of the mirrored location(s) and if worse comes to worse I can make a custom version that should work with your rom (the script would only require marginal revisions).
[Android Software/Hacking General [Developers Only]] clnzx2:
My fake SD card is mirrored at

/mnt/sdcard/

/sdcard/

/data/media/0/

/storage/emulated/0/

/storage/emulated/legacy/

/storage/sdcard0/

Tried swapon at all those paths and get function not implemented