Purpose of “SysRq” button in our keyboard.


Hai friends,

When i started to use computer, From that day i had doubt with “PrtSc/SysRq” button. All of us knew the purpose of “PtrSc” button (i.e) “Print screen the current window “. But most of us don’t know the use of “SysRq” button. today i search in google about this, i got the answer. The small description os “Sysrq” button. 😉

The main use of this button is,

Reboot machine when everything is hanging

<alt> + <print screen/sys rq> + <R> – <S> – <E> – <I> – <U> – <B>

If the machine is hanging and the only help would be the power button, this key-combination will help to reboot your machine (more or less) gracefully.

R – gives back control of the keyboard

S – issues a sync

E – sends all processes but init the term singal

I – sends all processes but init the kill signal

U – mounts all filesystem ro to prevent a fsck at reboot

B – reboots the system

Save your file before trying this out, this will reboot your machine without warning!

“Raising Elephants” mnemonic device

A common idiom to perform a safe reboot of a Linux computer which has otherwise locked up, the QWERTY(It’s a keyboard layout) (or AZERTY) mnemonic “Raising Elephants Is So Utterly Boring”, “Reboot Even If System Utterly Broken” or simply remembering the word “BUSIER” backwards, is often useful. It stands for

  • unRaw (take control of keyboard back from X),
  • tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
  • kIll (send SIGKILL to all processes, forcing them to terminate immediately),
  • Sync (flush data to disk),
  • Unmount (remount all filesystems read-only),
  • reBoot.

This can prevent a fsck being required on reboot and gives some programs a chance to save emergency backups of unsaved work.

In practice, each command may require a few seconds to complete, especially if feedback is unavailable from the screen due to a freeze or display corruption. For example, sending SIGKILL to processes which have not yet finished terminating can cause data loss.

In Linux distributions Enable SysRq key:

The SysRq key can be disabled with the following command:

$ echo 1 > /proc/sys/kernel/sysrq

To Disable:

$ echo 0 > /proc/sys/kernel/sysrq

Ex:

In terminal,

$ echo b > /proc/sysrq-trigger

Or

This is equivalent to the key combination Alt + SysRq + B which reboots the machine.

The feature is controlled both by a compile-time option in the kernel configuration, CONFIG_MAGIC_SYSRQ, and a sysctl kernel parameter,kernel.sysrq.

Source and more info:

http://en.wikipedia.org/wiki/Magic_SysRq_key

🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s