Linux

Categorized | System, cli

Force a clean reboot when the system freezes

If you manage to freeze your system in such a way that even Ctrl+Alt+Del doesn’t work anymore, the mouse is stuck on the screen any none of the key combinations will work, don’t think of the reset button just yet.

Hold down the Right Alt and SysRq keys and press this sequence:

R E I S U B

This will cleanly unmount drives, terminate processes and nicely reboot your machine.

Author Profile

T4L ;

Other posts by T4L

Author's web site



Are you satisfied with this blog?
Why not subscribe our RSS Feed? you will always get the latest post.


20 Comments

  1. arqbrulo

    I read this from somewhere else, so here you go. To remember the sequence, remember that R E I S U B backwards spells BUSIER, as in “my computer is busier than what it should be” ;)

    1

  2. Thanks for the tip.. this is really useful!

    2
  3. Sam

    Sorry, can you explain what each letter means. Thanks!

    3
  4. T4L

    Here you go Sam:

    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

    4
  5. djsoundfx

    Don’t forget you have to check something like: /proc/sys/kernel/sysrq

    Which should contain a number. 0 is disabled and 1 is enable all. This way you know if and to what level the sysreq options is enabled.

    5
  6. Zenwalker

    Will this effect the non hanged (not freezed) system while running normally?
    Just wanted to test.

    When i pressed Alt + SysRq button and then typed REISUB. Noting hapnd.

    6
  7. Richard

    SIGTERM and SIGKILL have the same default behavior (terminate process), but the former can be caught while the latter cannot. Presumably you send them in the order given so any processes encoded to catch SIGTERM can terminate gracefully. Any other rationale beyond that?

    7
  8. T4L

    You have to actually hold the left Alt and SysRq keys and while holding them down type REISUB.

    8
  9. Wim

    Thanks a lot! I’ve always had an unpleasent fealing when pushing my reset-button, but never thought there was a way to “interact” with a “non acting” system :)

    9
  10. Anonymous

    The reason you feel uneasy is that the reset button doesn’t really do anything *except* assert the reset line on the bus.

    And if the system is frozen, nobody is going to notice that line…

    10
  11. wjl

    I posted something similar about a year ago at http://blog.thedebianuser.org/?p=231

    For me, the reminder was something like:

    “Raising Elephants Is So Utterly Boring”, or, for a slight variation of the keys:
    “Raising Skinny Elephants Is Utterly Boring”

    It’s good to have reminders like these on the net; thanks!

    cheers,
    wjl

    11
  12. Fabiano

    For me, when I press LEFT ALT + SysRq in Ubuntu, a screen capture appears. If I press right ALT (ALT Gr)+ SysRq, I can see in a terminal commands working, but the last command, B (reBoot) does not work.

    Here is a very good explanation:
    http://en.wikipedia.org/wiki/Magic_SysRq_key

    12
  13. T4L

    @Fabiano: I think you’re using a laptop. On most laptops, the PrntScrn and SysRq keys are the same. But to actually get a SysRq push you have to also press the Fn key together with it. But then again, I may be wrong.

    13
  14. Zenwalker

    Well unfortunatley, i tried with both left and Right Alt keys with rest keys combination said about.

    But system didnt reboot or even shutdown. Hence asked u guys, whether it just works when system freezes or even if system is alive and normal, will this works?

    On my Zenwalk (Slacky based), nutings happening…

    14
  15. chisiyuan

    Thx a lot! That’s very helpful.

    15
  16. eluminx

    I have to agree with Zenwalker, i have tried this key combo many times when my box use to freeze alot and it never worked. Not once did it work at all.

    16

  17. Hey,

    thanks guys this is a very nice tip, it’s just a little bit complicated to type it on a laptop :ppp

    17
  18. maggie

    Hey and thanks for all the information. I’m trying this on my laptop but there is no right alt button that I can find. It’s on a Dell mini that doesn’t have as many keys as other laptops. Can I use this with the left alt, or is there some alternative?

    18
  19. T4L

    You can try the left alt to see if it works.

    19
  20. St0815

    Had similar unsuccessful experiences as some other commenters. Yes you can give yourself RSI trying to hit all these keys at the same time, but if the system is frozen it stays frozen. The system wasn’t even completely dead, still reacting on ping, and prompting me for the password when trying to contact it via ssh. Still: no way to shut it down cleanly.

    20

3 Trackback(s)

  1. 19 11 2008 : HowtoMatrix » Force a clean reboot when the system freezes
  2. 25 11 2008 : Oldies but goldies - plus some interesting thoughts at wolfgang.lonien.de
  3. 25 11 2008 : Tims Blog » Blog Archive » Fantabulous idea

Leave A Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>