systemd / zram-generator

Systemd unit generator for zram devices
MIT License
575 stars 48 forks source link

Zram stopped creating at startup after I edited the zram-generator.conf #159

Closed AziaRae closed 2 years ago

AziaRae commented 2 years ago

I edited the /etc/systemd/zram-generator.conf, and restarted my system expecting that it would create the zram whenever I boot Fedora. Instead, it stopped generating zram, and I have to manually create it everytime I boot up. These are the contents of my zram-generator.conf

s file is part of the zram-generator project
# https://github.com/systemd/zram-generator

[zram0]
# This section describes the settings for /dev/zram0.
#
# The maximum amount of memory (in MiB). If the machine has more RAM
# than this, zram device will not be created.
#
# "host-memory-limit = none" may be used to disable this limit. This
# is also the default.
host-memory-limit = none

# The size of the zram device, as a function of MemTotal, both in MB.
# For example, if the machine has 1 GiB, and zram-size=ram/4,
# then the zram device will have 256 MiB.
# Fractions in the range 0.1–0.5 are recommended.
#
# The default is "min(ram / 2, 4096)".
zram-size = min(ram / 2, 4096)

# The compression algorithm to use for the zram device,
# or leave unspecified to keep the kernel default.
compression-algorithm = zstd

# By default, file systems and swap areas are trimmed on-the-go
# by setting "discard".
# Setting this to the empty string clears the option.
# options =

# Write incompressible pages to this device,
# as there's no gain from keeping them in RAM
# writeback-device = /dev/zvol/tarta-zoot/swap-writeback

# The following options are deprecated, and override zram-size.
# These values would be equivalent to the zram-size setting above.
#zram-fraction = 0.10
#max-zram-size = 2048

What should I do to fix this?

More Info about my system:

╰─>$ neofetch
             .',;::::;,'.                mitsuki@fedora
         .';:cccccccccccc:;,.            --------------
      .;cccccccccccccccccccccc;.         OS: Fedora Linux 36 (Workstation Edition) x86_64
    .:cccccccccccccccccccccccccc:.       Host: VivoBook_ASUSLaptop X515EA_X515EA 1.0
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Kernel: 5.18.17-200.fc36.x86_64
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Uptime: 2 hours, 6 mins
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.   Packages: 3016 (rpm), 9 (flatpak)
,cccccccccccccc;MMM.;cc;;WW::cccccccc,   Shell: fish 3.5.0
:cccccccccccccc;MMM.;cccccccccccccccc:   Resolution: 1920x1080
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:   WM: sway
cccccc:0MMKxdd:;MMMkddc.;cccccccccccc;   Theme: Adwaita [GTK2/3]
ccccc:XM0';cccc;MMM.;cccccccccccccccc'   Icons: Adwaita [GTK2/3]
ccccc;MMo;ccccc;MMW.;ccccccccccccccc;    Terminal: alacritty
ccccc;0MNc.ccc.xMMd:ccccccccccccccc;     CPU: 11th Gen Intel i3-1115G4 (4) @ 4.100GHz
cccccc;dNMWXXXWM0::cccccccccccccc:,      GPU: Intel Device 9a78
cccccccc;.:odl:.;cccccccccccccc:,.       Memory: 6368MiB / 11659MiB
:cccccccccccccccccccccccccccc:'.
.:cccccccccccccccccccccc:;,..
  '::cccccccccccccc::;,.
keszybz commented 2 years ago

This should work. Please attach the full boot log from journalctl -b.

AziaRae commented 2 years ago

This should work. Please attach the full boot log from journalctl -b.

I'm sorry but if I try to paste it on github, it gives me the error You can't comment at this time — your comment is too long (maximum is 65536 characters)., and when I try it on pastebin, it says You have exceeded the maximum size of 512 kilobytes per Paste. What can you suggest me to do so I can paste the full output of journalctl -b?

keszybz commented 2 years ago

Try compressing before attaching. Don't paste.

AziaRae commented 2 years ago

I managed to find a way to send it without pasting it. I just uploaded it to Google Drive because my laptop lags whenever I try to paste it.

output of journalctl -b: https://drive.google.com/file/d/1K5IN6CkMzvg2V1WSO6Cn9arabiDVUAf6/view?usp=sharing

keszybz commented 2 years ago
Aug 18 12:38:58 fedora systemd[1]: dev-zvol-tarta\x2dzoot-swap\x2dwriteback.device: Job dev-zvol-tarta\x2dzoot-swap\x2dwriteback.device/start timed out.
Aug 18 12:38:58 fedora systemd[1]: Timed out waiting for device dev-zvol-tarta\x2dzoot-swap\x2dwriteback.device - /dev/zvol/tarta-zoot/swap-writeback.
Aug 18 12:38:58 fedora systemd[1]: Dependency failed for systemd-zram-setup@zram0.service - Create swap on /dev/zram0.
Aug 18 12:38:58 fedora systemd[1]: Dependency failed for dev-zram0.swap - Compressed Swap on /dev/zram0.
Aug 18 12:38:58 fedora systemd[1]: dev-zram0.swap: Job dev-zram0.swap/start failed with result 'dependency'.
Aug 18 12:38:58 fedora systemd[1]: systemd-zram-setup@zram0.service: Job systemd-zram-setup@zram0.service/start failed with result 'dependency'.
Aug 18 12:38:58 fedora systemd[1]: dev-zvol-tarta\x2dzoot-swap\x2dwriteback.device: Job dev-zvol-tarta\x2dzoot-swap\x2dwriteback.device/start failed with result 'timeout'.

It looks like you have some additional configuration defined that configures a writeback device, which is missing, and thus the swap device doesn't get used. There doesn't seem to be any bug in the generator.