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

Rumour: After FSF Abandons Office in Boston LibrePlanet Will Also Leave Boston
In the past, Libreplanet (or LibrePlanet) was 'branched' out of MIT to "lesser" universities in the same city
linuxsecurity.com is 100% Slopfarm, Nonstop Fake 'Articles' About Security and "Linux"
More than one fake 'author' participates in this, so it deserves condemnation
Social Control Media as a Rapid Race to the Bottom - Part III - Foreign Interference and Chaff/Flare
Why would you trust alleged 'communication' (platforms) controlled by the same people who cut your undersea cables?
[Video] Richard Stallman Explains What Intelligence in Computing Really Means and How Old That Is (Story About 1975, 50 Years Ago)
Uploaded 11 hours ago by Manuel Cuda News
 
Microsoft Laid Off Several Thousands of Workers (Not Counting Those Driven Out) in 3+ Waves of Layoffs in 2 Months in 2025
About a thousand workers laid off per month
Microsoft Reduced to Almost Nothing in the Congos
Even worse for Microsoft in DRC (Democratic Republic Of The Congo)
Why We No Longer Hear About "Red Hat Layoffs"
Sometimes they don't call them "layoffs" are all; it's just PIPs, RTO, and "relocation" offers. They try to compel people to resign/retire
Reputation is Not a Human Right, It's Something One Earns
One can also lose one's reputation for harming women
FreeBSD Foundation is Trying to Improve "Laptop Support", But It Has Outsourced Everything to Microsoft Proprietary Software
Despite many valid alternatives existing and fast maturing
Links 06/03/2025: Discord Wants the Public to Pay for Losses, MongoDB Shares Collapse
Links for the day
Gemini Links 06/03/2025: Remaking Sites, Gemini Capsule Turns 5
Links for the day
Links 06/03/2025: Trade Wars, Trademarks, Attacks on (and by) the Media, Digg to Relaunch
Links for the day
The Fall of the Open Source Initiative (OSI): The Problems Are Much Bigger Than the Rigged Elections
It's not only about elections
Dr. Andy Farnell on Brutality and (or of) Brute-Force Computing
"Understandably, the ecological cost of compute was never really on the minds of pure computer scientists"
IBM Absorbs More of Red Hat and There Are Several Layoff Rumours
Those are just rumours for now
Gemini Links 06/03/2025: Digg, Project Failure, and More
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, March 05, 2025
IRC logs for Wednesday, March 05, 2025
Links 05/03/2025: Prioritising Science, Patents Squashed
Links for the day
Gemini Links 05/03/2025: News Processing, Misbehaving, and Git
Links for the day
GNU/Linux Cracking Past the 4% Barrier in Hungary
There are still quite a few very famous developers and Free software projects from Hungary
Meanwhile in the Matrix Room #dei:fedoraproject.org
Remember that IBM does a lot of perception manipulation
Rumour About Red Hat Layoffs Yesterday
Can somebody from Red Hat or someone who knows someone there (impacted or not) confirm that there are layoffs this week at Red Hat?
New Short Clip of Richard Stallman's Thoughts on the "Hey Hi" (AI) Hype, Courtesy of Manuel Cuda News
about 6 hrs ago
What is fixated behavior? Stalker or just a fan of Emma Raducanu?
Reprinted with permission from Daniel Pocock
In Iran, GNU/Linux Reaches New Highs, According to statCounter
Does that make sense? In light of geopolitics? Probably.
Always Safety First
We have some reasons to suspect that one of several parties (possibly not in the UK but having connections here), having suffered major and very expensive setbacks, may look to harm the messenger one way or another
Links 05/03/2025: Starbucks Debt Soars and CFO Changed, Apple Pretends to Value Privacy, "Cloudflare Blocking Privacy Focused Users From Accessing Third-Party Websites"
Links for the day
Canonical's Latest Love Letter to Microsoft (Ubuntu Promoting Proprietary Spyware With Back Doors)
Typical Canonical, promoting Microsoft (and sometimes Windows) instead of competing against them
What Microsoft and GitHub Really, Really, REALLY Do Not Want You to See or Know About
They're trying to misuse law in a completely different continent or to allege that reporting important facts is in breach of privacy law
Slopwatch: linuxsecurity.com and Other 'Linux' Sites With LLM Slop
SEO spam with machine-generated fodder, plus a person to whom English isn't a first language
GNU/Linux Climbs to Record Levels in Switzerland. Can the EU, Norway, the UK, and Switzerland Divorce GAFAM?
Germany openly speaks about becoming independent from the US. How about Switzerland?
Gemini Links 05/03/2025: Living in Interesting Times, Font, and Social Control Media with Gos v1.0.0
Links for the day
Just Because Common Currencies (Including the US Dollar) Are Considered Uncertain Doesn't Mean People Should Adopt Volatile Multi-Level (Pyramid) Schemes
the scammers are trying to "go mainstream"
Use RSS Readers Instead of Social Control Media
RSS readers were designed to save time. Social Control Media was designed to waste time.
The 'Windows Era' Already Came to an End
Microsoft said to shareholders everything would be alright because of "clown computing" and then "hey hi"
The Fall of the Open Source Initiative (OSI): Microsoft Committing the Largest GPL Violation in Human History, Then OSI Covering That Up on Microsoft's Payroll
LLMs don't make GPL violations any more noble or acceptable; it's not hard to see what OSI was paid by Microsoft for
Social Control Media as a Rapid Race to the Bottom - Part II - Think Before You Talk
The 'socmed' nonsense does not exist in our home
Links 04/03/2025: Hardware, Health, Data Breaches, Politics
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, March 04, 2025
IRC logs for Tuesday, March 04, 2025
Luxembourg: GNU/Linux at 8% Based on Estimates
steady increases this year
Gemini Links 04/03/2025: Bicycle, Photos, and Motorola 6809 Assemblers
Links for the day
Crossbow tragedy, bigger than Kyle Clifford, social media culture
Reprinted with permission from Daniel Pocock
Microsoft OSI Apparently Still Reading Techrights Closely, Trying to Make Face-Saving PR Moves
They have long had this reactionary rhythm, wherein it feels like we can 'control' what they publish and when by merely highlighting facts about them
Links 04/03/2025: Microsoft/Korea Game Industry Association Workforce Cuts, Outlook and 365 Outage Affects Very Many
Links for the day
Transcript of Richard Stallman's Interview With Manuel Cuda News in Italy (Debunking Fake "AI")
A rough draft, but checked by two people
Chad: All-Time Lows for Windows, According to statCounter
According to statCounter, many in Chad moved to Android
Links 04/03/2025: Universities Are Under Attack, Windows Attracts Ransom Against Ministry of Health
Links for the day
Microsoft Collapses While GNU/Linux Rises in Bulgaria, According to statCounter
Microsoft is losing across all sectors
The Fall of the Open Source Initiative (OSI): An Introduction
In a nutshell: there's a massive conflict inside the OSI and the OSI stooges (staff serving Big Sponsors like Microsoft) try to hide it
Paraguay: GNU/Linux Surging to New Usage Levels (7%), According to statCounter
Notice that the gains are at Microsoft Windows' expense
Social Control Media as a Rapid Race to the Bottom - Part I - That Sinking Feeling
When you realise you made an error and things you adopted more than 15 years ago became utterly bad
Microsoft's Entryism as Mortal Risk/Danger: The Example of the Open Source Initiative (OSI)
Microsoft is a cult
Links 04/03/2025: Microsoft Issues Policy Instructions to the Cheeto Mussolini Administration, Cloudflare Engages in Mass Censorship Again
Links for the day
Gemini Links 04/03/2025: Athens, Fedora 41, and Yelling at Clouds
Links for the day
FSF Amicus Brief: Aspose.PDF for .NET 24.2.0, OOXML (.docx), and Microsoft Word (Proprietary)
Could the FSF not find any law firm that, in addition to talking about or for Free software, does not use .NET, OOXML, and almost everything Microsoft?
New Interview With Richard Stallman in Italy (Manuel Cuda News)
Due to Google's growing aggression against Free software and proper APIs, this cannot be downloaded and converted to a free format
The Free Software Foundation (FSF) Belatedly Comments on Case That Tests Copyleft in the United States
"The Free Software Foundation (FSF) announced today it has submitted an amicus brief in the case entitled Neo4j"
If They Try to Censor You on Some Topic, Then You Should Cover This Topic Even More
OSI is only a small part of it
The UEFI hype and Microsoft's lies
By Sami Tikkanen
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, March 03, 2025
IRC logs for Monday, March 03, 2025
Thorsten Glaser & Open Source Initiative (OSI) resignations due to AI whitewashing
Reprinted with permission from Daniel Pocock