~ 1 minute
Somehow, you crashed your Linux. It’s completely frozen. You try pressing Ctrl + Alt + Backspace, but doesn’t help.
What to do? Someone would press the power button and restart or shut down the system. You shouldn’t do this. This can make you a lot of problems.
What you can do, is to perform a gentle Linux restart. This is much safer way to restart your frozen Linux. To do this, you need to press:
Ctrl + Alt + PrtSc (SysRq) + reisub
Just to make it clear. You need to press and hold Ctrl, Alt and PrtSc(SysRq) buttons, and while holding them, you need to press r, e, i, s, u, b
This will restart your Linux safely.
It’s possible that you’ll have problem to reach all the buttons you need to press. I’ve seen people type reisub with their nose :)
So, here’s my suggestion: With your smallest finger on the left hand, press Ctrl. With your thumb on left hand, press Alt. With the smallest finger on your right hand press PrtSc(SysRq) button. This way, you’ll be able to access to reisub buttons with your other fingers.
Okay, but what this REISUB means?
- R: Switch the keyboard from raw mode to XLATE mode
- E: Send the SIGTERM signal to all processes except init
- I: Send the SIGKILL signal to all processes except init
- S: Sync all mounted filesystems
- U: Remount all mounted filesystems in read-only mode
- B: Immediately reboot the system, without unmounting partitions or syncing
You can find the complete list here. There you can see that o shuts down the system. So, if you want to turn off your PC when your Linux crash, you can use this combination:
Ctrl + Alt + PrtSc (SysRq) + reisuo
If you liked the post, we should get connected - follow me on Twitter
Note that you should wait a couple seconds after each step (at least after syncing). Also, if you need help remembering the reisub sequence, it’s “busier” backwards :)
Good point, thanks for mentioning!
Or REISUB = “Reboot even if system utterly broken”!
“Raising Elephants Is So Utterly Boring”
Never can remember who told me this for the first time, or why they chose that mnemonic, but it’s sure stuck in my head now.
Does this work on systemd based linuxes?
Is that for real?:)
It is for real–but the kernel has to be compiled with , “Magic SysRq” support (I think most stock kernels nowadays are), and then it actually needs to be turned on. I think GNOME/Ubuntu have an option for it in the keyboard layout preferences; otherwise there’s a device file in /proc/ you can write to enable it. See http://en.wikipedia.org/wiki/Magic_SysRq_key for more information.
You can do rk instead of reisub, it will kill all thing on the current vt, you can then do ctrl+alt+f1 and change to the vt1 where you have a shell and can fix all the things without a reboot
I agree with Aleksander. The first thing I would do is switch to a different virtual terminal to see if I can just restart X. If my machine is still accepting keyboard inputs, then it’s a lot cleaner to just Ctrl+Alt+F1 over and kill/restart xorg.
What do you do when Linux gets frozen? Let it go, obviously.
XD
If you watch the screen, you can see the keys I press in the upper right. I change colors to BLUE by typing invisibly “$BLUE$”.
If you need a more deep explanation about this please read :
http://en.wikipedia.org/wiki/Magic_SysRq_key
The classic mnemonic for this sequence is “Raising Elephants Is So Utterly Boring” :) I think you should include it in the post!
As far as I remember sysrq feature can be disabled in kernel, so this can not work by default in some cases.
reisub = Reboot Even If System Utterly Broken :)
Pingback: Linux gets frozen, what do you do? | Dan Ballard
it still work without to hold prtsc button. only hold ctrl+alt
Ctrl is not needed, Alt + SysRq + is sufficient.
Note that the “magic sys-rq keys” do not take your keyboard layout into account. Dvorak users, for example, need “p.cogx” instead of “reisub”
Also, your system might have this disabled. Check the contents of /proc/sys/kernel/sysrq to see (should be either a 1 or a 0).
“(should be either a 1 or a 0)”
Not necessarily on newer kernels. Check http://en.wikipedia.org/wiki/Magic_SysRq_key#Configuration for that as well…
Do such a trick exists on FreeBSD ? .. Nah, it never crash ! :p
FreeBSD does crash. But it takes so long to do anything, you don’t realize that its crashing. In FreeBSD’s case, the best thing to do would be to use the Windows technique of pressing the restart button. Do this after FreeBSD has finally booted up into XWindows, which can take a looong time. You’ll be fine after that. :p
Install Windows instead. Linux freezes a lot. Unless you don’t install anything at all. Then it freezes a bit less.
LOL Have fun with your windows! When windows crashes bill gates can restart it for you remotely.
Or, just tap the power button.
If your box is less than ~10 years old and your Linux flavor isn’t strangely configured, it’s a soft power button which will tell the system to initiate a clean shutdown, and bypasses whatever X did to mess up the video and keyboard.
Some systems have that button configured to initiate a hibernation. Probably a better idea to spend your time changing that from hibernation to shutdown than to do the SysRq enabling stuff.
Linux gets frozen? Are we talking the GUI here? How about launch a tty session, ctl+alt+F1? But then, I’ve never had my Linux frozen, must be an Ubuntu thing. Not with my Slackware. :)
Yikes. Why would you tolerate an OS that requires restarting?
I am spoiled by WinNT technology (which today’s Windows gets its stability from) as well as Mac OSX. They run for days without crashing.
I remember Windows ME crashing a lot.
Oh! that’s interesting…
But.. But.. I can just hold left-alt + left-ctrl + prtsc with my right hand and hit the other keys with my left hand easily.
Thank You very much for this information. :)
Just let it go…
Holding down control is optional, but generally helps prevent you taking a screenshot after hitting the “Print Screen” hey.
For hitting the keys, I find using my thumb for alt, the edge of my pinky for control, and my middle finger for Print Screen lets me hit all the keys without stretching too hard. (I do this with my right hand… why would you use your left? Keyboard twister? :D)
You will want to wait 10 seconds after sending the SIGTERM before sending SIGKILL, otherwise you are doing no better than just resetting the power. SIGTERM asks a process to shut down safely by allowing it to do any required housekeeping (like saving files to disk) before exiting. SIGKILL terminates a process immediately. Sending SIGTERM and then immediately SIGKILL can really mess things up as you have basically just told a process to go ahead and do things like writing to disk before then saying “No never mind, die this instant and you are not allowed to do so safely”.
You also want to wait a few seconds between the kill, sync, unmount, and reboot commands too.
To the people saying to use another operating system… The Linux KERNEL never crashes unless there is a serious hardware problem. Generally when a Linux system “freezes”, It’s generally a driver issue. This is every bit true on FreeBSD and Windows as it is Linux. The main difference with Windows is that there are built-in mechanisms for resetting (or even changing to a generic driver) to make things work again. This does not always succeed either…
While it would be great if Linux detected this and recovered in a similar way… you can generally do so yourself by switching to a console. (And then doing something like killing X11 and possibly reloading the kernel module if required.)
Cool, although Alt Gr + PrtScn + seems to be enough on my comp, i.e., no ctrl
Pingback: Linux gets frozen, what do you do? - OSOMac
> I’ve seen people type reisub with their nose
And you didn’t offer to help? :)
Pingback: #4 Notable on the InterWebs | CoderZen
Pingback: Linux gets frozen, what do you do? | Sound & Complete
It is actually sufficient to press Alt+SysRq. Ctrl is not needed.
Pingback: Ctrl + Alt + PrtSc (SysRq) + reisub | Brainiac
I just love this site. Thanks a lot for sharing this.