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

The Register MS Takes More Money to Boost Slop Hype, This Time From Snyk, a Notorious FUD Source
At some stage or at some point they might even decide to stop doing so
"AI" Hype or LLM Slop is Not About Efficiency, It's About Lowering Standards
It does not seem like IBM is genuinely committed to the same goals (or commitments) as the original Red Hat
If Free/Libre Software is Adding Trillions in Value to the European Economy, Then the European Commission Must Crush Software Patents
Further to what we wrote yesterday
Over at Tux Machines...
GNU/Linux news for the past day
 
Hopping From One Set of Buzzwords to the Next
Rotating hype and vapourware
Currys PCWorld Hates GNU/Linux Even Though It Runs the World
If more and more people choose to remove Windows, then Currys PCWorld will feel the financial impact of its dumb policies
Internet Relay Chat and Gemini Protocol Help Us Relive the Net of the Dial-Up Era
The kids were alright
"GPT-5" is Another Microsoft Dead Cat Trying to Bounce
The hype, the momentum (or the inertia) is wearing off
Microsoft Windows Losing Its Grip Near Turkey and Russia
The 'corridor' nations connecting Iran to Europe
Slopwatch: LinuxSecurity, Google News, and Serial Slopper (SS)
The slop, the bad, and the ugly
Links 13/08/2025: The “Incriminating Video” Scam and Corruption in South Korea
Links for the day
Gemini Links 13/08/2025: Movie Memories and Mystery Machine Bus
Links for the day
Links 13/08/2025: GitHub Trouble and Openwashing by Microsoft OSI With the Typical Buzzwords
Links for the day
Microsoft Swallows GitHub Losses
Only Microsoft knows how much money it has already lost on GitHub
Gemini Links 13/08/2025: Climate, Coffee, and Deploying Troops in Washington DC After Pardoning 1,000+ Insurrectionists in Washington DC
Links for the day
The Register MS Lowered MS Focus This Week
We hope The Register recognises its errors and tries to make up for them
Learning Ethics From Jeffrey Epstein's Enabler/Client/Ally, Coca-Cola, and Microsoft Accenture
Whatever merits vocabulary changes initially had are being tainted or obscured by later iterations, which tell us to avoid word like "normal", which apparently offend some people (so they argue)
Personal Attacks From Rust People Serve to Confirm They Have Lost the Argument
"The discussion I find around the net so far has no technical merit and centers around ad hominem"
Physical Meters and Purely Mechanical Meters Aren't Dumb; It's Dumb to Mock or Dismiss Them as Antiquated
I've learned a lot this week, both online and over the telephone
IRC Proceedings: Tuesday, August 12, 2025
IRC logs for Tuesday, August 12, 2025
GitHub Will End Up like XBox and Skype
It is not likely that the XBox franchise will survive the next 5 years
Stones Thrown in Glass Houses
Projecting? You bet!
As Europe Gets Increasingly Serious About Software Freedom and Digital Sovereignty It Needs to Enforce a Ban on Software Patents ASAP
many councils in Europe move to Free software and US policy/companies cannot be trusted
Windows 12 in Bahrain (Microsoft "Market Share" Down to 12%, an All-Time Low)
They really ought to get away from Windows even faster
The Web Needs 'Pest Control' When It Comes to LLM Slopfarms
The goal is to discourage more sites becoming slopfarms
Microsoft Can Now Stop Reporting the GitHub Layoffs (Even When They Happen)
GitHub's original staff will see the true cost of becoming "b0rged" - something that Microsoft earned a bad reputation for
How to Get Very Bad or Even Malicious Code Into Linux? Write it in a Language That Linus Torvalds and Most Other Linux Developers Don't Understand.
One point nobody brings up is, what if code gets committed while evading audits and scrutiny?
Links 12/08/2025: Wikipedia Fails at UK High Court, Perlmutter Still Fights to Squash the Slop Lobby
Links for the day
Gemini Links 12/08/2025: Field Recording and Digital Legacy
Links for the day
Links 12/08/2025: WinRAR Zero-Day, SonicWall Does More Harm Than Good
Links for the day
Links 12/08/2025: More Sabotage of Underwater Cable Ahead of Russian Alaska Summit
Links for the day
Richard Stallman Will Not Miss Microsoft GitHub, It Was Only Good at Harvesting a Lot of Code for Plagiarism-as-a-Service
investors are apparently willing to lose money for buzzwords
Slopfarms Slopping Away at "Linux" and Spreading Microsoft Misinformation
Slopfarms don't comprehend this as they lack actual comprehension, they're just parrots
Links 12/08/2025: Science, Hardware, and Ukraine Excluded From Negotiations About Its Future
Links for the day
GitHub the Company Has, in Effect, Just Died (Time to Look for Alternatives)
To Microsoft, what's left of GitHub after dismantling/folding it is some "training set" (people's code, without permission to "train" i.e. misuse under the guise of "GenAI" plagiarism)
Linux Foundation Says "Housekeeping", "Hung", "Normal", "Native Feature/Support" and "Girl/Girls" Are Offensive Words
Bombing people is OK, just use the right "terms"
It Looks More Like Microsoft GitHub Layoffs
GitHub is just losing loads of money
Gemini Links 12/08/2025: Meditation, OpenStreetMap, Smolweb, and More
Links for the day
Google News is Dying: Most of Its Top Stories Now Are LLM Slop With Slop Images (i.e. 100% Fake 'Content')
Google News has been drowning in this sort of stuff for quite some time
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, August 11, 2025
IRC logs for Monday, August 11, 2025
Our Predictions Were Right: GitHub Dying as Losses Pile Up (as a Company It Cannot Continue to Exist, It's Not 'Free Hosting')
GitHub always lost money
Links 11/08/2025: Meritless Twitter Suspensions and Disney Scraps Deepfake Dwayne Johnson
Links for the day
Gemini Links 11/08/2025: Upgrading Debian Bookworm and Better Quality PDFs From Gemini Pages
Links for the day
Currys PCWorld Lied a Decade Ago, 10 Years Later It Still Effectively Voids Your Warranty for Installing GNU/Linux Despite It Being Increasingly Mainstream
Microsoft gatekeepers
Team GNOME Has Libeled Me for Nearly 20 Years
we are not dealing with sane people
Experience With Airlines in 'Web Sites' and in 'Apps'
In a lot of ways, Stallman Was Right about what JavaScript would turn out to be
Open Does Not Mean Free
wiser to ask if some program is freedom-respecting
The Register MS Takes Money From Companies Banned by the Biden and Trump Administrations (National Security Risk)
today's sponsor
Sabotaging GNU/Linux PCs (and Users) is Not a 'Joke'
maybe cruelty is the very objective
How We Process Screenshots of Slop to Suitably Tag Them as Slop
everything is a single command
Links 11/08/2025: Data Breaches, Politics, and Climate
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, August 10, 2025
IRC logs for Sunday, August 10, 2025
Gemini Links 11/08/2025: Tea Caffeine Hot and Super ZZ Zero
Links for the day