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

European Patent Office (EPO) Series: London Calling...
EPO Vice-President in charge of the "Patent Granting Process" is likely to have been a pay-off for the support which the UK gave to Campinos in 2017
Faking Productivity With Slop and Wasting Money on Faking 'Productivity': A Microsoft Story
If the quality of everything at Microsoft goes down
Wikipedia - Like Some Free Software Projects Infiltrated and Bribed - Bans Its Own Founder
Over the years we've named (not shamed) some projects and organisations that got corrupted by money and ended up banning their own founders
The “Aktion T4” at the European Patent Office (EPO) Saves Money for the President's Own Purse
Call for parents of children with special needs
SLAPP Censorship - Part 116 Out of 200: 5 Years of Multiparty Lawfare Against Techrights, Funded by Americans and Also by Third Parties (Including Microsoft Salaries)
The public and our government will be informed in full
 
While Thousands at IBM Lose Their Jobs ("Silent Layoffs") IBM's CEO Goes Begging the Dictator for Bailouts, Based on Deliberate Lies About "Quantum"
Many who claim to be retiring are only in their 40s and 50s. They're too proud to publicly admit what IBM did to them.
IBM Sends Workers 'Packing', Sometimes With the "Low Performer" Label That Imperils Their Future
To many people out there, IBM correlates with deceit
Links 24/06/2026: Four-Day Workweeks, GM Cut 1,000 Workers at Its EV Plant, 21,000+ Oracle Layoffs
Links for the day
A Step in the Right Direction (EU) in the Fight Against LLM Slop From GAFAM (US)
We've already mentioned this in Daily Links, but let's discuss this a little further
SLAPP Censorship - Part 117 Out of 200: Libel Tourism or Defamation Forum-Shopping in the United Kingdom Condemned by the European Union (EU)
Last week we reminded readers that the EU had criticised UK defamation law
Demonstration Next Week at the European Patent Office (EPO), Administrative Council Seen as Complicit
Corruption in Europe hurts all of us
IBM is Now Hinged on False Accounting and False Promises
This is the legacy of the current CEO
"PARTNER CONTENT" or 'Content Farms' That Promote Slop and Misinformation (The Register MS)
The Register MS represents a big part of the problem we all face
Turn Off the Slop, It's Wasting Energy and Destroying the Planet (the Only Planet We Have)
Right now we see lots of headlines about energy shortages and drained-up reserves
Lessons From Almost 30 Years of Site-Building Activities
We still strive to become faster and lighter
Do Not Outsource (the Seductive Mirage)
Abandoning so-called 'conventional wisdom'
Media Complicit in IBM Fraud Meant to Prop Up the Share Price Based on Lies, Fabrications
Even IBM insiders are fuming at this
In Some Countries, Windows Has Lost Its Monopoly
Windows fell to an all-time low globally this month
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, June 23, 2026
IRC logs for Tuesday, June 23, 2026
Gemini Links 24/06/2026: Motivation, PostScript Printer, and Why Hyperscalers and the Smolnet are Compatible
Links for the day
The Media's "Satya Says" Syndrome Distracts From Grim Reality
how insiders see Microsoft slop
Oracle's Collapse Has Nothing to do With Slop, It's About Its Debt Exploding by Almost 50% in Just 12 Months
How are people meant to trust the media?
Now... a Word From Our Sponsor
Powerade
Links 23/06/2026: Microsoft Studio Closures and Journalism Subjected to Further Cuts
Links for the day
Gemini Links 23/06/2026: Gardens, Basketball, Blocking Hyperscaler, and New Commodore Phone
Links for the day
Links 23/06/2026: Apple Price Hikes and Technical Debt in Slop
Links for the day
After IBM's Shares Collapsed the CEO is Trying the "Quantum" Trick Again, Bolstered by a Demented Dictator in the White House
from what we can gather IBM's CEO is trying to get the US government to participate in the scam
Greece Ought to Curb the Threat of Social Control Media
its national discourse seems to be run by an American company called Facebook
State of the GNU/Linux Desktop (and Laptop)
The time to advocate GNU/Linux is now
The 'XBox Narrative' Distracts From Destructive Cuts Across the Whole of Microsoft
Microsoft is preparing to lay off a likely record-breaking number of people [...] this isn't just an XBox problem
SLAPP Censorship - Part 115 Out of 200: Spending the Next Decade Writing About SLAPPs and Trying to Fix the System
It's the same industry that got paid by corrupt EPO officials to try to cover up the corruption
Microsoft's Stock Fell Nearly $200, But the Real Problems Are Just About to Begin
if they dump slop, what will they tell shareholders?
The Cyber Show on Starmer and Software Freedom
The Cyber Show's Andy has just explained why our departing national leader wasn't all bad
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, June 22, 2026
IRC logs for Monday, June 22, 2026
Gemini Links 23/06/2026: Girlrotting, Homeworlds at BGA, Slop Ruins Sites
Links for the day
A Lifetime of Whistleblowing
Ellsberg did not have an easy life, but it was a rewarding life with a rich legacy focusing on justice
European Patent Office (EPO) Series: A Man With Many Missions...
Campinos – accompanied by Gilles Requena and Patrice Pellegrino
Links 22/06/2026: Ubisoft Co-founder Dies, Americans Have Turned Against Slop
Links for the day
Links 22/06/2026: "The Sycophancy Machine" and "Port 22 Open for 54 Days"
Links for the day
When People Who Make the Most Money Are the Best "Boot Lickers" (Sucking Up to Jeffrey Epstein's Circle and the Dictator)
Sucking up to rich people may pay off
The Aim is Not Fame
Reposted from schestowitz.com
"Internally Important, Externally Irrelevant": IBM in a Nutshell
Right now its debt spins out of control and its stock spirals down the drain
SLAPP Censorship - Part 114 Out of 200: Thousands of Long Articles to Come, Properly Covering the SLAPP Industry in the UK and Its Modus Operandi
"Stowell described SLAPPs as ‘a stain on our legal system’."
Finding a Way to Get Paid to Improve LibreJS
So now we have more people resurrecting LibreJS and improving it
Microsoft Can't Even Wait Until July, Shutdowns and Layoffs Already Happening
Mashable speak of "a grim picture for the state of Xbox."
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, June 21, 2026
IRC logs for Sunday, June 21, 2026
Gemini Links 22/06/2026: Appreciating Simple Things, Perfect Summer Evening, IRIX, Vim and so
Links for the day