GNU/Linux: Emergency Restart
Posted by: nico on
Jul 14th, 2009 |
Filed under: Linux
There’s a cool shortcut to help us when shit happens, it’ll reboot the computer and it’s a little bit nicer than yanking out the power cord. You just need to remember REISUB and have some keyboard dexitry – holding down Ctrl – Alt – SysRQ/PrintScreen is required while typing REISUB (don’t do it now, it’ll reboot your computer!).
So, what’s REISUB all about? It’s a little bit better than a forced hard reboot because it’ll:
R: Restore console
E: Send SIGTERM to all processes
I: Send SIGKILL to all processes
S: Emergency sync of all filesystems (commit any changes to the phisical media)
U: Read only remount of all filesystems
B: Reboot now
So, off course, you’ll have to wait a little bit between every keystroke. Press Ctrl + Alt + PrntScreen + H on a console to get some help on every command.
Why does it work?
There’s a lot of magic involved to make this secret incantation work. It involves kernels, vectors and other mythical beasts. There’s a crazy thing called interruption vector; it’s the place where every (hardware) event gets dispatched to a handling function. There lives a function call to handle keyboard input, amongst other things. This function call will be executed always, though the SO may just decide to queue the keyboard input if it’s too busy handling something else.
Well, this key combination can’t be delayed ’till later, it must be handled NOW, therefore, even if there’s a stray process or a driver gone mad, it’ll always be caught and the computer will be rebooted.
What’s the catch? You won’t be saving that precious code you we’re hacking away when it all started, but at least you’ll save some fscking time on the next start up.



February 14th, 2010 at 8:23 pm
Ctrl is not needed!
February 14th, 2010 at 9:45 pm
Really? All those years practicing yoga so I could reach that weird key combo, for nothing? Man, wish I knew that one sooner
May 18th, 2010 at 1:28 pm
I knew only about the B, thanks for the others.
And no, you don’t have to press Ctrl
May 18th, 2010 at 1:39 pm
I have to keep a finger on my laptops Fn key to do this. It’s most annoying. Almost snaps my fingers.
May 18th, 2010 at 1:43 pm
RESIUB, also remembered with the nice-to-know “Raising Skinny Elephants Is Utterly Boring”.
RESIUO will Power-Off instead of rebooting, which might sometimes also be useful.
You’d be surprised how many kiosks running Linux don’t have this sequence disabled…
May 18th, 2010 at 1:50 pm
that will not work with kernels where the magic sysrq feature is not enabled
May 18th, 2010 at 1:54 pm
> dsfadsfgafgf
Indeed. Luckly most laptops tend to have a smaller keyboard
> thisisabore
I’ll have to try it next time I see one. There are not much of those over here, though. Most of the kiosks are Windows (it’s fun to see the BSODs too)
May 18th, 2010 at 3:40 pm
Seems to me you don’t need the first 3. “R” seems nice, though.
“SUB” should be enough. I didn’t know about “U”. I’ve been doing “SSSSSSB” for years…
May 18th, 2010 at 3:51 pm
> David
May be so may be not, but the look of awe when people look at you pressing a magical 18 key combo to reboot is priceless.
May 18th, 2010 at 4:21 pm
Why do people keep spelling fist f–king: “fscking”?
May 24th, 2010 at 4:53 pm
that’s because they actually mean “fscking” – as in the verb “to run the fsck command”
http://linux.die.net/man/8/fsck
the point of this article is to cleanly shutdown your computer when you cannot use conventional commands or menus to do so. this prevents data corruption or an inconsistent disk state, which can sometimes be fixed by running the fsck command on the disk.
Add A Comment