Bonum Certa Men Certa

Messing With ZRAM Again Because IBM Software is Barely Possible to Document and Changes if You Do

Reprinted with permission from Ryan Farmer.

It turns out that when I was setting up Debian, I set up my “zram-generator” systemd configuration file wrong.



systemd is Hell because they never commit themselves to the idea that once you learn how to do anything with it, it will stay working, most of its components are full of bugs and security vulnerabilities, and many things replace something that some other part of the operating system was already doing a lot better.



I cringe every time I give it some new responsibility over my system, waiting for how it will go wrong. I would be using systemd-oomd to handle potential out-of-memory situations, but I’ve read so much about how it handles memory pressure bizarrely and worse than the kernel’s oom-killer, even with the Fedora defaults, that I figure I’ll just leave it alone unless it becomes “mandatory” at some point.



I hear (on Reddit) that systemd-oomd does crazy shit, like, “There are 32 GB of RAM in this system. 12 GB are in use. 20 GB are free. Let’s go on a murder spree and shut down some Chrome tabs and LibreOffice with unsaved work!”



ZRam is a compressed block device that you can use for a compressed swap file in memory. The idea isn’t a bad one, but IBM has made figuring out how to set it up unnecessarily painful because of course it is handled by systemd. You’d think setting up ZRam would be too simple for systemd to bring too much of its usual incompetence to, but nooooo.



Today I actually looked at zramctl and it told me the compression type was lzo-rle, not zstd as I wanted (and was the default on openSUSE and I’m sure that’s what it said when I set it up on Debian and started the service).



Whatever.



Looking around the Web, I found that I needed the line compression-algorithm = zstd in my /etc/systemd/zram-generator.conf file.



So I added it and rebooted, and checked sudo zramctl again and I had zstd compression. Yay!



But when I was looking at the manpage for “zram-generator”, it said that the method by which to specify the fraction of the size of RAM to use was obsolete.



zram-fraction = 1.00 does work, but it’s “obsolete”.



So now it tells me that the “current” way to do the same thing is zram-size=ram/x, where ram is the amount of ram and x is the amount to divide by.



So ram/2 would make the device half of RAM, ram/1 would make it all of your RAM, which is what I wanted.



So now my file looks like this:



# This config file enables a /dev/zram0 swap device with the following
# properties:
# * size: 50% of available RAM or 4GiB, whichever is less
# * compression-algorithm: kernel default
#
# This device’s properties can be modified by adding options under the
# `[zram0]` section, or disabled by removing the section header.
# Additional zram devices can be created by appending new `[zramX]`
# sections and setting the appropriate options for each device.
#
# See /usr/share/doc/systemd-zram-generator/zram-generator.conf.example
# and/or zram-generator.conf(5) for a list of available options.
[zram0]
zram-size=ram/1
compression-algorithm = zstd



I’m not exactly sure why IBM Red Hat keeps screwing around changing the way you do this. They make you memorize something only to make pointless changes to the way it’s done, but then the stupid thing doesn’t want to break existing setups, so they just say the old one is “obsolete”.



$ sudo zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 zstd 15.4G 4K 64B 4K 8 [SWAP]



At least this thing is finally set up right, I think.



They never let you get too sure that you did it right or it wouldn’t be “modern”.



As to the debate about zstd vs lzo-rle, they’re both decent choices.



I can see the logic of defaulting to either one, depending on who you think your users are.



If you have a multi-core x86 PC with lots of CPU performance to burn, zstd makes more sense because of higher compression ratios.



If you have some little ARM system that you bought down at the Micro-Center and don’t want to overload it, but still do want to use ZRam, lzo-rle is a respectable choice.



If anything, ZRam with zstd has gotten faster since the kernel developers have last updated the default and I suspect it deserves another look.

Recent Techrights' Posts

People Discuss Rumours of Mass Layoffs at IBM Becoming Public in 1-2 Weeks
IBM is killing its brand or its "goodwill"
The Old Days
In the early days of this site (2006) it was mostly just a couple of people, plus comments
Links 28/03/2026: Microsoft's LinkedIn a National Security Risk, Microsoft's Slop "Ambitions Face Investor Scrutiny Amid Soaring Costs"
Links for the day
 
