Next: Installation
Up: Compilation and installation
Previous: Kernel hacking options
Contents
The option
[*] Magic SysRq key
is particularly useful, because it often allows you to reduce the impact of a
kernel failure and to obtain some additional information about the state of the
system. It turns on some keyboard shortcuts allowing you to pass specific
instructions directly to the kernel:
- Alt + SysRq + b - reboot the system immediately, without unmounting
filesystems and writing the contents of disk buffers to the storage
(DANGEROUS)
- Alt + SysRq + c - crashdump
- Alt + SysRq + e - send the TERM signal to all processes except for INIT
- Alt + SysRq + i - send the KILL signal to all processes except for INIT
- Alt + SysRq + k - SAK (Secure Access Key); kill all processes bound to
the currently active virtual console (eg. emergency shutdown of the X server
when Ctrl + Alt + Backspace does not work)
- Alt + SysRq + l - send the KILL signal to all processes including INIT
- Alt + SysRq + m - print information about the state of memory
- Alt + SysRq + o - system shutdown
- Alt + SysRq + p - print the contents of CPU registers and flags
- Alt + SysRq + r - switch the keyboard to the RAW mode (eg. when
Ctrl + Alt + Backspace does not work)
- Alt + SysRq + s - synchronize filesystems and write the contents of disk
buffers to the storage
- Alt + SysRq + t - print the list of all tasks
- Alt + SysRq + u - remount all filesystems read-only
- Alt + SysRq + h - print help
Which key is the SysRq? That depends on the architecture of your machine:
- x86 - Print Screen
- SPARC - STOP
- serial console - Break
- PowerPC - Print Screen (or F13)
On all architectures you can trigger the action assigned to given key
(say t) by echoing the corresponding character to the file
/proc/sysrq-trigger, eg.
# echo t > /proc/sysrq-trigger
What is the safest way to restart the computer?
First, you should try to press the combination of Ctrl + Alt + Backspace
(X Window system) or Ctrl + Alt + Del (text console). If it does not work,
you can:
- press Alt + SysRq + k to kill all processes using the current console,
- press Alt + SysRq + s, Alt + SysRq + u, Alt + SysRq + b
More information related to the ''Magic SysRq key'' mechanism can be
found in the file Documentation/sysrq.txt included in the kernel sources.
Next: Installation
Up: Compilation and installation
Previous: Kernel hacking options
Contents
MichaĆ Piotrowski
2007-06-21