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

CDMAG Covers Free Software, New Magazine From Decent People
If enough people accessed their site, they would not rely on social control media (third parties, censorship platforms)
Brigading Against Women - Part XI - An Abject Lack of Social Skills (and Not Knowing How to Handle Women)
GGG enjoy - if that's the right term - very bizarre or esoteric sex life
EPO Will Stop Working for 10 Days to Protest Against 'Cocaine King' and His Assault on Democracy, Lawfulness, Transfer of Power at EPO
Strikes, work stoppage, all rolled onto one
Techrights is International
There are many sites that focus on local communities or nations. We're not one of those sites.
Brigading Against Women - Part X - When Actions of American Men Are Not Judged by Other American Men
"There is not the slightest suggestion that either Dr or Mrs Schestowitz did anything to invite or deserve it. They are both clearly and justifiably angered, dismayed, distressed and hurt by it."
 
The Microsoft Lunduke Slop Problem
Microsoft Lunduke does not support Software Freedom; he serves to discredit many ideas championed by Free software or ideals articulated which are apolitical for the most part
Links 30/09/2026: "Understanding the LLM Bubble" and "Florida Senate Threatened Legal Action Against Newspapers"
Links for the day
It Looks Like Mass Layoffs at "Nordcloud, an IBM Company" Today (a Day Ahead of Red Hat)
Expect the same from Red Hat next
British Prime Minister Recognises Social Control Media as National Cohesion Problem
one has to wonder if addiction to social control media is not compatible with peace
The Future Isn't Social Control Media (Nothing Will be Left of It, Not Even Archives)
"Error code: 502 Bad Gateway"
GNU/Linux Usage in China is Increasing
China is leaving Microsoft and Windows behind
43 Years of GNU and GAFAM's (Especially Microsoft's) Attacks On It
GNU is very widely used (when people say "Linux commands" they typically mean "GNU programs"), hence it's being attacked a lot
Gemini Links 30/09/2026: Accelerationism, "The Billionaire is Wrong", Rant About LLM-generated Support E-mails
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, September 29, 2026
IRC logs for Tuesday, September 29, 2026
Black Brit on "Pictures Comparing Me to a Monkey" Because of Brett Wilson LLP Client
"Like Firm, Like Clients..."
President of the EPO Should be Kicked Out, Not Have His Term Terminated in 2028
The President is facing more scandals soon
David Gordon at The Register MS Keeps Feeding the Pyramid Scheme With Fake Articles That Say "AI" Dozens of Times
How can such a publisher still be taken seriously?
The Local Staff Committee The Hague (LSCTH) at the EPO Explains the Working Conditions and Crisis of Plunder (Less for Workers, a Lot More for Dictators Who Refuse to Leave Leadership Roles)
Next week will be epic
IBM Brings Avalanche to Red Hat October 1st 2026 (Thursday)
IBM is turning up the heat on staff
Links 29/09/2026: Mass Layoffs at Microsoft and Backlash Over Data Center Policy of Microsoft
Links for the day
5 Years Ago (September 29, 2021) Richard Stallman's Talk in Ukraine Noted
Let's hope the war will end soon
Links 29/09/2026: Acceleration, Morale, and ROOPHLOCH 2026
Links for the day
Links 29/09/2026: "Scam Altman Is Driving Drunk" and Anthropic Lies About Slop Usage
Links for the day
European Patent Office (EPO) Series: A Source of Pride for Portugal?
In this part our focus returns to the main theme of this series, namely the current reappointment campaign of the EPO President, as we consider whether Campinos can still expect to enjoy the same level of support from the Portuguese political establishment as he did during the earlier stages of his career
Computers Freeze Because of UEFI Restricted Boot
damage is also done to computers running Windows
It is Very Expensive to Slow Down Techrights
Garrett's expensive hearing (costing the British taxpayers about 120,000 pounds; he doesn't live here and does not pay tax here) slowed us down for a few days, but we've picked up the pace since
Linux Has Conquered Mobile, But Desktops and Laptops Matter More
When people say the desktop "doesn't matter" they seem to be missing the point that workplaces use desktops (or laptops) and a lot of the work gets done not on skinnerboxes but "workstations" or terminals
Brigading Against Women - Part IX - "What Are You, a Racist?"
Because behind every strong man is a strong opinion?
Gemini Links 29/09/2026: "Digital Sabbath", Starting a GemCapsule, and Sterrenkijker 1.1.0
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, September 28, 2026
IRC logs for Monday, September 28, 2026
Brigading Against Women - Part VIII - Misogyny Embedded; Like Firm, Like Clients
It's about back doors
Chaos Imminent at Red Hat (This Week)
IBM is 'finishing the job' an ex-IBMer (Ron Hovsepian) did at Novell.
Microsoft Can PIP Workers (Silent Layoffs) Until Almost Nobody is Left
Microsoft is gradually vanishing
The Cyber Show Says Truth Always Requires a Fight, a Struggle
"Truth-tellers always face struggle and run risk"
Maladministration at the EPO as a Crisis for the EU and for Portugal's Image in Europe
Some time soon we'll publish a long article about what EPO leadership means to Portugal
3 Years of UK Hosting
We commend the webhost for standing firm in the face of misogyny
Tech Labeled "Smart" Does Not Make People Smart
People who insist on making everything digital are not advancing progress
Gemini Links 28/09/2026: Truncated Sleep, Plain Text, and Slop Problem Kept Out of Geminispace
Links for the day
Links 28/09/2026: "A Growing North Korea Problem" and Independent Journalism as a Lifeline
Links for the day
Links 28/09/2026: Microsoft Chatbot "Giving Extremely Specific Advice to a School Shooter on How to Maximize Casualties", ‘Suicidal Empathy’
Links for the day
Microsoft's Attacks on Courts in the Netherlands Result in GNU/Linux Growing to About 10% There
One core issue that justified this and led to this outcome is Microsoft's interference with the administration of justice
They Create the Conditions for People to Leave, This Way They Don't Call it "Layoffs"
We keep seeing many stories like these
Gemini Links 28/09/2026: Wildfire, DOS, and Backups
Links for the day
Brigading Against Women - Part VII - 'Trolling' Courts and Legal Systems in America and in the UK (Europe) Costs a Lot to Taxpayers
They only attend hearings after being arrested
European Patent Office (EPO) Series: The Portuguese Talent For Bureaucratic Empire Building
Portugal’s success in securing senior executive appointments at the EUIPO and the EPO is a notable example of how countries seek to strengthen their influence within European intergovernmental institutions
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, September 27, 2026
IRC logs for Sunday, September 27, 2026