No Daylight Saved
Is there still any practical reason for this ritual?
Microsoft Azure Does Not Have "Hiring Freezes", It Has Had Mass Layoffs Every Year Since 2020
Things are always a lot worse than Microsoft formally or publicly acknowledges
SLAPP Censorship - Part 27 Out of 200: Using the Tor Network to Hide From Consequences
Only 1-2 weeks after the countersuit the Canadian attempted to deplatform several Web sites
The Limits of Inclusion
Inclusion with caution isn't "opinionated"; it's a defence mechanism, sometimes a survival instinct
Almost 20 Years After Microsoft/Novell
The mission has not changed, but the priorities evolve all the time
LLM Slop Kills Sites, as Sites That Adopt Slop Are Doomed
People won't subscribe to such sites and visit them if they recognise it's just slop
Links 29/03/2026: Indonesia Cracks Down on Social Control Media Addiction, China Becomes World’s Scientific Superpower
Links for the day
Fedora at the Mercy of Microsoft Because of Back-Doored Kick-Switch Boot
We'll soon revisit the defamation attacks on Torvalds
Links 29/03/2026: Water Shortages and No Kings Rallies
Links for the day
Gemini Links 29/03/2026: Return to Gopherspace, "Zen of Marking Playing Cards"
Links for the day
The Real XBox is Dead, So Microsoft is Calling Everything "XBox" Now
It even wanted to run a campaign to convince everybody that XBox is not actually a console
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, March 28, 2026
IRC logs for Saturday, March 28, 2026
Open Web Destroyed by Centibillionaires, Says Anil Dash of Blogging Fame
Blogging was going through its 'prime years' about 20 years ago
"Linux" Slop Going Away, Microsoft et al Pay 'Linux' Foundation to Promote Slop
It's a timely reminder that the Linux Foundation exists to promote whoever pays the Linux Foundation, even pedophiles and companies that attack the GPL
Gemini Links 28/03/2026: "Finding My Base Tone", "Astrobotany", and BugoutBack/OFFLFIRSOCH
Links for the day
Links 28/03/2026: More Worldwide Bans on Social Control Media (Harms to Adolescents), Protests in US Against Dictatorship
Links for the day
SLAPP Censorship - Part 26 Out of 200: Asking for Documents and Information You Already Have, Even Letters and E-mails That You Yourself Sent!
barristers are expensive
Gemini Links 28/03/2026: Echo Delay and 0x0.st
Links for the day
Rumours of More IBM Mass Layoffs at Beginning of April
IBM is not doing well
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, March 27, 2026
IRC logs for Friday, March 27, 2026
"Headcount" as Distraction From Mass Layoffs and Salary Reductions
Things aren't looking well when one considers revenue is acquired, not earned
"Linux" Slop Turning Rarer, New York Times Nowadays Contaminated With LLM Slop
Another day has passed without much slop about "linux"
Links 27/03/2026: Studying Whale Births, Apple is Cancelling Products, Cambodia Arrests Journalists Over Photographs
Links for the day
Gemini Links 27/03/2026: GTD, Gopher Catchup, Gemini Crawlers, and "Slop Everywhere"
Links for the day
Mozilla Was Ruined Like Sirius Open Source Was Ruined - From the Top Down
Mozilla will never return to its Free software roots
Nokia Could Never Recover From Microsoft
It's very important to remember what really happened
Why Techrights and Many Other Sites Stopped Doing April Fools’ Day Articles
Well before slop (made by LLMs) it was "bad optics" to have satire or humour in a site, irrespective of the day of the year
President Not-Cocaine Campinos Notified of Historic EPO Strikes (Thousands of Workers Not Coming Back to the Office)
Please do pay attention to how the media treats these strikes in Europe's second-largest institution
Slides From the Presentation Discussing EPO Strikes Until End of June or Until End of 2026 (Maybe Next Year Too)
More to come soon (later today)
IBM Cuts Are Everywhere (Global), the Aim is to Lower the Pay
Because the revenues keep falling (IBM buys other companies' revenues using borrowed money)
Perpetual Strikes to Begin at European Patent Office (EPO), Large Majority Votes for Strikes Any Day of the Week
Approved industrial actions [...] Notice how none of the media or even so-called 'IP' blogs write about it
Mozilla is Not a Privacy Company, Mozilla is Run by GAFAM Executives and Managers Who Came From American Surveillance Companies
Would you trust a VPN they claim to be "free"?
SLAPP Censorship - Part 25 Out of 200: That Time Matthew J. Garrett Got Temporarily Banned/Suspended From Twitter
That he gets banned from large social control media platform is hardly surprising given his combative communications
Ubuntu Started as Free With ShipIt, Now It Becomes Payware That Exploits Debian Volunteers (Slaves)
"Ubuntu" the distro now replaces the GNU components inherited from Debian with a bunch of Microsoft GitHub (proprietary) things that reject reciprocal licences
Last Night The Register MS Published a Fake Article. It Mentioned "AI" 27 Times.
Paid-for nonsense! [...] What's left of once-respectable news sites actively harms society
Links 27/03/2026: Google Executive (GAFAM, US, Surveillance) "Named the New BBC Head", Prominent Climate Scientist Resigns From NASA
Links for the day
Gemini Links 27/03/2026: "Being Busy" and "Posting Again"
Links for the day
GNOME Has No "Real" Executive Director, Only an IBM (Perma)'Interim' One With No Openings in Sight
GNOME is having financial problems
Microsoft Experiencing "Leadership Exodus"
Microsoft's current position is no better than Meta's (Facebook)
GNU/Linux Distros Should Reject "Age Verification" and Uphold Software Freedom for Users
It's not about protecting children
Slop Plunge
we can already "smell the blood" of the so-called 'AI industry'
IBM Media Puff Pieces While Layoffs Go On and On
Has the PR industry absorbed the press?
Media Says Microsoft Hiring Freezes, But There Are Already Microsoft Layoffs
They want the public to talk about Microsoft as if it's just not hiring when it is actually firing
Richard Stallman lynchings: Sruthi Chandran splitting Debian
Reprinted with permission from Daniel Pocock
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, March 26, 2026
IRC logs for Thursday, March 26, 2026