Posted by chris on Wed 1 Nov 2006 at 13:32
This content is taken from the linux kernel source documentation. I'm throwing it out here to make it easier for users to find. The sysreq key is a "magical" key combination to which your Linux kernel will respond, regardless of whatever it is doing.
For full details - see the file Documentation/sysrq.txt included in the Linux kernel source code.
What is the magic SysRq key?
It is a 'magical' key combo you can hit which the kernel will respond to regardless of whatever else it is doing, unless it is completely locked up.
How do I use the magic SysRq key?
- On x86
- You press the key combo 'ALT-SysRq-'. Note -
Some keyboards may not have a key labeled 'SysRq'. The 'SysRq'
key is also known as the 'Print Screen' key. Also some keyboards
cannot handle so many keys being pressed at the same time, so you
might have better luck with "press Alt", "press SysRq", "release
Alt", "press ", release everything.
- On SPARC
- You press 'ALT-STOP-', I believe.
- On the serial console (PC style standard serial ports only)
- You send a BREAK, then within 5 seconds a command
key. Sending BREAK twice is interpreted as a normal BREAK.
- On PowerPC
- Press 'ALT - Print Screen (or F13) - , Print
Screen (or F13) - may suffice.
- On other
- If you know of the key combos for other architectures, please
let me know so I can add them to this section.
- On all
- write a character to /proc/sysrq-trigger. eg:
echo t > /proc/sysrq-trigger
What are the 'command' keys?
- 'r'
- Turns off keyboard raw mode and sets it to XLATE.
- 'k'
- Secure Access Key (SAK) Kills all programs on the current
virtual console. NOTE: See important comments below in SAK
section.
- 'b'
- Will immediately reboot the system without syncing or
unmounting your disks.
- 'c'
- Will perform a kexec reboot in order to take a crashdump.
- 'o'
- Will shut your system off (if configured and supported).
- 's'
- Will attempt to sync all mounted filesystems.
- 'u'
- Will attempt to remount all mounted filesystems read-only.
- 'p'
- Will dump the current registers and flags to your console.
- 't'
- Will dump a list of current tasks and their information to
your console.
- 'm'
- Will dump current memory info to your console.
- 'v'
- Dumps Voyager SMP processor info to your console.
- '0'-'9'
- Sets the console log level, controlling which
kernel messages will be printed to your console. ('0', for
example would make it so that only emergency messages like PANICs
or OOPSes would make it to your console.)
- 'f'
- Will call oom_kill to kill a memory hog process
- 'e'
- Send a SIGTERM to all processes, except for init.
- 'i'
- Send a SIGKILL to all processes, except for init.
- 'l'
- Send a SIGKILL to all processes, INCLUDING init. (Your system
will be non-functional after this.)
- 'h'
- Will display help ( actually any other key than those listed
above will display help. but 'h' is easy to remember :-)
This article can be found online at the Debian Administration website at the following bookmarkable URL:
This article is copyright 2006 chris - please ask for permission to republish or translate.