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.

  • NaibofTabr@infosec.pub
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    1
    ·
    15 days ago

    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:

    1. The keyboard is working.
    2. The USB driver and OS are actively responding to input devices, even if the display is frozen.
    3. The CPU is alive and not stuck.

    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.

    • SpikesOtherDog@ani.social
      link
      fedilink
      arrow-up
      4
      ·
      15 days ago

      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.

      • floquant@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        15 days ago

        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

        • SpikesOtherDog@ani.social
          link
          fedilink
          arrow-up
          2
          ·
          15 days ago

          I have a feeling my swappiness setting was already aggressively paging, so I already had no space. I also turned my swappiness way down.

    • floquant@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      ·
      15 days ago

      The sysreq keys should always work if the OS is locked up.

      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:

      sync(s) is handy before yanking removable medium or after using a rescue shell that provides no graceful shutdown – it will ensure your data is safely written to the disk. Note that the sync hasn’t taken place until you see the “OK” and “Done” appear on the screen.

      umount(u) can be used to mark filesystems as properly unmounted. From the running system’s point of view, they will be remounted read-only. The remount isn’t complete until you see the “OK” and “Done” message appear on the screen.

      A little correction:

      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)

      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 ;)

    • KokusnussRitter@discuss.tchncs.deOP
      link
      fedilink
      arrow-up
      1
      ·
      15 days ago

      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 :)