SysRq

References:

Note that this is documented only on i386 on Linux, and you need your kernel to have been compiled with the 'Magic SysRq Key' option. Find out if it has been by looking at

/proc/sys/kernel/sysrq

If it exists and contains the value 1, all possible requests are allowed.

If it exists and contains the value 0

echo 1 > /proc/sys/kernel/sysrq

If the machine is headless or is being accessed remotely, magic commands may be run on the command line. This is, however, contingent upon being able to shell into the machine. To run magic commands, echo the desired trigger code to the SysRq trigger in the procfs. For example:

echo b > /proc/sysrq-trigger

The key combinations are a little different from platform to platform:

The command keys are as follows:

s
Attempts to sync all mounted file systems
u
Attempts to remount all mounted file systems to read-only
b
Attempts to immediately reboot your system (This is effectively like hitting the reset switch or power button on your box; processes will not be given the chance to shut down.)
p
Prints the current set of registers and flags to the console
t
Prints the list of current tasks and related information to the console
e
Sends a SIGTERM to all processes, with the exception of init
i
Sends a SIGKILL to all processes, with the exception of init
l
Sends a SIGKILL to all processes

Here's another interpretation:

r
Unraw: Restores the keyboard after an X crash or similar.
0
Changes console loglevel to 0 and so reduces error messages.
k
System attention key: Kills all processes on the current virtual console.
e
Terminate: Kills all processes except init on the current terminal.
i
Kill: Kills all processes except init, everywhere.
s
Sync: Attempts to sync all mounted filesystems. Outputs OK and Done when it's managed. This can reduce the chances of needing to run fsck at a later stage so it can be useful if you're having disk problems.
u
Umount: Attempts to remount all mounted filesystems read-only.
b
Reboot: immediately reboots the system without syncing or unmounting disks. Not a good idea unless in extremis! This may lead to data loss.
p
Dumps current registers and flags to the console.
m
Dumps current memory info to the console.

The best series of sysreq keys to issue has luckily been solved by an acronym found on the wikipedia link.

Raising Elephants Is So Utterly Boring, or BUSIER in reverse.

The series above will do the following:

A few seconds pause should be used between each sysreq command issued so they can take full effect.


Send mail to the Webmaster

logo This site best viewed with a browser
Warning: This is a Debian centric site and MAY contain peanuts.
Many thanks to Debra Lynn and Ian Murdock for making Debian possible
First created Dec 14, 2008 ~ Last revised April 22, 2009

Valid XHTML 1.0 Strict Valid CSS!