Author Topic: Information for Openbox Full and Bonsai Users - kernel - ramzswap  (Read 1747 times)

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Hi,

If you use Openbox Bonsai, or the last version of Openbox full, or your own version build on top of it, and if you do use and appreciate ramzswap, you might be interested by what follows.

The configuration made originally won't work anymore with the kernels 2.6.37 which are available in the repos, because the modules in the kernel have changed.
With the 2.6.37 (and above) it is zram:
Code: [Select]
zgrep ZRAM /proc/config.gz
CONFIG_ZRAM=m

The developer of the Compcache project, Nitingupta, http://code.google.com/p/compcache, has given the necessary information in order to adapt.

Now what is to be done ? In the next versions of Bonsai and full Openbox, the change will be done. In Openbox Edu, the change is already in it.

If you are switching or have switched to one of the kernels of version 2.6.37, you need to make a change in your /etc/rc.d/rc.local file.

This is the rc.local as it is originally:
http://pastebin.com/zyJkfxKE

This is the rc.local used in the Openbox versions with kernel 2.6.33.7, using /dev/ramzswap0:
http://pastebin.com/4tUgebU8

This is the new rc.local you need to use if you  want an active zram0 module, with the kernels 2.6.37:
http://pastebin.com/1Tn9D0ZK

I use this configuration each day, it's a good one, "fit for most cases". Here is what I get with this config:
Code: [Select]
cat /proc/swaps
Filename Type Size Used Priority
/dev/sda7                               partition 1019900 0 -1
/dev/zram0                              partition 254972 0 30

If you know what you are doing, you can tweak it your way, with the help of the wiki page at the compcache project: http://code.google.com/p/compcache/wiki/CompilingAndUsingNew

there are many comments, and in the comments, informations given by the developer, on how to activate several block devices and so on...

If you don't know what Compache project and RAM based block device are, and want to know more, you may want to read the main page at the Compcache project: http://code.google.com/p/compcache

PS: if in the future, anyone has an idea about how it could be configured in the pclinuxos systems, in a way that allows to switch from "with zram module" to "without", on the fly, with an adapted configuration, and why not, the choice between several configuration types, I could be interested to know.

PS 2 : if you switch permanently to zram, and kernels 2.6.37 and above, you can also remove the rzscontrol binary which is in /usr/local/sbin as it's neither needed, nor used anymore.
« Last Edit: April 02, 2011, 05:36:31 AM by melodie »
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Information for Openbox Full and Bonsai Users - kernel - ramzswap
« Reply #1 on: June 10, 2011, 11:37:40 PM »
Melodie,

I'm having a little trouble following along here. I'm looking at your instructions, and at the ones at https://code.google.com/p/compcache/wiki/CompilingAndUsingNew.

I understand that ramzswap has been replaced by zram in kernels 2.6.37 and newer. Looking at the author's instructions, I see:

# load dependency modules
modprobe lzo_compress
modprobe lzo_decompress


The kernel object is located at /lib/modules/2.6.33.7-pclos6.bfs/kernel/lib/lzo/lzo_compress.ko.gz. So, that kernel object is for the older 2.6.33 kernel. Are the modprobes no longer needed for 2.6.37 and newer kernels? Is lzop compression replaced by zlib compression at /lib/modules/2.6.38.8-pclos1.bfs/kernel/lib/zlib_deflate/zlib_deflate.ko.gz? (I can modprobe zlib_deflate, but there is no corresponding modprobe zlib_inflate.)

Going to the next section in the author's documentation, I see:

# example1: load ramzswap module
insmod
ramzswap.ko num_devices=4

Would that now become?:

# example1: load ramzswap module
insmod
zram.ko num_devices=4

EDIT: I forgot to mention I'm using the 2.6.38.8-pclos1.bfs kernel on Bonsai.
« Last Edit: June 11, 2011, 12:33:17 AM by djohnston »
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Information for Openbox Full and Bonsai Users - kernel - ramzswap
« Reply #2 on: June 11, 2011, 02:44:14 AM »
Hi djohnston,

I can't help you directly much because I only know "what must be done" in order to get one block device with our recent kernels, and have it to work. This is summed up above : copy the new file from pastebin (I checked, it's still online) →
Quote
This is the new rc.local you need to use if you  want an active zram0 module, with the kernels 2.6.37:
http://pastebin.com/1Tn9D0ZK


and use it to replace the older one. (copy from the field which is under, not from the part where there are line numbers)

This makes it work without anything else. In my system, which is Openbox full on this machine, with 2.6.38 kernel:

Code: [Select]
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda7                               partition 1019900 0 -1
/dev/zram0                              partition 254972 0 30

You didn't tell me what result you are looking for ?

« Last Edit: June 11, 2011, 02:53:59 AM by melodie »
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Information for Openbox Full and Bonsai Users - kernel - ramzswap
« Reply #3 on: June 11, 2011, 12:34:13 PM »
You didn't tell me what result you are looking for ?

I was trying to get it to work. I wasn't paying close enough attention, and I grabbed the wrong file. I got the (older) compcache bash script instead of the newer one, and was trying to make that work. I've since replaced rc.local with the zram bash script and now it's working.

Doh! I'm an idiot.   ???  ::)  :-[
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Information for Openbox Full and Bonsai Users - kernel - ramzswap
« Reply #4 on: June 11, 2011, 04:22:03 PM »
Doh! I'm an idiot.   ???  ::)  :-[

No you're not ! XD
Just a little inattentive... that happens.

I'm glad you got it to work !

Regards,
Mélodie

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline jlf001

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 519
Re: Information for Openbox Full and Bonsai Users - kernel - ramzswap
« Reply #5 on: June 11, 2011, 07:53:53 PM »
Mélodie,

Thanks for the info.  I just updated my Bonsai install.

Jeff
« Last Edit: June 12, 2011, 06:12:58 AM by jlf001 »