Tag Archives: Linux kernel

Magic Key in Linux

You’re working on a serious project or writing an important assignment(on linux obviously :p)  and suddenly your system freezes.God Bless You!.The instantaneous panic will unconsciously make you Ctrl+Alt+Del if you’ve shifted from Windows and are still getting accustomed to linux habits.Even a regular linux user may face problems if he is not aware of the ‘magic’ he possesses.

The ‘magic‘ is forever-ignored SysRq key on our keyboard.It  can send commands directly to the Linux kernel. You can use it to recover from freezes or cleanly restart your system, even if nothing appears to be responding.The magic SysRq key is implemented as part of Linux’s keyboard driver – it will work as long as the Linux kernel is still running.

Using SysRq key

This key is generally the same as Print Screen key and the magic combination of using it is Alt+SysRq To use this key combination,your Linux kernel must have been compiled with the CONFIG_MAGIC_SYSRQ compile option – most Linux distributions will have this enabled by default. Assuming it’s compiled into your kernel, it can be enabled or disabled on a running system by changing the value of /proc/sys/kernel/sysrq. To check if it’s enabled, run the following command:

cat /proc/sys/kernel/sysrq

Continue reading Magic Key in Linux