Magic SysRq key

Author: Wikipedia. Link to original: http://en.wikipedia.org/wiki/Magic_SysRq_key (English).
Tags: Linux, статья, ядро Submitted by litos 22.07.2009. Public material.

Translations of this material:

into Russian: Magic SysRq key. 33% translated in draft.
Submitted for translation by litos 22.07.2009 Published 7 years, 8 months ago.

Text

The '''magic SysRq key''' is a key combination in the [[Linux kernel]] which allows the user to perform various low level commands regardless of the system's state using the [[System request|SysRq]] key. It is often used to recover from freezes, or to [[reboot]] a computer without corrupting the [[filesystem]].<ref>http://lxr.linux.no/linux/Documentation/sysrq.txt</ref>

To be able to use this functionality the CONFIG_MAGIC_SYSRQ option has to be enabled at kernel compile time.

==Purpose==

Much like the [[Sun Microsystems]]' [[Open Firmware]] (OpenBoot), this key combination provides the ability to have access to powerful tools for software development and disaster recovery. In this sense, it can be considered a form of [[escape sequence]]. Principal among the offered commands are options to forcibly unmount file systems, kill processes, recover keyboard state, and write unwritten data to disk. With respect to these tasks, they provide a tool of last resort.

==Magic commands==

The key combination consists of [[Alt key|Alt]], [[SysRq]] and another key, which controls the command issued (as shown in the table below). Users with a [[keyboard layout]] other than [[QWERTY]] have to remember that their layout becomes QWERTY when they use one of these combinations. For example, on a [[Dvorak Simplified Keyboard|Dvorak]] keyboard, the key below '9' and '0' counts as a 'o', not as an 'r', so it shuts the system down instead of switching the keyboard to raw mode. Furthermore, some keyboards may not provide a separate [[SysRq]] key. In this case, a separate "Print" key should be present. The [[AltGr]] key, if present, can be used in place of [[Alt key]] in order to avoid alternative uses of these combinations such as Screenshot for Alt+SysRq+s under Gnome. It also can be accessed from the serial console.<ref>http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/index.html</ref>

{| class="wikitable"

|-

! Action

! [[QWERTY]]

! [[Dvorak Simplified Keyboard|Dvorak]]

! [[AZERTY]]

|-

| Set the console log level, which controls the types of kernel messages that are output to the console

| '''0''' through '''9'''

| '''0''' through '''9'''

| '''0''' through '''9'''<br />(''without'' using shift)

|-

| Immediately reboot the system, without unmounting partitions or syncing

| '''b'''

| '''x'''

| '''b'''

|-

| Reboot [[kexec]] and output a crashdump

| '''c'''

| '''j'''

| '''c'''

|-

| Display all currently held [[Lock (computer science)|Lock]]s

| '''d'''

| '''e'''

| '''d'''

|-

| Send the [[SIGTERM]] signal to all processes except init ([[Process_identifier|PID]] 1)

| '''e'''

| '''.'''

| '''e'''

|-

| Call oom_kill, which kills a process to alleviate an [[Out of memory|OOM]] condition

| '''f'''

| '''u'''

| '''f'''

|-

| When using Kernel Mode Setting, provides emergency support for switching back to the kernel's framebuffer console<ref>[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=79e539453b34e35f39299a899d263b0a1f1670bd DRM: i915: add mode setting support]</ref>

| '''g'''

| '''i'''

| '''g'''

|-

| Output a terse help document to the console<br/>Any key which is not bound to a command should also do the trick

| '''h'''

| '''d'''

| '''h'''

|-

| Send the [[SIGKILL]] signal to all processes except init

| '''i'''

| '''c'''

| '''i'''

|-

| Kill all processes on the current virtual console (Can be used to kill X and svgalib programs, see below)<br />This was originally designed to imitate a [[Secure Access Key]]

| '''k'''

| '''t'''

| '''k'''

|-

| Show a stack backtrace of all currently executing tasks

| '''l'''

| '''n'''

| '''l'''

|-

| Output current memory information to the console

| '''m'''

| '''m'''

| ''','''

|-

| Reset the [[nice (Unix)|nice]] level of all high-priority and [[real-time]] tasks

| '''n'''

| '''b'''

| '''n'''

|-

| Shut off the system

| '''o'''

| '''r'''

| '''o'''

|-

| Output the current registers and flags to the console

| '''p'''

| '''l'''

| '''p'''

|-

| Display all active high-resolution timers and clock sources.

| '''q'''

| '''&#39;'''

| '''a'''

|-

| Switch the keyboard from raw mode, the mode used by programs <!-- I'm not sure what to call these - they aren't all programs, due to svgalib.--> such as [[X11]] and [[svgalib]], to [[XLATE]] mode

| '''r'''

| '''p'''

| '''r'''

|-

| Sync all mounted filesystems

Pages: ← previous Ctrl next
1 2