You are not logged in.

#1 2014-04-22 02:04:35

dunkles
Banned
From: Chile
Registered: 2010-04-26
Posts: 88

zram fails to start [SOLVED]

I installed zramswap in AUR and then activate with

# systemctl enable zramswap

I restart and not works:


● zramswap.service - Zram-based swap (compressed RAM block devices)
   Loaded: loaded (/usr/lib/systemd/system/zramswap.service; disabled)
   Active: failed (Result: exit-code) since lun 2014-04-21 23:10:39 CLST; 1min 4s ago
  Process: 7078 ExecStart=/usr/lib/systemd/scripts/zramctrl start (code=exited, status=2)
 Main PID: 7078 (code=exited, status=2)

abr 21 23:10:39 tarro systemd[1]: Starting Zram-based swap (compressed RAM block devices)...
abr 21 23:10:39 tarro zramctrl[7078]: Setting up swapspace version 1, size = 195804 KiB
abr 21 23:10:39 tarro zramctrl[7078]: LABEL=zram0, UUID=c7b28bdd-39d9-402d-b782-98deafda976b
abr 21 23:10:39 tarro systemd[1]: zramswap.service: main process exited, code=exited, status=2/INVALIDARGUMENT
abr 21 23:10:39 tarro systemd[1]: Failed to start Zram-based swap (compressed RAM block devices).
abr 21 23:10:39 tarro systemd[1]: Unit zramswap.service entered failed state.
abr 21 23:10:39 tarro zramctrl[7078]: awk: línea ord.:21: (FILENAME=/proc/meminfo FNR=43) fatal: no se puede redirigir a `/sys/block/zram1/disksize' (No existe el fichero o el directorio)

Somebody help me?

Last edited by dunkles (2014-04-23 02:31:35)

Offline

#2 2014-04-22 09:37:58

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: zram fails to start [SOLVED]

Can we have the errors in English please.....

LC_ALL=C systemctl enable zramswap

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2014-04-22 12:51:29

dunkles
Banned
From: Chile
Registered: 2010-04-26
Posts: 88

Re: zram fails to start [SOLVED]

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"

but the message is the same, half english and half spanish

● zramswap.service - Zram-based swap (compressed RAM block devices)
   Loaded: loaded (/usr/lib/systemd/system/zramswap.service; disabled)
   Active: failed (Result: exit-code) since Tue 2014-04-22 09:47:29 CLST; 10s ago
  Process: 16797 ExecStart=/usr/lib/systemd/scripts/zramctrl start (code=exited, status=2)
 Main PID: 16797 (code=exited, status=2)

Apr 22 09:47:29 tarro zramctrl[16797]: awk: línea ord.:22: (FILENAME=/proc/meminfo FNR=43) aviso: falló la limpieza del fichero de `/sys/block/zram0/disksize' (Dispositivo o recurso ocupado).
Apr 22 09:47:29 tarro zramctrl[16797]: mkswap: /dev/zram0: warning: wiping old swap signature.
Apr 22 09:47:29 tarro zramctrl[16797]: Setting up swapspace version 1, size = 195804 KiB
Apr 22 09:47:29 tarro zramctrl[16797]: LABEL=zram0, UUID=acd4a3a8-c309-4525-b402-379c2f556b5b
Apr 22 09:47:29 tarro zramctrl[16797]: awk: línea ord.:21: (FILENAME=/proc/meminfo FNR=43) fatal: no se puede redirigir a `/sys/block/zram1/disksize' (No existe el fichero o el directorio)
Apr 22 09:47:29 tarro systemd[1]: zramswap.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 22 09:47:29 tarro systemd[1]: Failed to start Zram-based swap (compressed RAM block devices).
Apr 22 09:47:29 tarro systemd[1]: Unit zramswap.service entered failed state.

Last edited by dunkles (2014-04-22 20:56:31)

Offline

#4 2014-04-22 13:03:59

Perfect Gentleman
Member
Registered: 2012-10-25
Posts: 222

Re: zram fails to start [SOLVED]

I don't think that zramswap is needed, zswap is supported by kernel  - To enabled zswap, the "enabled" attribute must be set to 1 at boot time.  e.g. zswap.enabled=1

Last edited by Perfect Gentleman (2014-04-22 13:04:47)

Offline

#5 2014-04-22 18:03:54

dunkles
Banned
From: Chile
Registered: 2010-04-26
Posts: 88

Re: zram fails to start [SOLVED]

Perfect Gentleman wrote:

I don't think that zramswap is needed, zswap is supported by kernel  - To enabled zswap, the "enabled" attribute must be set to 1 at boot time.  e.g. zswap.enabled=1

zswap is not the same as zram

Offline

#6 2014-04-22 18:27:24

Perfect Gentleman
Member
Registered: 2012-10-25
Posts: 222

Re: zram fails to start [SOLVED]

dunkles wrote:

zswap is not the same as zram

yep, but if you have a swap device, it'll be the same

Offline

#7 2014-04-22 18:49:51

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: zram fails to start [SOLVED]

dunkles, use code tags when posting snippets. You have been here long enough to know the forum etiquette.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#8 2014-04-22 20:58:17

dunkles
Banned
From: Chile
Registered: 2010-04-26
Posts: 88

Re: zram fails to start [SOLVED]

Inxsible wrote:

dunkles, use code tags when posting snippets. You have been here long enough to know the forum etiquette.

sorry i forget it

Offline

#9 2014-04-22 22:59:28

vorbote
Member
From: 8375 ft closer to the stars
Registered: 2011-02-07
Posts: 38
Website

Re: zram fails to start [SOLVED]

I'll state the obvious: a.) zram is a module anf b.) it needs to be loaded *early* in the boot process.

Add it to the MODULES section in /etc/mkinitcpio.conf, regenerate the initramfs files and try again. Don't forget to enable zram in the boot parameters line of your boot loader (that would be GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub if you use grub and use grub-mkconfig or editing /boot/grub/grub.cfg and adding the correct parameters if you are maintaining your configuration files by hand.)

Last edited by vorbote (2014-04-22 23:06:02)


I break things and put them back together for fun and sometimes profit, because it is the only way to learn.

Offline

#10 2014-04-23 02:30:29

dunkles
Banned
From: Chile
Registered: 2010-04-26
Posts: 88

Re: zram fails to start [SOLVED]

vorbote wrote:

I'll state the obvious: a.) zram is a module anf b.) it needs to be loaded *early* in the boot process.

Add it to the MODULES section in /etc/mkinitcpio.conf, regenerate the initramfs files and try again. Don't forget to enable zram in the boot parameters line of your boot loader (that would be GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub if you use grub and use grub-mkconfig or editing /boot/grub/grub.cfg and adding the correct parameters if you are maintaining your configuration files by hand.)

not work


i solved with this page : http://geekland.hol.es/optimizar-el-ren … -con-zram/

thanks anyway smile

[root@tarro ~]# swapon -s
Filename				Type		Size	Used	Priority
/dev/zram0                             	partition	102396	0	50
/dev/zram1                             	partition	102396	0	50
/dev/zram2                             	partition	102396	0	50
/dev/zram3                             	partition	102396	0	50

Last edited by dunkles (2014-04-23 02:31:11)

Offline

#11 2014-04-23 05:45:52

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: zram fails to start [SOLVED]

Perfect Gentleman wrote:
dunkles wrote:

zswap is not the same as zram

yep, but if you have a swap device, it'll be the same

Can you explain why?

Offline

#12 2014-04-23 07:05:13

Perfect Gentleman
Member
Registered: 2012-10-25
Posts: 222

Re: zram fails to start [SOLVED]

according to documetaion and if i understood it properly, zswap creates zram devices and real swap device is need for it, zram can work without real swap device.

Offline

#13 2014-04-23 11:36:15

vorbote
Member
From: 8375 ft closer to the stars
Registered: 2011-02-07
Posts: 38
Website

Re: zram fails to start [SOLVED]

dunkles wrote:

i solved with this page : http://geekland.hol.es/optimizar-el-ren … -con-zram/

thanks anyway smile

Good! But that blog entry doesn't conflict what I said. I'll bet that zramswap-enabler is a script that loads up the zram module and defines the swap disks. Frankly, I don't see a real advantage using zram unless you have 16GB RAM or more and some sort of battery backed memory, as you would find in a "real" server. Us mortals are better off with zwap. (Aquí habla la voz de la experiencia, saludos de tres paises arriba. ;-P).


I break things and put them back together for fun and sometimes profit, because it is the only way to learn.

Offline

#14 2014-04-23 11:45:32

vorbote
Member
From: 8375 ft closer to the stars
Registered: 2011-02-07
Posts: 38
Website

Re: zram fails to start [SOLVED]

orschiro wrote:
Perfect Gentleman wrote:
dunkles wrote:

zswap is not the same as zram

yep, but if you have a swap device, it'll be the same

Can you explain why?

The major difference is that all RAM assigned to zram is lost for application and kernel use. It is permanently assigned as swapping space. On the other hand zswap is an overlay that compresses memory pages moved to swap. Insofar as the compressed swapped pages fit in RAM, they will not be sent to disk. Once they are sent to disk you'll get the same performance hit as if you were not using zwap. Depending on how much physical swap you have available zswap is more convenient than zram, based in my experience the sweet spot is 12 to 16 GB RAM.

Last edited by vorbote (2014-04-23 11:46:09)


I break things and put them back together for fun and sometimes profit, because it is the only way to learn.

Offline

#15 2014-04-23 12:56:31

Perfect Gentleman
Member
Registered: 2012-10-25
Posts: 222

Re: zram fails to start [SOLVED]

The major difference is that all RAM assigned to zram is lost for application and kernel use. It is permanently assigned as swapping space.

i think, you are wrong. I got 16GB RAM and 12GB ZRAM. And RAM is not lost.
ZRAM.1398257488.png

Offline

#16 2014-04-23 13:05:43

Perfect Gentleman
Member
Registered: 2012-10-25
Posts: 222

Re: zram fails to start [SOLVED]

dunkles, if you are intersted, i can post here systemd service and script for activationg ZRAM that i wrote yesterday.

Offline

#17 2014-04-23 17:37:40

dunkles
Banned
From: Chile
Registered: 2010-04-26
Posts: 88

Re: zram fails to start [SOLVED]

vorbote wrote:
dunkles wrote:

i solved with this page : http://geekland.hol.es/optimizar-el-ren … -con-zram/

thanks anyway smile

Good! But that blog entry doesn't conflict what I said. I'll bet that zramswap-enabler is a script that loads up the zram module and defines the swap disks. Frankly, I don't see a real advantage using zram unless you have 16GB RAM or more and some sort of battery backed memory, as you would find in a "real" server. Us mortals are better off with zwap. (Aquí habla la voz de la experiencia, saludos de tres paises arriba. ;-P).

I have only 4 GB of ram sad (pero me a funcionado bastante bien zram smile )

Offline

#18 2014-04-23 17:39:44

dunkles
Banned
From: Chile
Registered: 2010-04-26
Posts: 88

Re: zram fails to start [SOLVED]

Perfect Gentleman wrote:

dunkles, if you are intersted, i can post here systemd service and script for activationg ZRAM that i wrote yesterday.

that would be great smile

Offline

#19 2014-04-23 19:32:11

vorbote
Member
From: 8375 ft closer to the stars
Registered: 2011-02-07
Posts: 38
Website

Re: zram fails to start [SOLVED]

Perfect Gentleman wrote:

The major difference is that all RAM assigned to zram is lost for application and kernel use. It is permanently assigned as swapping space.

i think, you are wrong. I got 16GB RAM and 12GB ZRAM. And RAM is not lost.
http://ipic.su/img/img7/fs/ZRAM.1398257488.png

It could be. There was a major rewrite last year and I haven't used it since before then. But your report tells me nothing. Out of curiosity, what do free and top say? Top will give you a good idea of how RAM usage is allocated and "free -tk" should report similar quantities.


I break things and put them back together for fun and sometimes profit, because it is the only way to learn.

Offline

#20 2014-04-24 04:59:08

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: zram fails to start [SOLVED]

It is still not clear to me. If I use zswap by zswap.enabled=1 zswap.compressor=lz4 as kernel boot parameters, and I only have 8GB RAM, then the use of zram is obsolete because my entire RAM is assigned to be swapping space?

Last edited by orschiro (2014-04-24 04:59:47)

Offline

#21 2014-04-24 07:01:31

Perfect Gentleman
Member
Registered: 2012-10-25
Posts: 222

Re: zram fails to start [SOLVED]

zram (executable)

#!/bin/bash

start() {
  for i in {0..7}; do /usr/bin/echo 1610612736 > /sys/block/zram${i}/disksize; /usr/bin/mkswap /dev/zram${i}; /usr/bin/swapon -p100 /dev/zram${i}; done
}

stop() {
  for i in {0..7}; do /usr/bin/swapoff /dev/zram${i}; /usr/bin/echo 1 > /sys/block/zram${i}/reset; done
}

case $1 in
  start|stop) "$1" ;;
esac

zram.service

[Unit]
Description=Zram-based swap (compressed RAM block devices)

[Service]
Type=oneshot
ExecStart=/etc/systemd/system/zram start
ExecStop=/etc/systemd/system/zram stop
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

some explanation: 16 GiB, 4 cores, 8 threads, 1.5 GiB ZRAM for each thread

Offline

#22 2014-04-24 07:04:17

Perfect Gentleman
Member
Registered: 2012-10-25
Posts: 222

Re: zram fails to start [SOLVED]

-

Last edited by Perfect Gentleman (2014-04-24 07:50:52)

Offline

#23 2014-04-24 15:50:10

dunkles
Banned
From: Chile
Registered: 2010-04-26
Posts: 88

Re: zram fails to start [SOLVED]

Thanks you big_smile

Offline

#24 2014-04-24 16:34:45

Perfect Gentleman
Member
Registered: 2012-10-25
Posts: 222

Re: zram fails to start [SOLVED]

you're welcome

Offline

Board footer

Powered by FluxBB