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

Mass Layoffs in Starbucks... and Society Loses Nothing of Value
Society might even be better off if Starbucks shuts down entirely
Matthew J. Garrett Behaved in a Similar Fashion to 4Chan and Kiwi Farms
Opposites attract? Are they opposites at all?
Drew DeVault Suggests "CoC Enhancement", Starts Trolling Projects in Microsoft GitHub
And it backfires immediately
 
Repeating the Lies to Promote a Ponzi Scheme is Not OK Because "Many Other Sites Do This" (Including Slopfarms)
They already work on the next Ponzi scheme
The Register MS (Situation Publishing) is Participating in a Ponzi Scheme
The market in "tech" seems awful when a lot of it sells a fraud and journalism about this market is part of the fraud
Glimmer of Hope: More People Realise and Come to Accept "AI" is Just a Giant, Elaborate Ponzi/Pyramid Scheme That Will Leave Everyone Worse Off (Except the "Top of the Pyramid")
quoting Einhorn and some comments
Do Your Job and Demand Your Compensation - But in That Order.
We'll do our best to convince the Judge to award all costs to us (lawyers, barrister, LIP bills etc.) plus judgements against them, for abusive litigation and needless suffering associated with that abuse
Like Nazi Germany and Volkswagen
Tell us all about "freedom" when your government runs a Ponzi scheme
Microsoft Sponsored This Man, Microsoft Sponsored His Behaviour (and He Controls Microsoft)
They get what they paid for
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, September 26, 2025
IRC logs for Friday, September 26, 2025
He Talks Too Much, He Says Dumb Things
only British when that suits him
Slopwatch: FUD and Plagiarism (Working Against Linux) Promoted and Rewarded by Google News
Shame on Google News
Reminder: We're Unloading Some Publications to Tux Machines
About 15 years ago I was struggling to keep up with TechDirt
The E-mail Protocol is for Text
bad netiquette
Gemini Links 26/09/2025: Slop in OpenStreetMap and MOPML (My Own Private Markup Language)
Links for the day
Links 26/09/2025: More Provocations Against NATO by Russia (Near Alaska, USA), Microsoft Booster Accenture Has Mass Layoffs
Links for the day
Links 26/09/2025: Hardware, Security, Health, and Nuclear Armament
Links for the day
Links 26/09/2025: "Digital Fatigue" and Slop Frenzy (Hype) Ruining Work Productivity, Culture, Languages
Links for the day
Brett Wilson LLP Unwilling to Disclose or Explain How 'Hulk Hogan of UEFI' Pays for His SLAPPs Against Us (He Cannot Afford These), So We Are Escalating
Escalated in the British authorities
What 'Hulk Hogan of UEFI' Could Learn From Jimmy Kimmel About the 'Streisand Effect'
Lawyering up is risky and is usually doesn't work
Linux is Replacing Apple
Apple is money down the drain. Not only are the gadgets overpriced; they cost a lot to maintain and keep going over time
"We don't have that kind of relationship with Microsoft. The only public key that every UEFI firmware is guaranteed to have is Microsoft's, and only Microsoft owns the private key."
This is how to sabotage GNU/Linux distros that Microsoft does not control
Slopwatch: linuxconfig.org, linuxsecurity.com, and Google's Promotion of the Worst and Most Prolific Slopfarms
Over in Google News it has been quite chaotic this past day
Gemini Links 26/09/2025: Reading RSS Feeds, ROOPHLOCH 202
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, September 25, 2025
IRC logs for Thursday, September 25, 2025
Links 25/09/2025: More European Airports Shut Down Due to What Seems Like Russian Drones
Links for the day
Gemini Links 25/09/2025: Amiga Revived and Hackers (UTF-8)
Links for the day
Purchasing Concert Tickets in 2025 in Manchester: The "Modern" Experience
I recently spent a couple of days here testing the "terrain" in order to better understand how large public venues, for concerts rather than sporting events like football, currently "work"
Links 25/09/2025: French Unions Want Another Strike, Super Typhoon Ragasa Kills Many
Links for the day
Microsoft 'Secure Boot' and Shim as Barrier or Obstacle to New GNU/Linux Users Trying to Escape Microsoft
Just as intended all along
Lovers and Haters
Always beware hate preachers and demagogues (or how they frame issues or whose fault they distract from)
Focusing on What People Have in Common Instead of Killing and Cancelling One Another
Men and women of both "wings" stand to gain a lot by working together on common interests
'Cancel Culture' Isn't About Enforcing Ethics (and It's Done by People on the Right, Not "The Leftists")
Smarter folks would leave social control media
Russia's Attack on Europe (and NATO) Will Worsen Censorship and Corruption in Europe
Can we still debate issues that predate the invasion of Crimea?
Lawyers Should Permanently Lose Their Licence (and Worse) for Using Chatbots in Legal Work
They not only waste people's money and time. They pollute the literature with falsehoods. They commit perjury. [...] Brett Wilson LLP sent the Judge nearly 1,000 pages of material (mostly mine, copied without proper permission) shortly before a short Hearing, which lasted less than an hour
GAFAM and MATA (Mythical, Metaphor) as Explained by analognowhere.com
They're instruments of suppression that sponsor the oppressor
We've Already Mentioned Who Nowadays Funds Garrett's SLAPP Against Us (Not Garrett), Let's Examine Who Sponsored His Litigation Partner (Other Than Microsoft Salaries There's a Buddy of Bill Gates)
it's alleged that the Serial Strangler from Microsoft got money from him
Florian Müller: Using Software Patents to Attack Software Developers, Agitate Against Patent Reform
He also promotes attacks on the German Constitution and laws
Reliance on Typepad Seems to Have Doomed the Voice of Software Patents and Patent Maximalists in PatentDocs
Follow the money
UEFI 'Secure Boot' is Potential Mayhem to the Environment (Older and Leaner Distros Stop Working)
creating new problems, disguised as "solutions" to problems that do not exist
Sometimes 'Cancel Culture' Backfires Badly
There's no such thing as "too much" coverage
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, September 24, 2025
IRC logs for Wednesday, September 24, 2025
Links 25/09/2025: Jimmy Kimmel Returns to Air (With Limitations) and London Stansted Airport Latest to Have Incident (Fire)
Links for the day
Slopwatch: Fake Articles, SPAM With Slop, and Google News Directs People to Read Slopfarms
why does Google News insist on still linking to prolific slopfarms?
Gemini Links 25/09/2025: New Game for Gemini Protocol, Eleven, and Network Solutions Woes
Links for the day