[HowTo] reboot / turn off your frozen computer: REISUB/REISUO

Difficulty: ★★☆☆☆

As I see too many people using a hard power off during freezes, I’m creating this small tutorial on how to turn off your computer when everything is frozen. Whenever you see someone saying they had to “Power Off” or “Hard Reset” their system without mentioning they had to REISUB their system, send them here! :innocent:

Please click the ► to expand a section:

REISUB (reboot)

REISUB (also known as the magic SysRq key ) is a mnemonic for:

and is a gentle way of rebooting your system by doing the following:

  • Switch the keyboard from R aw mode, used by programs such as X11 and SVGALib, to XLATE (translate) mode
  • Send an E nd signal (SIGTERM) to all processes, except the boot process, allowing all processes to end gracefully
  • Send an I nstant kill (SIGKILL) to all processes, except the boot process, forcing all processes to end .
  • S ync all mounted filesystems, allowing them to write all data to disk.
  • U nmount and remount all mounted filesystems in read-only mode.
  • Re B oot the system

In fact, the only data you lose is since your last [auto]save as the system is shut down gracefully.

Before you read any further, ensure all your work is saved!

How to invoke the REISUB procedure?
First we have to unlock the SysRq key so:

  • Add to your grub GRUB_CMDLINE_LINUX_DEFAULT the sysrq_always_enabled=1 variable.
    OR
  • Execute echo kernel.sysrq=1 | sudo tee --append /etc/sysctl.d/99-sysctl.conf
    AND
  • Reboot normally if you had to add one of these parameters and come back here to read the rest of the blurb… :wink:

There is a special Sys tem R e q uest key on most keyboards called SysRq on all English language and most international keyboards.

Expand this for the translation for some International keyboards

:it: Stamp (or Stampa on old Olivetti keyboards)
:de: S-Abf
:earth_africa: Feed back in a comment below if you have found yours that is not mentioned here. :innocent:

  • on full-size keyboards it’s called by pressing Alt+SysRq
  • on most laptop keyboards it’s called by pressing Fn+Alt+PrtSc
  • On some keyboards, please also try Alt+PrtSc if the SysRq key is missing or Alt Gr+SysRq if none of the above Alt combinations work .

Once you’ve located your SysRq key, please keep the Alt key pressed.

Now lightly tap these keys waiting between 1 second (fast, new machines) and 6 seconds (older or resource-starved machines¹) in-between keypresses : R E I S U B

There! If you actually followed the above instructions, your system just rebooted gracefully and you did not damage your HDD (if you still have one) by forcing it into PARK mode forcefully nor was your EXT4 or NTFS transaction journal rolled back.

Congratulations!

:innocent: :+1: :clap:

REISUO (Turn off)
  1. Read the REISUB section above and then you’ll know what this means:
  2. R E I S U O will turn your machine O ff instead of re B ooting it…
Light tap on power button (<5 seconds)
  1. Sometimes (If only the UI is frozen), you can still switch to one of the TTYs by pressing Ctrl+Alt+F2 or F3, … and gently tap the power button there.
  2. To do the same from within your Desktop Environment (DE) this has to be set up beforehand!
    So to ensure that your power button effectively shuts down your computer instead of going to sleep / Hibernate / … in the future , follow these steps for your DE:
  • In Gnome:

    Details
    • Execute the following command:
      gsettings set org.gnome.settings-daemon.plugins.power button-power 'shutdown'
    
  • In KDE:

    Details
    • Go to System Settings
    • Type energy
    • Click Energy Saving
    • in all of the On AC Power, On Battery and On Battery tabs, set the check-mark on Button events handling and the Even when an external monitor is connected
    • When power button pressed to Shut Down as per below screenshot:
    • Click Apply
  • In XFCE:

    Details
    • Go to the Applications menu or System settings
    • Clock Power Manager
    • From When Power Button is pressed: select Shutdown.

That’s it! If all of your data is saved, just press the power button lightly and your system will shut down gracefully from now on!

Keep power button suppressed (>5 seconds)

See section “Pull circuit breaker on House / Street / Block” below…

Yank power cord from a laptop without battery or a PC without UPS

See section “Pull circuit breaker on House / Street / Block” below…

Pull circuit breaker on House / Street / Block

Please! Do not do this!

Unless you’re using ZFS or BTRFS and have ensured they use redundancy, you will lose data!
Maybe not the first time, maybe not the second time, but eventually, you will!

Use REISUB, REISUO or a light tap instead!

Happy safe computing! :+1:

