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

Evri (HermesUK) is Now Run by Bots and Hallucinating Scammers
Years ago they virtually removed support and tried chatbots instead
Clown Storage Without Backups
Setting up several reliable copies of the data, plus several off-site backups (this data is nowhere as sensitive as medical data), should only cost a few grand
FreeCAD is Becoming Slop-ware, Use LibreCAD Instead
It has regular releases and "Qt5 is mandatory" now [...] they at least audit what they add
 
GNU/Linux in Ecuador and Colombia: Growing, Still Below International Average
locals turn away from Windows and try GNU/Linux instead
IBM is Dead or Dying. Now It Asks Workers to 'Resign' Voluntarily.
To save face, to pretend no layoffs are happening (as it might alarm shareholders) [...] We keep hearing more and more stories like that
Links 18/08/2026: Sergey Brin Controlling State Policies, "Dario Amodei's (Anthropic) Wife Is Closely Linked to Jeffrey Epstein"
Links for the day
SBS News Interviews Daniel Pocock
The locals say this PR stunt (by the bigot, Farage) was a waste of money
Clownflare Sees One in 7 Web Requests in Libya Originating From GNU/Linux
GNU/Linux has taken a (foot)hold there
Openwashing and Manifestos Composed in Private by Dictators With Deliberately Addictive (and Subsidised, Bundled) 'Tech'
It's long, so make a cuppa first
SLAPP Censorship - Part 153 Out of 200: Decades of Debt, Weaponising Borrowed Money to Try to Put Their Critics in Debt
they've always had a financial report by now
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, August 17, 2026
IRC logs for Monday, August 17, 2026
Gemini Links 18/08/2026: Solar Power, Kipple and Impermanence, Catastrophe Ethics
Links for the day
Less Technology, More Life
Technology is being associated (sometimes rightly) with physical and mental problems
Google Search Has Gotten Worse (a Lot Worse)
getting worse
Birthday in 80 Days
we'll start decorating and party online with our community
Loans and Massive Debt at Microsoft, This Won't End Well.
Microsoft running out of money to pay salaries (to the point of paying people for 'voluntary' layoffs) is a positive sign?
Gemini Links 17/08/2026: Life in Plain Text, Mimicking KARL, Release of Jugulans, Avoiding Slop
Links for the day
Cuba and Venezuela High in Adoption of GNU/Linux
some of the "communist" nations
Links 17/08/2026: Myanmar’s Cholera Outbreak, China Sends Commercial Vessels Through Arctic
Links for the day
GAFAM Loyalty Has Come to an End, Morale Low, People Whose Future is Uncertain Choose to Become "Lifers"
morale is low and there's no loyalty anymore
SLAPP Censorship - Part 152 Out of 200: Injunctions Do Not Cover Criticism, They Have Scope
self-incriminating communications
Clownflare Sees About Quarter of Web Requests in Ireland Coming From GNU/Linux
Well, in Ireland it seems like many people adopted GNU/Linux
Clownflare: In Australia and New Zealand GNU/Linux Peaks at Over 10% During Working Hours
That right there is interesting in its own right
Slowing Down by Intention
At the moment we have 6 or 7 ongoing series
Gemini Links 17/08/2026: Chamboree, Partial Solar Eclipse, Lady Macbeth
Links for the day
Links 17/08/2026: "Bluesky Is Down Again!" and "Anti-Social Media"
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, August 16, 2026
IRC logs for Sunday, August 16, 2026
A Vortex of Beacons (or "Bluetooth Everywhere" Vision)
If someone (or someones) calls you paranoid for taking about "beacon"-like functionality, there will be no lack of authoritative citations (e.g. Web links) they can be provided to prove them wrong
Falkland Islands: GNU/Linux Elevated to 6%
GNU/Linux usage seems to have increased a lot there
Links 16/08/2026: Reading Outside, Going Offline More, and Art of Computer Programming
Links for the day
The Question of Patience
Is there a lesson here somewhere?
IBM May be Sued for Mass Layoffs Via PIPs
Some whole threads (with all the long comments in them) recently got nuked by thelayoff.com
Links 16/08/2026: Ceuta Reports Social Control Media Used as a Weapon
Links for the day
Links 16/08/2026: Europe in Crisis of Droughts While Energy- and Water-Consuming, Pollution-Emitting Chatbots Are Spread by GAFAM (US) to Keep a Ponzi Scheme Going
Links for the day
GNU/Linux is a Platform for Work (Usage Surges in Daytime)
GNU/Linux 15% in daytime
We Need Rain, Not Chatbots
There's no "anti-AI" (it's not even AI), there's opposition to fraud, to plagiarism, and to companies that profit more when there's global warning (caused in part by their business activities)
SLAPP Censorship - Part 151 Out of 200: Dealing With Sleazy People and Companies That Steal (While Employing These Sleazy People)
we offer a quick summary and we're reflecting
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, August 15, 2026
IRC logs for Saturday, August 15, 2026
Gemini Links 16/08/2026: Sterrenkijker Releases, Solar Gemini Server
Links for the day