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

You mean the main reason of getting stuck at boot is the power problem? And what needs to be fixed is the kernel?

Indeed, no one forced linux user to hard shutdown when his machine got stuck during boot. It is the combination of human instinct and not knowing the correct way that forces him. When we don’t know the correct emergency shutdown such as this article, what else will come to mind to regain control of our computer other than moving our finger to reach the power button.

I simplified the method for execute it, I followed the solution which I found here:

https://unix.stackexchange.com/questions/517455/is-it-possible-to-create-a-terminal-command-alias-to-automate-ctrl-alt-sysrq

Bash script:

#!/bin/sh

for c in r s u o; do
  echo $c > /proc/sysrq-trigger
  sleep 1
done

Saved as /usr/local/bin/reisuo

Inserted such script in sudoers (because only root can write to /proc/sysrq-trigger) :
my-username ALL=NOPASSWD: /usr/local/bin/reisuo

I made a keyboard shortcut in Xfce (xfce4-keyboard-settings): which execute
sudo /usr/local/bin/reisuo

Works like a charme.

EDIT: i choosed kernel.sysrq=1 for enable REISUO.

1 Like

my thoughts and criticism:
the script is missing the “e” and the “i” steps of the r e i s u o sequence
(because either the first one, but certainly the second one, would kill the script itself)
and the “o” as the last parameter might not work, as it relies on APM to shut down the system
… “b” is for reboot ( r e i s u b )

The time in between the commands (1 s) might not be enough to finish the “s” step (flush to disk) before the “u” step kicks in, unmounting all filesystems.
Essentially, the script forces a “sync” and then, after one second, an unmounting of all filesystems,
all while all processes are still running.
The “r” is not even necessary with this script (I guess, from what I understand what it does).

This is all for cases when the system is seriously hung, as in: not functioning normally …
Of course the script probably works when this is not the case …

I’d rather just remember the sequence and what action each of the characters represent and use each one when necessary and appropriate.

2 Likes

For me is ok in such way; I just reported the method which I’m using.
Anyway this script works fine here.

This is all fine and dandy as long as Xorg still runs and processes your keyboard events…
Keep in mind though: “The magic SysRq key” on the other hand is directly understood by the linux kernel and will work in situations where that keyboard shortcut will not trigger the script.

5 Likes

Yes, I am aware of this; however the combionation of fn+SysRq keys are distant on my laptop’s keyboard and I’d have to use both hands only to press them, and I have no way to digit R E I S U O/ R E I S U B at the same time. I would need a third hand :joy:

A post was split to a new topic: What is the keyboard combination for SysRq on a Thinkpad T400p?

Sorry to come back here but on my recent unbooting Manjaro, both REISUB and REISUO don’t work. I have tried any possible combination for the SysReq equivalents provided in the original post. I still have to push the power button to hard turn off. I can confirm that the SysRq has been correctly enabled by testing REISUO when I get in the system successfully - it does shut the computer off. FYI, the kind of system freeze I often experienced is that the screen stays black before even the grub’s OS selection appears.

1 Like

If your system doesn’t even reach grub, then Manjaro is not even loaded, so the key combination can’t work.

That’s what I suspect. Then the hard shutdown is safe?

I’ve got a hp laptop with a ryzen 5 and Radeon graphics.
The combo that worked for me was
alt+prt sc + r
letting go of r and prt sc and holding alt key the whole time…
then
prt sc + e
wait a few seconds
prt sc + i (graphical dropped into terminal screen here)
wait a few seconds
prt sc + s
wait a few seconds
prt sc + u
wait a few seconds
prt sc + b …computer reboots…

I did have to enable this functionality though, as described above.

Thanks for this, I really hate seeing journal messages about orphans.

Lol, I didn’t even know that manjaro had an update-grub alias, I always just did it manually same as back in arch. It’s not that long of a command anyways.

Thanks for this, I sometimes had to use the power button to force off my machine when it hung on shutdown when I couldn’t wait to see what was making it hang, it’s a good to know there’s a less cringe inducing alternative, I did not know this existed.

