What do I do, when my PC freezes?
Windows has ctrl+alt+del, does Linux Mint has something comparable? The only thing I know about is REISUB, but that borked my PC, so I am hesitant to use that again.
Are there any remaining alternatives to waiting and/or using the power button?
Edit: Thank you all for your insights and possible fixes. Crashes usually happened when I was running (cpu/ram?) heavy workload. Increasing swap space was not even on my radar, so I did that now. :) Hopefully Mint will run more stable now.
This depends a lot on the type/source of the freeze. What were you doing at the time? Are you experiencing regular crashes? What is your hardware like? (laptop/desktop, year, make, model)
Is it just the window manager/desktop environment? Ctrl + Alt + F7 should take you to a different TTY session where you can login and give a reboot command. (actually any F# key should work)
The sysreq keys should always work if the OS is locked up. How are you using REISUB? Do you know what instruction each letter sends? Are you waiting in between pressing them? If using this “borked your PC”, the most likely reason is that your system was busy writing something to the hard drive that is related to the OS and was interrupted. How was it “borked”? Did your bootloader start? Did your OS try to start?
One thing you can do if nothing seems to be responding is tap the NumLock key. If the indicator light changes you know 3 things:
If the light changes then you should be able to tap the power button for a soft reset/graceful shutdown.
If the light does not change then you should first check your keyboard (is it plugged in? is it wireless? does it need a new battery?) but if that’s not the problem then all you can do is force a shut down, because the system is not responding to input.
There are a lot of potential problems that can produce a “freeze”, with the most basic being an issue with the mouse/keyboard or the USB port they’re plugged into. I once thought my computer was freezing because I was using a Logitech wireless mouse that was bound to 2 different USB receivers plugged into different computers, and the input would randomly switch from one to the other (seriously check the simple stuff first). You could also have a problem with your RAM, hard drive, GPU, CPU or motherboard which could each produce symptoms like freezing. If you have regular crashes you should be checking your hardware.
To really answer the question “what can I do?” requires more context, and requires you to do some checking to judge the severity of the crash.
Mint, for me, was freezing up if something like Gimp was running in the background and it goes to sleep. Waking up, it appeared completely locked.
My system has 16 GB of memory, so I increased the swap from the default 2 GB page file to 16. It’s been a few weeks, but I haven’t seen a lockup.
My theory was that it was suffering trying to restore memory from hibernation. The only thing helping me was having a SSD, which would eventually catch up and bring me to a properly running state in a few minutes. If it was a spinning player it would never wake up.
Yes, you need enough swap to fit all your RAM’s content to successfully hibernate/hybrid sleep. In the case of regular suspend to ram this shouldn’t happen though
I have a feeling my swappiness setting was already aggressively paging, so I already had no space. I also turned my swappiness way down.
This used to be the case, but the default configuration of systemd actually disables them and requires manual activation.
But yeah, knowing what each does and waiting for sigterm, flush, and umount to complete is crucial to avoid borking your system. From the kernel documentation:
A little correction:
Virtual consoles 1, 7, and sometimes 2 are usually “special” in the sense that they host a graphic session or kernel logs or something else that is not a login prompt, while 8 through 12 are not usually allocated.
Definitely try pressing Ctrl-Alt-F3 if your session hangs (i.e. mouse cursor is unresponsive) before going nuclear with SysRq. Then you can look at logs and resource utilization to try and figure out what’s going wrong rather than murdering your CPU mid-thought.
Solid troubleshooting advice though! Num lock/caps lock are the definitive way to tell if your CPU is halted or not - but only reliable over a wired USB or PS/2 connection ;)
I just wandered by from /All and I want to commend you for putting this much work into a helpful comment.
Since crashes usually happened under heavy workload (I guess CPU/RAM heavy stuff) and I didn’t pay attention to swap space before, I think this was the most likely cause. I increased it and will have to wait and see if it helps. If not, I’ll consult your comment here :)