• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.
I just switched to cm7.if I use the mkswap /dev/block/mmcblk0p4 command,how do I activate it or set it as active?if cm7 supports swap usage...

Edit:nvm.I got it to work.
# mkswap /dev/block/mmcblk0p4(this was the proper partition with my setup)
Then,
# swapon /dev/block/mmcblk0p4

Now the "free" command returns swap having roughly 128mb available for use.:thumbup:
 
  • Like
Reactions: wyelkins
Upvote 0
It's cool, you just need to be familiar with getting access :)

ok, here's what you're going to do for your particular situation,
*this means for Slayer72, if you copy this and you're not Slayer72, and it messes things up for you, it's your own damn fault*

first, go into the koumamod menu and make sure internal /data is disabled.
next, reboot

ok, once booted, open a command prompt window where your adb tool is (not sure if your qtADB does this next step, probably does, but I don't know the tool)

run> adb remount
if qtADB does that, use whatever method it does for that
next, here's a list of adb shell commands, starting with launching the shell:
run> adb shell

run> mkdir /system/swap
run> mount /dev/stl13 /system/swap
run> rm -rf /system/swap/*
run> dd if=/dev/zero of=/system/swap/swapfile
run> mkswap /system/swap/swapfile

now, open a unix mode text editor (like notepad++)
copy and paste the following into it:
Code:
#!/system/bin/sh
mount /dev/stl13 /system/swap
swapon /system/swap/swapfile
echo 60 > /proc/sys/vm/swappiness
save the file as something like S90KoumaSwap
put it on your phone in /etc/init.d
the command line prompt would be:
adb push S90KoumaSwap /etc/init.d/S90KoumaSwap

then, in your adb shell:
run> chmod 777 /etc/init.d/S90KoumaSwap

and reboot one last time.
:thinking: :thinking: :thinking:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Admin>adb remount
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
remount failed: Operation not permitted

C:\Documents and Settings\Admin>run> adb remount
'run' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Admin>adb shell
$ mkdir /system/swap
mkdir /system/swap
link_image[2030]: failed to link mkdir
CANNOT LINK EXECUTABLE
$ mount /dev/stl13/system/swap
mount /dev/stl13/system/swap
link_image[2030]: failed to link mount
CANNOT LINK EXECUTABLE
$ rm -rf/system/swap/*
rm -rf/system/swap/*
link_image[2030]: failed to link rm
CANNOT LINK EXECUTABLE
$ dd if=/dev/zero of=/system/swap/swapfile
dd if=/dev/zero of=/system/swap/swapfile
link_image[2030]: failed to link dd
CANNOT LINK EXECUTABLE
$ mkswap /system/swap/swapfile
mkswap /system/swap/swapfile
link_image[2030]: failed to link mkswap
CANNOT LINK EXECUTABLE
$ exit
exit

C:\Documents and Settings\Admin>adb push S90KoumaSwap etc/init.d/S90KoumaSwap
cannot stat 'S90KoumaSwap': No such file or directory

C:\Documents and Settings\Admin>adb shell
$ chmod 777 /etc/init.d/S90KoumaSwap
chmod 777 /etc/init.d/S90KoumaSwap
link_image[2030]: failed to link chmod
CANNOT LINK EXECUTABLE
$ reboot
reboot
reboot: Operation not permitted
$ exit
exit

C:\Documents and Settings\Admin>reboot
'reboot' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Admin>adb reboot

C:\Documents and Settings\Admin:mad: :( :( :(
 
Upvote 0
:thinking: :thinking: :thinking:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Admin>adb remount
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
remount failed: Operation not permitted

C:\Documents and Settings\Admin>run> adb remount
'run' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Admin>adb shell
$ mkdir /system/swap
mkdir /system/swap
link_image[2030]: failed to link mkdir
CANNOT LINK EXECUTABLE
$ mount /dev/stl13/system/swap
mount /dev/stl13/system/swap
link_image[2030]: failed to link mount
CANNOT LINK EXECUTABLE
$ rm -rf/system/swap/*
rm -rf/system/swap/*
link_image[2030]: failed to link rm
CANNOT LINK EXECUTABLE
$ dd if=/dev/zero of=/system/swap/swapfile
dd if=/dev/zero of=/system/swap/swapfile
link_image[2030]: failed to link dd
CANNOT LINK EXECUTABLE
$ mkswap /system/swap/swapfile
mkswap /system/swap/swapfile
link_image[2030]: failed to link mkswap
CANNOT LINK EXECUTABLE
$ exit
exit

C:\Documents and Settings\Admin>adb push S90KoumaSwap etc/init.d/S90KoumaSwap
cannot stat 'S90KoumaSwap': No such file or directory

C:\Documents and Settings\Admin>adb shell
$ chmod 777 /etc/init.d/S90KoumaSwap
chmod 777 /etc/init.d/S90KoumaSwap
link_image[2030]: failed to link chmod
CANNOT LINK EXECUTABLE
$ reboot
reboot
reboot: Operation not permitted
$ exit
exit

C:\Documents and Settings\Admin>reboot
'reboot' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Admin>adb reboot

C:\Documents and Settings\Admin:mad: :( :( :(


First off what are you trying to do? Most likely you should not be trying to control your phone from your pc.
 
Upvote 0
Hey I could do that but then again I already have my sd card partitioned the way I want it and am not using a swap partition until I get my new card because when I put the swap file as internal storage on my phone like those instructions are for I get an error trying to backup in CWM.

@Kouma or anyone else better at scripting than I am I have a question.

Is there a way to mount an internal swap partition on startup and unmount it on shutdown that way it doesn't return a mount error in CWM when doing a backup or is that error because it has been made into a swap partition and not that it is mounted as one?
If error is because it is swap is there a way to convert it back?
 
Upvote 0
Hey I could do that but then again I already have my sd card partitioned the way I want it and am not using a swap partition until I get my new card because when I put the swap file as internal storage on my phone like those instructions are for I get an error trying to backup in CWM.

@Kouma or anyone else better at scripting than I am I have a question.

Is there a way to mount an internal swap partition on startup and unmount it on shutdown that way it doesn't return a mount error in CWM when doing a backup or is that error because it has been made into a swap partition and not that it is mounted as one?
If error is because it is swap is there a way to convert it back?
Why not put the swap on sd card? Either data or ssm works great on sd and is cake easy to reformat and put everything back on sd?
 
Upvote 0
Why not put the swap on sd card? Either data or ssm works great on sd and is cake easy to reformat and put everything back on sd?

That is what I am gonna do when I get new sd card. In the meantime I am using old cheap slow 8GB card. Gonna get 32GB looking at a uhs-1 enabled card wondering if it will work in this thing. Gonna go SSM with new card running data right now but running fine without swap atm.

EDIT: Part of me is just curious about the swap on phone error thing. And if what I was asking about was even possible. I mean if I wasn't so lazy I would go ahead and backup then mkswap on the internal data partition without mounting it as swap and see if I still get the error in CWM when trying to backup.
 
Upvote 0
That is what I am gonna do when I get new sd card. In the meantime I am using old cheap slow 8GB card. Gonna get 32GB looking at a uhs-1 enabled card wondering if it will work in this thing. Gonna go SSM with new card running data right now but running fine without swap atm.

EDIT: Part of me is just curious about the swap on phone error thing. And if what I was asking about was even possible. I mean if I wasn't so lazy I would go ahead and backup then mkswap on the internal data partition without mounting it as swap and see if I still get the error in CWM when trying to backup.

Well that'll be good for you. I'm running the Ssm with the swap I got tons extra space I got lots of apps data that's all stored on the SD card I probably got like 40 folders on the SD card from the apps and still have tons of space left with a 16 gig card.
As for putting the swap on the internal I don't know about that.
 
Upvote 0
Well that'll be good for you. I'm running the Ssm with the swap I got tons extra space I got lots of apps data that's all stored on the SD card I probably got like 40 folders on the SD card from the apps and still have tons of space left with a 16 gig card.
As for putting the swap on the internal I don't know about that.

I use lots of storage on the sd card I keep all kinds of non phone related stuff on it. This is the 4th phone this sd card has been in so its time for an upgrade. With a 2GB ext4 data partition and the rest storage I keep around 1GB free so I can do a backup when I need to. Plus things I am not sure of I just like to try to figure them out. The more I play the more I learn.
 
Upvote 0
Is there a way to mount an internal swap partition on startup and unmount it on shutdown that way it doesn't return a mount error in CWM when doing a backup or is that error because it has been made into a swap partition and not that it is mounted as one?
If error is because it is swap is there a way to convert it back?

the internal swap can't be mounted for backup because cwm is set up for rfs or ext4 partitions. swap support was added to the kernel some time after cwm was built.

to eliminate the error, format /data in cwm before you do the backup.

you could make a script with mkswap and swapon and run it when you start up using an app like anycut or script manager or you could stick it in the init.d folder.

i can't think of a way to automatically reformat the /data partition on shutdown.
 
  • Like
Reactions: Wizard59
Upvote 0
i can't think of a way to automatically reformat the /data partition on shutdown.

It's generally considered a no-no to start processes when shutting down.

also, making stl13 swap can cause some strange things to happen, like random shutdowns.

I personally have /dev/stl13 formatted as ext4, mounted to /system/swap.
the only file on it is swapfile0 which is a swapfile made to take up all of /dev/stl13.

I have a script in init.d mount /dev/stl13 as /system/swap, but it's giving me problems as of late
 
Upvote 0
the internal swap can't be mounted for backup because cwm is set up for rfs or ext4 partitions. swap support was added to the kernel some time after cwm was built.

to eliminate the error, format /data in cwm before you do the backup.

you could make a script with mkswap and swapon and run it when you start up using an app like anycut or script manager or you could stick it in the init.d folder.

i can't think of a way to automatically reformat the /data partition on shutdown.

I got it figured out. Now if I can figure out how to package it into a cwm installable zip.

EDIT:
Well the way I am thinking it would be at shutdown but initially before shutdown.

EDIT AGAIN:
I never had issues when mounted as swap except for the unable to mount /data error in CWM.
 
Upvote 0
@kouma
I have been thinking about what you said about the random shutdowns. I did not experience that while I was running the swap on the /data partition. How often did this happen? Is it possible that the swap was just overloading? I ask because I know on my windows 7 machine with 6GB of RAM my pagefile which is virtual memory same as a swap would sometimes get over 16GB and start to lag the PC if I didn't do a restart every 3-4 days. Is it possible that could be the issue and if so how hard would it be to create a script to say purge the swap every 6-8 hrs? I am still new at the scripting itself but I know how to reformat and recreate the swap file through terminal so script should not be hard its just the timing I am unsure of.
 
Upvote 0
OK this seems to be a day of device issues. Prevail has become way to laggy way to often. I am running data mode with a 700 mb swap partition. I have /dev/block/mmcblk0p3 for swap, swappiness 60. What else can i do to help out with memory? Add another file? Create an internal swap file system? I am still learning my way around custom roms/ kernals so any advice would be much appreciated . I did some reading on creating an internal swap file system and it looks like you have to open an adb shell and some scripting might be involved? I do have Jrummy's Toolbox Pro which has the capability of both. Although I have not done either of these processes yet I am willing to give it a shot if creating an internal swap file system is what I need. Thx in advance for all efforts to help. One more thing switching to SSM mode will only help out with internal storage issues not memory, correct?
 
Upvote 0
OK this seems to be a day of device issues. Prevail has become way to laggy way to often. I am running data mode with a 700 mb swap partition. I have /dev/block/mmcblk0p3 for swap, swappiness 60. What else can i do to help out with memory? Add another file? Create an internal swap file system? I am still learning my way around custom roms/ kernals so any advice would be much appreciated . I did some reading on creating an internal swap file system and it looks like you have to open an adb shell and some scripting might be involved? I do have Jrummy's Toolbox Pro which has the capability of both. Although I have not done either of these processes yet I am willing to give it a shot if creating an internal swap file system is what I need. Thx in advance for all efforts to help. One more thing switching to SSM mode will only help out with internal storage issues not memory, correct?

In data mode mine is way slow and in ssm is way fast for me.
 
Upvote 0
What class is your sd card? Data mode works better on higher class cards. Ssm works very well with lower class cards.

I was running data mode with a class 10 card and anytime ram was under 50 MB it lagged horribly. Just switched to ssm and have yet to reinstall all user apps. I have like 80

NOTE: TB restore did not work switching between data and ssm! Also ssm does not show sdext partition value (internal storage). Menu/applications/storage, internal will show like you don't have the extra partition space.

I only mention this cause it through me off and I thought I had done something wrong till I was informed otherwise. You will also notice when you install apps the available internal storage value does not change, maybe by one. This is how I know ssm is working. Wetbiker7 and LV schooled me through this day before yesterday:D
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones