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

Microsoft Sort of Tried to Sell XBox Piecewise (Offloading Microsoft)
XBox is in a morbid state
Linux is Not Controlled by Linus (Torvalds)
Torvalds has become "90% marketing hype"
 
Intercontinental Brigading - Part XIV - Six Years of Learning Irish, But the Real Issue Was Microsoft-controlled 'Secure' (Restricted) Boot
Had I not opposed back doors in Linux, not of this would come about
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, October 24, 2026
IRC logs for Saturday, October 24, 2026
Gemini Links 24/10/2026: Arch Linux Journey and Amin Bandali's Priorities
Links for the day
Bluewashing as a Form of Silent Layoffs
IBM will continue to shed off loads of workers while its debt climbs
Turning 20 in 2 Weeks and Upcoming Network Maintenance
That ought not interrupt our anniversary
Microsoft Shutdowns Accelerating, More Shutdowns Revealed (Not Connected to Gaming)
Silent layoffs disguised as "voluntary" "exits"
Links 24/10/2026: Microsoft Blackmail and Lingering Unrest in France:
Links for the day
Gemini Links 24/10/2026: From Bendigo to Kerang, Enshittification of Radio and Music in the UK
Links for the day
Red Hat Sinks With the Blue (IBM) Ship
As IBM's debt continues to soar so do the silent layoffs
The "No Pain No Gain" Expectations in Publishing
Sometimes truth hurts; but that does not mean it mustn't be told
Intercontinental Brigading - Part XIII - Censorship by All Means Available in a Continent So Far Away, as 'Secure' (Restricted, Restriction by Microsoft) Boot Has a Crisis of Legitimacy
it's about America controlling sites and computers everywhere
Links 24/10/2026: Oligarchs Already Buy US Elections, GAFAM Front Group "EFF" Speaks of "Vulnerability Apocalypse"
Links for the day
Gemini Links 24/10/2026: Automobile Differential Tire Movement, Samsung Washer Woe, and Slop Scraping
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, October 23, 2026
IRC logs for Friday, October 23, 2026
As Usual, Late on a Friday XBox (Microsoft) Releases Evidence of Its Demise
We covered several such Friday announcements earlier this year
Gemini Links 24/10/2026: Break/Fix and OpenStreetMap
Links for the day
Links 23/10/2026: Slop "is Scaling Transnational Repression" and Infringement and DMCA Suits Against Suno/Anthropic (Plagiarism Blenders)
Links for the day
More Shutdowns at Microsoft, Hundreds of Workers Impacted Shortly
It's not the entire wave, just part of it
The Register MS: About 60 Mentions of "AI" in One Day Are Paid-for Spam (Sponsored Hype, Composed by the Companies Covered)
The Register MS is a dying site
Links 22/10/2026: MElon (Elon Musk) Election Interference and Perl/Raku Foundation by the Numbers
Links for the day
Techrights Audience Grew as a Function of the Intensity of Attacks on Its Existence
We try to publish fewer stories but better (not necessarily long but at least important) stories
TechRepublic is Becoming a Slopfarm
It seems like TechRepublic became LLM slop (maybe all of it, maybe only some of it for now)
Techrights is Not About GNU/Linux, Tux Machines Is
When we say "GNU/Linux" we emphasise the GNU
The World Needs Activists With Social Skills and Perseverance
An everyday activist makes life better for everybody, everywhere (not for personal gain or even credit)
Intercontinental Brigading - Part XII - Lawfare to Cover Up Microsoft's Restricted Boot Calamity (Microsoft as Authority Over Linux), Garrett Wants to Talk About Penises Instead
When lawsuits become a political weapon
Without Microsoft's Monopoly (and Monopoly Rents) the Inevitable Microsoft Mass Layoffs Carry on Endlessly
Microsoft Windows is not retaining the dominance it once had
IBM's Debt Grew About $2 Billion in 3 Months
The silent layoffs still seem to impact Red Hat
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, October 22, 2026
IRC logs for Thursday, October 22, 2026