Mint Cinnamon Desktop

Linux Mint Random Shutdowns

A jaded computer geek would tell you Linux Mint random shutdowns can’t be fixed. As popular as Mint is, it really tries to offend everyone. There are no end of possible fixes from self-proclaimed “experts.” I’ve even seen people blame the Linux kernel itself, completely ignoring the fact other distros use the same kernel and don’t have this problem.

I’m going to take you down the “Maybe it’s not exactly Mint” path first. Most of the Mint forum people try to point at everything other than Mint so I will take you on that journey first. I will also point out that Mint tends to be the only distro this random shutdown complaint gets lodged against.

The Nanny Distro

In many ways Mint is the “Nanny Distro.” It chooses a bunch of default settings that The Nanny State believe you should use then it gives you no obvious way to change them. Your particular issues might be slightly different because I installed the Mate desktop version rather than Cinnamon. The root cause and how you go about fixing it will remain the same. I’ve written about Mint since Mint 13 on this blog. There was a time when you couldn’t consistently keep NVidia drivers functioning on this distro. The flood of BOINC users into the forum was biblical. Every time someone decided how you should do something then took away every opportunity to change that way a mob with torches and pitch forks appeared in the forum.

Mint and random power downs go back many years. Every new release seems to usher in a new Nanny State and they break something else. This problem doesn’t really “get fixed.” At least there is no way to fix it using anything that came installed via the Live disk.

Blow All of the Dust Out

Before you start looking at the software you need to power off your computer and take it some place that has a real air compressor. No, those cans of “sterile compressed air” you buy at a computer store won’t work. No, that el-cheapo oil-less job-site compressor your buddy bought to run a staple gun or brad nailer won’t work. You need a real air compressor with at least a half inch inner diameter hose. You can’t get enough air volume to lift the dust out of your heat sink (and other tight places) and take it all the way out of the case with the lesser volume sources of air. You end up moving it around inside of the case. Once you turn your computer back on it gets sucked right back into where it was causing a problem in the first place.

Rule #1 of random shutdown/crash gremlins: More than half of the time they have nothing to do with the software. Sometimes it is just a timing thing. You installed a new distro right as that last piece of dust lodged itself in place causing overheat shutdowns.

Disable Suspend and Hibernate

If this works for you then you need to rush out and buy a multi-state lottery ticket. I’m serious. From a logical troubleshooting methodology this is the next set. Odds of it “fixing” your problem are almost non-existent. Still, you have to eliminate this as a possibility before moving forward.

sudo systemctl mask

Of course you need to reboot after doing this just to be sure.

Are You Running BOINC or other Intense Background Task?

Linux Mint random shutdowns tend to be caused by heat. At least in a not insignificant number of cases they are heat related. There are two things you need to do here.

  1. Install a CPU temperature monitor
  2. Disable/uninstall BOINC or your other background crunching application

Depending on your desktop, you can install either a widget or an applet. Search the software installer for one or look to this link. If you want terminal options there are a bunch listed in this link. Without becoming a complete hardware nerd, if your CPU temp is around 40 degrees Celsius you are not overheating. Each CPU has a different heat cap where it will trigger BIOS/OS shutdown to protect itself. (We never used to have this back in the 1980s with DOS, chips just fried.) If you see your CPU temperature creeping close to 90 degrees Celsius you’ve got a heat problem.

Many geeks are of the opinion that Mint isn’t as good at controlling heat as other distros. Whenever you try to “improve performance” you tend to increase heat. Yes, you can get rid of needless loops and memory allocations to improve performance. Theoretically that doesn’t increase heat. The time wasted doing that was allowing at least one core a bit of a breather. When you take out all of the time wasters, you increase the amount of cycles the CPU is actually working.

Be Sure to Monitor RAM

This is often overlooked. One of the reasons people run Linux is they are running it on older hardware and they don’t want to pay a Microsoft tax. Yes, when you were running 32-bit operating systems 4GB of RAM was an ocean of memory you couldn’t comprehend. There was a time you could run Linux on two 5 1/4 floppy disks with 640K or less of RAM. Not anymore!

