foundObjects / zram-swap

A simple zram swap service for modern systemd Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No longer working on RPi4B Ubuntu 21.10 Impish

FlyingFathead opened this issue · comments

Hi there!

Thanks so much for this brilliant little performance booster! However, to my sadness, zram-swap no longer works in any of my Ubuntu 21.10 (Impish)-based endpoints -- I just noticed that after updating some of my 64bit Ubuntu based builds. I've tried re-downloading and re-installing it on a few endpoints now -- alas, the computer says no.

I haven't encountered this problem ever before, so idk if it's a change on Ubuntu's end or what. I can't start the service, and journalctl -xe says:

Oct 21 18:01:02 thismachine zram-swap.sh[2922]: modprobe: FATAL: Module zram not found in directory /lib/modules/5.13.0-1008-raspi
Oct 21 18:01:02 thismachine zram-swap.sh[2902]: Err main: Failed to load zram module, exiting
Oct 21 18:01:01 thismachine systemd[1]: Starting zram swap service...

The odd thing is that I didn't find any references to zram-swap from the other earlier kernel version subdirectories under the /lib/modules/ directory tree, but zram-swap still worked right up until 21.04 nonetheless.

Please advise, zram-swap is one of my favorites on Ubuntu RPi4B builds. I'd really like to see it working again. Cheers and all the best.

Hmm, can you zcat /proc/config.gz > $(uname -r).config and stick that on pastebin or in a gist? Zram is often built into the kernel rather than built as a module, but the modprobe call should still complete successfully. The only times that call usually fails is if there's an actual problem loading the module or if the module isn't built at all.

the zram kernel module has now been moved to linux-modules-extra-raspi - so installing this package is now needed from 22.10 and later. Hope this helps.

Hmm, can you zcat /proc/config.gz > $(uname -r).config and stick that on pastebin or in a gist? Zram is often built into the kernel rather than built as a module, but the modprobe call should still complete successfully. The only times that call usually fails is if there's an actual problem loading the module or if the module isn't built at all.

Hi! Tried running that command and got an error; this happened on multiple RPi4B Ubuntus since they don't have the file mentioned (/proc/config.gz):

gzip: /proc/config.gz: No such file or directory

However, by installing linux-modules-extra-raspi apt package as @fossfreedom suggested (THANK YOU! <3), the entire issue was solved.

sudo apt-get install linux-modules-extra-raspi

And then run the zram-swap install.sh script as sudo, now all's working perfectly!

My suggestion would be to add a check-up into the install script for the linux-modules-extra-raspi if the distro matches Ubuntu. There's multiple ways to do that and I wrote my own Gist -- I tested it on a Raspberry Pi 4B running 64-bit Ubuntu 21.10 Impish, and it works perfectly on it. Feel free to add it to your code and modify as needed (i.e. add the correct package for amd64 Ubuntus -- I can also help in testing that out if you need further assistance). All the best and Happy Holidays to you all :o)

@foundObjects 👀 👇
https://gist.github.com/FlyingFathead/3055b243d0ad0f33ce7847fab89974ac

I've now updated the gist code to work on Ubuntu Impish on both x86_64 (amd64) as well as on the Raspberry Pi 4B .

The script runs as follows: if the distribution is detected as being Ubuntu, it will check if the appropriate kernel-modules-extra package to see whether it is installed and if it's not, it at least tries to install the appropriate version needed for zram-swap to work.

https://gist.github.com/FlyingFathead/3055b243d0ad0f33ce7847fab89974ac

Have tested it on a few endpoints and seems to be working OK on both x64 pc's and RPi4B's running Ubuntu Impish 64-bit.

However, it has potential pitfalls, i.e. obviously the remote chance of it not finding & installing the right package, although I think the system info check-up method & overall apt-package fetch&install procedure should be pretty much spot-on -- nonetheless it might do something odd if the host is something more exotic than a Ubuntu Impish on either a Raspberry Pi4B or a x86_64 system.

@fossfreedom and @foundObjects -- please feel free to change the code as needed or comment on it. I guess it could've kept it more compact tbh but at least it's easily improvable, and is working for me on the multiple RPi4B's and x64 pc's I've now tested it on. Cheers!

commented

Hmm, can you zcat /proc/config.gz > $(uname -r).config and stick that on pastebin or in a gist? Zram is often built into the kernel rather than built as a module, but the modprobe call should still complete successfully. The only times that call usually fails is if there's an actual problem loading the module or if the module isn't built at all.

Hi! Tried running that command and got an error; this happened on multiple RPi4B Ubuntus since they don't have the file mentioned (/proc/config.gz):

gzip: /proc/config.gz: No such file or directory

However, by installing linux-modules-extra-raspi apt package as @fossfreedom suggested (THANK YOU! <3), the entire issue was solved.

sudo apt-get install linux-modules-extra-raspi

And then run the zram-swap install.sh script as sudo, now all's working perfectly!

My suggestion would be to add a check-up into the install script for the linux-modules-extra-raspi if the distro matches Ubuntu. There's multiple ways to do that and I wrote my own Gist -- I tested it on a Raspberry Pi 4B running 64-bit Ubuntu 21.10 Impish, and it works perfectly on it. Feel free to add it to your code and modify as needed (i.e. add the correct package for amd64 Ubuntus -- I can also help in testing that out if you need further assistance). All the best and Happy Holidays to you all :o)

@foundObjects eyes point_down https://gist.github.com/FlyingFathead/3055b243d0ad0f33ce7847fab89974ac

I now installed this tool and this issue appears also on

raspberry pi 3b+
OS: Ubuntu 21.10 impish
Kernel: aarch64 Linux 5.13.0-1022-raspi

And this answer helped me, so just thank you