Just gotta find that SysRq key now

Edit: it was Alt+Print Screen, I think this is just standard for modern PCs probably (laptops included, mine is a laptop, recent too, like 2019 make maybe)

Easy way to find the right key if ur on X is to just run xev and try combinations until it tells you it’s sysrq.

@jawanari hard shutdown as you call it is not safe at all, i know someone personally who fried his PC doing it (don’t remember how exactly it broke, whether it wouldn’t get power at all (dead psu) or if it got power but didn’t POST (potentially dead cpu) just that it was fried and he bought a new one)

That is an extreme case and shouldn’t actually be possible though, but it can damage your hard drive, it will corrupt your filesystem almost guaranteed (though linux should be able to recover from that) it can also damage your SSD though i’m not sure to what extent.

Pulling the power plug though is a lot worse, a common way for people’s PCs to get fried, so definitely don’t do that either.

If your system is freezing before you even get to GRUB though, this is not a manjaro problem, it’s not a grub problem, it’s either a BIOS problem or faulty hardware problem.

Uff… I have a PhD in physics and work in science education at a university, but I hardly can even ask a specific question to address what I do not understand, cause I have fundamentally a hard time of following this tutorial. That also makes it impossible to me to provide a helpful constructive criticism of what to change to make it more legible.

1 Like

I don’t have a PhD; only a BSc in chemisttry, but cannot answer your question because it’s not a question, so some tips:

  • Start reading from the first triangle
  • Click all triangles to open up their subsections
  • Keep reading without skipping anything
  • Execute all the commands you encounter
  • Feed back with specific questions each time you run into something you don’t understand
  • Your specific questions will be answered and incorporated into the tutorial if valuable to everyone and how we improve our tutorials.

:person_shrugging:

2 Likes

This sequence helped me to figure out which keys worked and understand further …

  • Start with a normally running system
  • Open a terminal and follow the journal (one of my fav toys haha):
journalctl -f
  • Try out the shortcut keys and see a visual response for each one, for example:
(hold Alt, press Fn+SysReq, press R, release Alt)
Oct 19 09:28:29 delphin kernel: sysrq: This sysrq operation is disabled.
(hold Alt, press Fn+SysReq, press E, release Alt)
Oct 19 09:28:31 delphin kernel: sysrq: This sysrq operation is disabled.
(hold Alt, press Fn+SysReq, press I, release Alt)
Oct 19 09:28:34 delphin kernel: sysrq: This sysrq operation is disabled.
(hold Alt, press Fn+SysReq, press S, release Alt)
Oct 19 09:28:38 delphin kernel: sysrq: Emergency Sync
Oct 19 09:28:38 delphin kernel: Emergency Sync complete
(hold Alt, press Fn+SysReq, press U, release Alt)
Oct 19 09:28:41 delphin kernel: sysrq: This sysrq operation is disabled.
(hold Alt, press Fn+SysReq, press B, release Alt)
Oct 19 09:28:44 delphin kernel: sysrq: This sysrq operation is disabled.

From there I figured out the keypresses were correct, and why they seemed to do nothing.

Next steps: reread the instructions above on how to enable the keys, especially the link to the documentation for kernel key shortcuts (in the REISUB steps).

Thank you for highlighting some super-useful hotkeys!

2 Likes

Thread tidied. :broom:

Honor The Dude.

1 Like

A post was split to a new topic: I don’t know how to locate SysRq

Well, I did what you said.
my chrome was opened with 3/4 tabs. But after the reboot, when I opened Chrome again, a dialogue showed “Chrome didn’t shutdown correctly. Restore all the tabs?”
I mean, Is it normal? A not gentle shutdown causes the same dialogue to appear when opening Chrome. Should this gentle shutdown cause the same for Chrome?

This only prevents damage to your file system. (which can result in an unbootable system, or worse)

Each program is responsible for keeping its data safe. And chrome obviously does it well.

2 Likes

If chrome did not shutdown correctly after getting the TERM signal (E in the sequence) it either did not react on it or did not have enough time because the I (KILL signal) followed too quickly.

4 Likes