Yes, Linux now has a lot of bloatware. Much of it is because kids today don’t bother getting an education, they just grab a scripting language and start hacking on the fly. Who needs to architect a proper solution? Just cry AGILE and hack on the fly!

This is especially true of today’s browsers. Many of the most popular browsers will launch roughly 1,000 threads at startup “just to have.” Every one of those threads in the “thread pool” needs a chunk of RAM allocated to it despite the fact it is doing nothing. It inhaled that 4GB like a single tiny nibble off the end of a Snickers bar and went looking for the rest of the bar. Word processors, notably Libre Office, seem to be inhaling RAM like a 700 pound person at the all-you-can-eat desert buffet.

Yes, your computer ran “just fine” with the previous distro because your previous distro had the less obese versions of everything. This obesity problem is going to keep getting worse, not better. As the skill level of “contributing developers” plummets through the sub-basement bloatware will continue to be released and memory leaks the size of the Atlantic Ocean will continue to be commonplace. The really killer is the mantra I hear them recite over and over again.

RAM is so cheap these days.

Unskilled developers

Well, in the COVID-19 world nothing is cheap. Inflation is skyrocketing. Pre-COVID-19 you could buy a 60-month car battery for under $150. Today 48-month is the longest warranty you can find and the battery is over $220 plus tax. Event he price of used CPUs and RAM is skyrocketing.

When you are installing your widget/applet to monitor CPU temperature, install some to monitor your physical and virtual RAM consumption. When there is not a single byte left to allocate you will crash.

