Originally seen here as Skinny Elephants, this sequence of keys allows you to safely reboot a Linux system that has blocked – avoiding hitting the reset button.

Raising Skinny Elephants Is Utterly Boring

Here is how you “raise the elephant”:

Alt+SysRq+r ( The LEFT Alt key ) ( SysRq is on the same button as print screen )
Alt+SysRq+s
Alt+SysRq+e
Alt+SysRq+i
Alt+SysRq+u
Alt+SysRq+b

Give a little time between keystrokes.

The r stands for put keyboard in raw mode
The s for sync the disk
The e for terminate all processes
The i for kill all processes
The u for remount all filesystems read only
The b for reboot the system

THIS IS THE VERY LAST SAVE YOUR BUTT PROCEDURE ! ONLY IF ALL ELSE FAILS !

Bruno

PS: If your filesystem is Ext3 or ReiserFS and on reboot it wants you to do a filesystem check, don’t touch any key when it asks you to press “Y” and let it recover the journal automatically.

NOTE: For the skinny elephants to work you need to have the sysrq-key enabled in the kernel. (CONFIG_MAGIC_SYSRQ)
You can check if it is enabled by typing “cat /proc/sys/kernel/sysrq”, if the command returns “1″ the sysrq-key is enabled.
If it returns “0″ you can enable it with “echo 1 > /proc/sys/kernel/sysrq”