The magic sysreq options introduced
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?
- Turns off keyboard raw mode and sets it to XLATE.
- Secure Access Key (SAK) Kills all programs on the current virtual console. NOTE: See important comments below in SAK section.
- Will immediately reboot the system without syncing or unmounting your disks.
- Will perform a kexec reboot in order to take a crashdump.
- Will shut your system off (if configured and supported).
- Will attempt to sync all mounted filesystems.
- Will attempt to remount all mounted filesystems read-only.
- Will dump the current registers and flags to your console.
- Will dump a list of current tasks and their information to your console.
- Will dump current memory info to your console.
- Dumps Voyager SMP processor info to your console.
- 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.)
- Will call oom_kill to kill a memory hog process
- Send a SIGTERM to all processes, except for init.
- Send a SIGKILL to all processes, except for init.
- Send a SIGKILL to all processes, INCLUDING init. (Your system will be non-functional after this.)
- Will display help ( actually any other key than those listed above will display help. but 'h' is easy to remember :-)