Many people claiming to be C++ developers are to blame for this bloat as well. A God-awful practice called Template Meta-programming has become the trendy new thing. This leads to some of the most unstable software you will ever find. You are now getting templates derived from templates derived from templates like that never ending mirror reflection. Somewhere between the third nested level and the seventh GDB gives up the ghost. You physically can’t step into that code with the debugger. Because every (&)(&)(*ing variable in the source is declared auto you can’t even print the shit via the default debugger.

The mortal sin of Template Meta-programming is that it now takes 8GB of RAM per CPU core to compile anything.

Everything was working fine for you. Honestly you love your i7-gen4 computer you bought for under $300. So what if it only had 8GB of RAM? You could still program. Then you installed the latest Mint. Got all of the latest bloatware. Tried to compile “Hello World!” and found out the compiler needed 32GB of RAM.

As long as it was only the compiler that ran out of RAM you will be fine. If the compiler sucked up all of the RAM and the OS kernel needed to get some more, that’s when you crash. Elive and many other distros don’t get the random shutdown complaints because many default to displaying a system monitor on the side of the screen.

Elive system monitor

Linux Mint Random Shutdowns that could be Mint’s fault

We aren’t done with the “Might not be Mint’s problem” path just yet, but we have definitely plucked all of the low hanging fruit. Now we have to remove the Nanny state. Many Linux Mint random shutdowns are actually Mint’s fault. Install and use Synaptic Package Manager, don’t use the Software tool to install the Dconf Editor.

Dconf Editor install

Yes, despite all of the GUI stuff, Linux is still an expert friendly operating system, just like Windows. You have to know the dirty little secrets and where to find the dirty little tools. The GUI software tool will install the Flatpak version. While Flatpak is nice for many things like text editors and word processors, OS tweakers are still somewhat challenged.

Synaptic will get you a Debian package

A Debian package will have full access to the system.

Search for everything with a sleep time

You have to search for everything with a “sleep” or “suspend” value. It sucks. There are dozens.

After you have turned off the last suspend and set the last sleep/suspend timeout to “never” reboot. Now pray to whatever deity or deities you worship that you have finally fixed it.

It Still Crashes – Sometimes While You Are Typing On It

I took you on the “not Mint’s fault” journey first so you would have all of the monitors installed. If your processor is overheating and blowing the dust out didn’t fix it you need more fans and a better CPU cooler. Lots of people will point you to articles on how to properly apply thermal paste. If your CPU cooler was put in place using that cheap thermal paste that comes in mini toothpaste tubes without labels, it is now somewhere between brick mortar and Crazy Glue. All of the instructions about using a heat gun and twisting the CPU cooler aren’t going to remove the cooler from the CPU. You will end up ripping the CPU out of the socket. Make your peace with that. Don’t try to twist the CPU off once it is out. You will just bend the pins.

Turtlewax Label & Sticker Remove is the only thing I’ve ever found that can break that stuff down.

Use it outside! Be patient! Give it time to work. Yes, you may need some tiny thin tools to help it along but it will break down that stuff given time. Don’t forget to clean your CPU afterwards.

But My CPU Isn’t Overheating

Got a sad bit of news for you baby.

Assuming you didn’t crack your motherboard installing it or improperly mount it so it grounds out . . .

Replace your power supply with a bigger one. Today’s power supplies don’t “just fail.” They get weaker with age.

Those on-line calculators lie!

According to this I need only 400 Watts

Don’t get me wrong. I’ve bought a lot of stuff from NewEgg over the years. I’ve actually purchased things in an EggHead store which is where NewEgg got its name. According to this calculator the 500 Watt PSU I had in the machine was more than enough.

500W that was in unit

For a couple of years it was. I put numerous Linux distros on the machine. It always ran BOINC with an AMD Phenom II X6 CPU. It always had 24GB of RAM. It always had an NVidia GT 630 (calculator didn’t go that low) video card. Life was good.

I installed the latest Linux Mint and it all went to shit.

Went through every one of the steps above. Even pulled the CPU out of the socket like you are going to do as well. Without BOINC installed and running I got Mint to stay up overnight. With BOINC running, maxing out all 6-core, the system would shut down inside a couple of hours. Once it shut down while I was typing on it and the CPU monitor was showing 60 degrees Celsius. This was after I had installed a new super duper CPU cooler and extra fans.

I noticed the air coming out the back of the power supply was almost hot enough to burn my hand. I installed a 680 Watt PSU and life is good. The CPU rarely hits 40 degrees Celsius. Everything runs cooler.

You see, those calculators ASS-U-ME you are just surfing the Web, checking email, and using a word processor. They will toss in a couple hours of intense gaming but that’s it. Your PSU can handle an hour or two railed out against its output limit. It cannot tolerate 24×7 for months on end.

The often overlooked fact is that part of your PSU’s responsibility is to exhaust CPU heat. Yes, a bunch of the heat from the CPU cooler gets sucked up by the PSU and exhausted. When your PSU needs 100+% of its cooling capability for itself, your CPU cannot cool itself off.

Most of the “custom” machines I see on eBay and other places now come with four fans installed. This is the reason. Be it high end gaming or number crunching to cure cancer, your CPU runs near max for much of its life. It needs a lot of cooling. You need an excessive PSU not for the power but for the extra cooling capacity.

Add at least 100 to the top end of what a PSU calculate gives you if you plan to game or run BOINC.

For whatever reason, the latest version of Mint pushed that box to its tipping point.

Currently ATX motherboards have no method for the PSU to tell the CPU “Hey! I’m overheating here!” so the PSU just shuts down when it hits some internal safety limit. Eventually motherboard designs and power supplies will incorporate some kind of feedback mechanism so the OS can toss a warning and throttle the CPU.

Roland Hughes started his IT career in the early 1980s. He quickly became a consultant and president of Logikal Solutions, a software consulting firm specializing in OpenVMS application and C++/Qt touchscreen/embedded Linux development. Early in his career he became involved in what is now called cross platform development. Given the dearth of useful books on the subject he ventured into the world of professional author in 1995 writing the first of the "Zinc It!" book series for John Gordon Burke Publisher, Inc. A decade later he released a massive (nearly 800 pages) tome "The Minimum You Need to Know to Be an OpenVMS Application Developer" which tried to encapsulate the essential skills gained over what was nearly a 20 year career at that point. From there "The Minimum You Need to Know" book series was born. Three years later he wrote his first novel "Infinite Exposure" which got much notice from people involved in the banking and financial security worlds. Some of the attacks predicted in that book have since come to pass. While it was not originally intended to be a trilogy, it became the first book of "The Earth That Was" trilogy: Infinite Exposure Lesedi - The Greatest Lie Ever Told John Smith - Last Known Survivor of the Microsoft Wars When he is not consulting Roland Hughes posts about technology and sometimes politics on his blog. He also has regularly scheduled Sunday posts appearing on the Interesting Authors blog.

Leave a Reply