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

IBM is Killing Red Hat's Portfolio - Including Linux - to Prop Up Ponzi Scheme ("AI")
IBM is killing Red Hat
Gemini Links 02/03/2026: Weird Phone Calls, Small Phones, and Exploring Racket
Links for the day
EPO "Cocaine Communication Manager" - Part V - Jobs at the EPO for Those Connected to Cocaine Addicts (Skills Not Required)
EPO management is trying to shoot the messenger
Teaser: The Next Series About the SRA, Which Would be Just as Effective as It Is Right Now If It Had Zero Employees
the lapdog (of the "litigation industry") that is meant to be perceived as a watchdog
Solicitors Regulation Authority (SRA) Inaction and Incompetence - Part I - Introduction
The SRA is a sham. Many people know this already, but we want to document our own experiences with it.
Live Simply, Live Better
Life isn't about "collecting" possessions; it's about doing things that matter and accumulating knowledge so as to make better choices
Now That XBox is Pretty Much Dead and There Are Mass Layoffs at Microsoft
This means our predictions about Microsoft (and XBox) are "falling into place"
 
Microsoft FUD From Microsoft Site Helps Distract From Actual Microsoft Back Doors
Published on a Sunday
Free Software Foundation Needs to Become More Active in Europe to Avoid Impersonation by Microsoft-Sponsored Groups
So far we've hardly seen the FSF saying anything at all about the US president
Links 02/03/2026: "Not Envious of Billionaires" and Palantir SLAPPs "Swiss Magazine For Accurately Reporting That The Swiss Government Didn't Want Palantir"
Links for the day
There Has Never Been a Better Time to Quit Social Control Media
Those networks are selling something. And that something is not peace because peace does not sell "attention".
Microsoft Users Drowning in Slop, If They Complain Microsoft Censors Them
Like an authoritarian regime
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, March 01, 2026
IRC logs for Sunday, March 01, 2026
Speed of Sites Matters
Being easily accessible all the time matters to us
Dr. Andy Farnell on "Good Tech"
in the age of "rent everything" and "own nothing"
Gemini Links 01/03/2026: Simpler Software and Announcing OFFLFIRSOCH (OFFLine-FIRst SOftware CHallenge) 2026
Links for the day
Booz Allen Hamilton, the Former Employer of Edward Snowden (NSA Contractor), is Drowning in Debt
Can Supreme Leader Cheeto bail it out like he does slop companies?
On the Concept of "Protected Class" (or Race) at IBM
It's self-harming as in practice it imperils the company and harms the reputation/brand
The Mass Layoffs at Microsoft That Nobody in the "News Industry" Wants to Talk About (and TheLayoff.com Censored, Then It Censored the Evidence of the Censorship)
They basically cover up how they censored the news about Microsoft layoffs
Richard Stallman to Give at Least Three Talks in Switzerland, Starting This Week
No mention (yet) of the Bern talk
On Who 'Speaks for' Techrights
typically a case of misrepresenting the site
'FSFE' an Imposter in Europe, Paid by GAFAM to Represent GAFAM Interests
The Microsoft-sponsored 'FSFE', which violates the terms of use of its name, is causing confusion [...] formally-recognised institutions got tricked into thinking that the Microsoft-sponsored 'FSFE' is the FSF
Lots of Lies From the Slop Industry
The slop industry relies on fake news to give a notion or fake demand
Links 01/03/2026: American Plutocrats Buy American Media While American Constitution Shredded
Links for the day
Gemini Links 01/03/2026: "In the Spirit of OFFLFIRSOCH" and "Delete Patreon"
Links for the day
ACM Lowers Its Standards for Age of Autocracy
IBM is more than happy to work with autocracies
The term FUD (fear, uncertainty, doubt) was created to describe IBM's tactics and IBM is doing it again
Rob Thomas or "RT"
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, February 28, 2026
IRC logs for Saturday, February 28, 2026
Slop is Distraction
LibreWolf will never include any of this slop nonsense, no matter if toggled on or off
Cult inquiry: Parliament of Victoria, last chance to have your say
Reprinted with permission from Daniel Pocock
Internet Relay Chat (IRC) Turns 37.5
Can IRC reach age 75?
Gemini Links 28/02/2026: Loadbars 0.13.0, IME (Input Method Editor), and ColorColumn in Vim
Links for the day
Two EPO Strikes in March (Maybe More)
As per the SUEPO diary [...] We still have an ongoing series about the EPO, with several more series to start later
Why We Are Concerned About the SRA's Failure and What That Means to the Profession of Lawyers in the UK
Unregulated industries will lose their credibility as there is a threat of growing perception that they operate outside the law rather than practice law
Over 10,000 Pages/Articles Per Year?
Probably my most productive month, ever
Keeping Techrights Online 99.99% of the Time
Some time later this year we'll tell a very long story about how extremists attacked our webhosts
Richard Stallman, Founder of the Free Software Movement, Will be Giving Public Talk in Bern (Switzerland) in Less Than 12 Days
We are still doing a series about him and his talks
Still Lots of IBM Departures
It's not that we lack evidence of IBM layoffs. It's just that we have ample evidence of the press not doing its job (or barely existing anymore).
The Register MS Standards: Promote a Ponzi Scheme in Exchange of Money
Once upon a time it was a serious publisher. Months ago it was taken over by a Microsoft person.
Slopfarms' Demise Looks Like the Beginning of the End (Lowered Demand for Slop)
Slop about "Linux" has gotten hard to find this past week
Dr. Andy Farnell: Time to Pull the Plug?
insightful, as usual
Links 28/02/2026: "Tehran’s Two-Tiered Internet", "Internet Under Fire"
Links for the day
When an Entire News Site is About One Topic (and One Topic Only)
Tomorrow we start a new series for the new month
Links 28/02/2026: Bill Epsteingate Admits Sex With Young Girls, "Epstein Files Are the Horror That Keeps on Giving"
Links for the day
IBM: Where Companies Come to Perish
thelayoff.com is censoring stories
Tech Layoffs Are Not Because of Slop, They're an Effect of a Rotting Economy and Tech Giants Being Too Deep in Debt
Block is rapidly sinking in debt
The Slopfarms' Business Case (or Business Model) Never Existed and Nowadays, in 2026, They've Mostly Collapsed
Hopefully by year's end many slop suppliers will be offline and slopfarms that rely on them throw in the towel
March in London Today Against Slop's Harms to Society (and the Environment), Starting at 12:00 GMT at the Microsoft OpenAI Office
Today there is a protest in London (UK)
Microsoft Mass Layoffs Have Officially Resumed, Microsoft's Waggener Edstrom/Frank Shaw Lied
"The former employees say this was a mass layoff"
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, February 27, 2026
IRC logs for Friday, February 27, 2026