Sunday, December 19, 2010

When all else fails in Linux

From  http://www.brunolinux.com/01-First_Things_To_Know/Skinny_Elephants.html


SKINNY ELEPHANTS
( Or: If All Else Fails )


In addition to the PID story in Run-Away Processes If all is blocked and even Ctrl+Alt+backspace ( what should be a last resort ) does not react, if your system does not react on any action ( like I said before, very rare in Linux ) remember the next line:


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"

No comments:

Post a Comment