Tiny Core Base > TCB Tips & Tricks

Resize ramzswap

(1/2) > >>

TaoTePuh:
Maybe this is helpful for someone, somewhere, sometimes  ...

TC uses 25% of the RAM for ramzswap. Sometimes this is too little or too much.

The initialization of ramzswap is done in the script /etc/init.d/tc-config. Unfortunately, the boot codes for the kernel module ramzswap are (currently) not considered by the script and so there is no way to take control with boot codes.

Another possibility would be to change the script tc-config but then you have to remaster TC. Besides, this is not good if you want to upgrade later times.

A third possibility exists with the script /opt/bootlocal.sh - this I will present here:


--- Code: ---##
## ramzswap
##
## remove all existing swap
swapoff -a
# remove the ramzswap kernel module
rmmod ramzswap.ko
## load the ramzswap kernel module again
modprobe ramzswap.ko num_devices=1
## initialize the device
rzscontrol /dev/ramzswap0 --disksize_kb 51200 --init
## swap on
swapon /dev/ramzswap0
swapon -a

--- End code ---

This snippet replaces the existing ramzswap with 50 MB fresh one. Let's take a look at the result:


--- Code: ---tc@box:~$ cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/ramzswap0                          partition       51192   0       -1
/dev/sda2                               partition       2096472 0       -2

--- End code ---

Note: If you want to try this on the console, do not forget the sudo.

Note: More Information about the options can be found here:
http://compcache.googlecode.com/hg/sub-projects/rzscontrol/man/rzscontrol.html?r=a1446e34a056e23e3ff9dc0a9f0c1e0c9605d43c

Warning: If you're short on RAM so that your system needs swap at boot time - don't use this script - your system might crash.

curaga:
"nozswap" and then you can set up it without any teardown required.

TaoTePuh:
1.) Without "swapoff -a" you may run in trouble with swap priorities.
2.) With boot code nozswap, you lose the ramzswap entry in /etc/fstab which is done by the script tc-config. Then the shutdown (/etc/init.d/rc.shutdown) runs not clean (swapoff -a).

larrys4227:
Hello, I re-installed TC because the first time, I didnt make a partition for Linux swap and since its an older machine (PII-300 w/256M RAM) I decided to start over again.

This thread is the best one I found for dealing with the problem now, but I'm stumped .... it seems that ramzswap is prioritized over my hda2 swap partition, and its not mounted.  I've added the proper line in /etc/fstab but it keeps rewriting it as 'none swap' and mounting only ramzswap.

I see entries here stating to add a nozswap, but I have no idea where to place it.

Should I be concerned?, or am I wasting 1GB of HD space for a swap that will never be used?

Thanks a bunch!

gerald_clark:
If the partition is type 82 and you run mkswap on it, it will be found and swapped on.

Navigation

[0] Message Index

[#] Next page

Go to full version