Note 1: How long you have to wait in-between keystrokes is a function of your hardware speed and how busy a system is. For my laptop it’s 1 second, for servers, I wait 3 seconds but we have been notified that on some resource-starved machines it can take up to 10 6 seconds. :man_shrugging:

38 Likes

If I remember right, Manjaro masks sysrq.

That’s why it says:

:innocent:

Perhaps that “all” should be changed to “many”. My keyboard, the Logitech MX Keys, doesn’t have this key. Also keys like print screen (I missed the camera icon) and scroll lock are not present. A quick google search for an alternate key combo yields no results. Any suggestions?

I’ve changed “all” to “most” and would open a hardware case with my hardware vendor if Fn+Alt+PrtSc or simply Alt+PrtSc doesn’t work…

Please feed back when you’ve found the correct key combination so I can edit it into the tutorial… (IOW: Sorry, can’t help you; don’t have your hardware)

2 Likes

Your tutorial was spot on. I held the alt key, followed by camera/screencap/printscreen then REISUB, pausing slightly between each keystroke. It worked flawlessly. The next time my system freezes, I’ll try it out, though I have my reserves. Usually my wireless mouse and keyboard are unresponsive as though the whole I2C/USB bus has gone down.

1 Like

Definitely going to try that GRUB_CMD thing its the newest thing I’ve seen anywhere!
To Saving My HDD!
Thanks!

1 Like

I think the sysrq has to be enabled by default… no way to have to recommend to enable it here because so much people dont use it. By default it’s probable making people using it more.

I agree, but I’m not calling the shots: the Manjaro Team is, and not enabling it by default is “safer”…

:innocent: :wink:

for me is safer way to have lost of data by making hard powering offs… XD
it’s likely the thing that manjaro teams wanted to say JAJA

now serious, is safer, but… come on, having to make hard reboots… if you feel bad or unsafe by this you CAN disable it . I think it’s more probably to have a hang that a person making shitty things with sysrq… so the term safer it’s not for me, meanwhile I will continue adding this grub flag to all my instalations

1 Like

Thanks! Alt+PrtSc did the trick.
I’ve had one scenario where I couldn’t shut down the machine by even holding down the power button, and had to cut the power… Though I hadn’t booted to a system, so chances of data loss might’ve been lower.
Hopefully this’ll work, if I end up in a situation like that again.

1 Like

I tried to get reisub functional some months ago and it did not work at that time for whatsoever reason. This time I did just try the key combination and it worked as the file /etc/sysctl.d/99-sysctl.conf still was prepared for it, so thanks for reminding me to this feature (which hopefully not often will be needed :grin:).

1 Like

If you have a Dell XPS 13 (in my case 9343, I don’t know if this applies also to other variants) the shortcut is Alt Gr + Stamp.

Just adding my experience here if someone struggles a little bit finding the correct shortcut.

Me too. That’s the great thing with Linux: disabling “safe” if you want to, and not getting nagged about it like with Mac OS and Windoze :wink:

1 Like

:it: Stamp (or Stampa on old Olivetti keyboards)
:de: S-Abf

etc. etc.

Not going to add all keyboards on the :earth_africa: as that’ll make the article too long…

:wink: :grin:

Yeah right sorry about the Stamp, silly mistake. I don’t know why but I thought that label was international :sweat_smile:

In reality my intent was to point out about the use of Alt Gr which is often considered to be (functionally speaking) a different key than Alt.
Maybe we could add a simple note specifying something like “Try also Alt Gr if none of the existent Alt combinations seems to work”.

Just my 2 cents of course (thanks for the How To BTW)

Il tuo desiderio è il mio comando:

  • On some keyboards, please also try Alt Gr+SysRq if none of the above Alt combinations work .

was just added in!

:innocent:

and Grazie mille for the input! :hugs:

Hi, I don’t know how it should look but when I press Fn+Alt+PrtScr then R>E… when i press E it restarts super fast with all my network card and etc off or its just black screen with my cursor. Is this right or am I doing something wrong?

I did this: echo kernel.sysrq=1 | sudo tee --append /etc/sysctl.d/99-sysctl.conf
and then I rebooted and tried REISUB and this happened. Once just black screen and second time just super fast restart in 3sec.

2 posts were split to a new topic: Booting live ISO HP hangs

E normally sends an E nd signal (SIGTERM) to all processes, except the boot process, allowing all processes to end gracefully, so please open a new topic for this and provide some more info there (a journalctl --system --boot=-1 | grep shutdown would be a start)

:wink: