0

How to disable zram at boot?

What I found was mostly to

swapoff -a
rmmod zram

but after reboot it came back

I found such question being asked at different places, e.g.,

But none seems to be able to get answered properly.

xpt
  • 987
  • 2
  • 13
  • 31
  • 1
    Reading the answer at https://askubuntu.com/questions/1287243/how-do-i-replace-zram-swap-with-a-swap-file I think you have to run `sudo systemctl disable nvzramconfig` to disable ZRAM. – Terrance Apr 03 '22 at 21:22
  • Thanks @Terrance. So I tried it and got _"Failed to disable unit: Unit file nvzramconfig.service does not exist."_, but `sudo systemctl disable zram-config` works! Thanks!! – xpt Apr 03 '22 at 22:27
  • Please provide information on the version of your operating system, and how you configured it to use a zram swap space. – vanadium Apr 04 '22 at 09:16

1 Answers1

1

On Arch Linux-based systems, it is possible that zram is configured via zram-generator package. The generator is invoked by systemd early at boot. You can check unit status of your configuration service via systemd-zram-setup@zramN.service. N is the zram device id. To disable generator, set systemd.zram[=0|1] kernel parameter.

sudo nano /etc/default/grub

Then add systemd.zram=0 argument to GRUB_CMDLINE_LINUX_DEFAULT as follows.

GRUB_CMDLINE_LINUX_DEFAULT="systemd.zram=0"

Then generate grub config file

sudo grub-mkconfig -o /boot/grub/grub.cfg