<s>
The	O
magic	B-Application
SysRq	I-Application
key	I-Application
is	O
a	O
key	O
combination	O
understood	O
by	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
,	O
which	O
allows	O
the	O
user	O
to	O
perform	O
various	O
low-level	O
commands	O
regardless	O
of	O
the	O
system	O
's	O
state	O
.	O
</s>
<s>
It	O
is	O
often	O
used	O
to	O
recover	O
from	O
freezes	B-General_Concept
,	O
or	O
to	O
reboot	B-Operating_System
a	O
computer	O
without	O
corrupting	O
the	O
filesystem	B-Application
.	O
</s>
<s>
Its	O
effect	O
is	O
similar	O
to	O
the	O
computer	O
's	O
hardware	O
reset	B-Application
button	I-Application
(	O
or	O
power	O
switch	O
)	O
but	O
with	O
many	O
more	O
options	O
and	O
much	O
more	O
control	O
.	O
</s>
<s>
Principal	O
among	O
the	O
offered	O
commands	O
are	O
means	O
to	O
forcibly	O
unmount	O
file	B-Application
systems	I-Application
,	O
kill	O
processes	O
,	O
recover	O
keyboard	O
state	O
,	O
and	O
write	O
unwritten	O
data	O
to	O
disk	O
.	O
</s>
<s>
The	O
magic	B-Application
SysRq	I-Application
key	I-Application
cannot	O
work	O
under	O
certain	O
conditions	O
,	O
such	O
as	O
a	O
kernel	B-Operating_System
panic	I-Operating_System
or	O
a	O
hardware	O
failure	O
preventing	O
the	O
kernel	B-Operating_System
from	O
running	O
properly	O
.	O
</s>
<s>
SysRq	B-Device
functionalities	O
can	O
also	O
be	O
accessed	O
without	O
a	O
keyboard	O
.	O
</s>
<s>
Note	O
that	O
some	O
commands	O
may	O
be	O
disabled	O
out	O
of	O
the	O
box	O
as	O
specified	O
in	O
the	O
bitmask	O
value	O
in	O
/proc/sys/kernel/sysrq	O
.	O
</s>
<s>
Action	O
QWERTY	O
Dvorak	O
AZERTY	O
Colemak	O
Set	O
the	O
console	O
log	O
level	O
,	O
which	O
controls	O
the	O
types	O
of	O
kernel	B-Operating_System
messages	O
that	O
are	O
output	O
to	O
the	O
console	O
-	O
-	O
-	O
(	O
without	O
)	O
-	O
Immediately	O
reboot	B-Operating_System
the	O
system	O
,	O
without	O
unmounting	O
or	O
syncing	O
filesystems	B-Application
Perform	O
a	O
system	O
crash	O
.	O
</s>
<s>
Display	O
all	O
currently	O
held	O
Locks	O
(	O
kernel	B-Operating_System
option	O
is	O
required	O
)	O
Send	O
the	O
signal	O
to	O
all	O
processes	O
except	O
init	O
(	O
PID	B-Operating_System
1	O
)	O
Call	O
,	O
which	O
kills	O
a	O
process	O
to	O
alleviate	O
an	O
OOM	B-General_Concept
condition	O
When	O
using	O
Kernel	B-Operating_System
Mode	O
Setting	O
,	O
switch	O
to	O
the	O
kernel	B-Operating_System
's	O
framebuffer	O
console.If	O
the	O
in-kernel	O
debugger	O
is	O
present	O
,	O
enter	O
the	O
debugger	O
.	O
</s>
<s>
Output	O
a	O
terse	O
help	O
document	O
to	O
the	O
consoleAny	O
key	O
which	O
is	O
not	O
bound	O
to	O
a	O
command	O
should	O
also	O
perform	O
this	O
action	O
Send	O
the	O
signal	O
to	O
all	O
processes	O
except	O
Forcibly	O
"	O
Just	O
thaw	O
it	O
"	O
–	O
filesystems	B-Application
frozen	O
by	O
the	O
ioctl	O
.	O
</s>
<s>
Kill	O
all	O
processes	O
on	O
the	O
current	O
virtual	O
console	O
(	O
can	O
kill	O
X	B-Operating_System
and	O
SVGAlib	B-Application
programs	O
,	O
see	O
below	O
)	O
This	O
was	O
originally	O
designed	O
to	O
imitate	O
a	O
secure	O
attention	O
key	O
Shows	O
a	O
stack	O
backtrace	O
for	O
all	O
active	O
CPUs	O
.	O
</s>
<s>
Output	O
current	O
memory	O
information	O
to	O
the	O
console	O
Reset	O
the	O
nice	B-Device
level	I-Device
of	O
all	O
high-priority	O
and	O
real-time	O
tasks	O
Shut	O
off	O
the	O
system	O
Output	O
the	O
current	O
registers	O
and	O
flags	O
to	O
the	O
console	O
Display	O
all	O
active	O
high-resolution	O
timers	O
and	O
clock	O
sources	O
.	O
</s>
<s>
Switch	O
the	O
keyboard	O
from	O
raw	O
mode	O
,	O
used	O
by	O
programs	O
such	O
as	O
X11	B-Operating_System
and	O
SVGAlib	B-Application
,	O
to	O
XLATE	O
mode	O
Sync	O
all	O
mounted	O
filesystems	B-Application
Output	O
a	O
list	O
of	O
current	O
tasks	O
and	O
their	O
information	O
to	O
the	O
console	O
Remount	O
all	O
mounted	O
filesystems	B-Application
in	O
read-only	O
mode	O
Forcefully	O
restores	O
framebuffer	O
console.For	O
ARM	O
processors	O
,	O
cause	O
ETM	O
buffer	O
dump	O
instead	O
.	O
</s>
<s>
Display	O
list	O
of	O
blocked	O
(	O
D	O
state	O
)	O
tasks	O
Used	O
by	O
xmon	O
interface	O
on	O
PowerPC	O
platforms.Show	O
global	O
PMU	O
Registers	O
on	O
sparc64.Dump	O
all	O
TLB	O
entries	O
on	O
MIPS	O
.	O
</s>
<s>
Output	O
of	O
the	O
on	O
a	O
x86_64	O
kernel	B-Operating_System
:	O
</s>
<s>
Before	O
the	O
advent	O
of	O
journaled	B-Application
filesystems	I-Application
a	O
common	O
use	O
of	O
the	O
magic	B-Application
SysRq	I-Application
key	I-Application
was	O
to	O
perform	O
a	O
safe	O
reboot	B-Operating_System
of	O
a	O
Linux	B-Operating_System
computer	O
which	O
has	O
otherwise	O
locked	O
up	O
(	O
abbr	O
.	O
</s>
<s>
which	O
avoided	O
a	O
risk	O
of	O
filesystem	B-Application
corruption	O
.	O
</s>
<s>
With	O
modern	O
filesystems	B-Application
,	O
this	O
practice	O
is	O
not	O
encouraged	O
,	O
offering	O
no	O
upsides	O
over	O
straight	O
reoot	O
,	O
though	O
the	O
default	O
value	O
of	O
kernel.sysrq	O
in	O
such	O
distributions	O
as	O
Ubuntu	O
and	O
Debian	O
remains	O
176	O
and	O
438	O
respectively	O
.	O
</s>
<s>
Another	O
past	O
use	O
was	O
to	O
kill	O
a	O
frozen	O
graphical	O
program	O
,	O
as	O
the	O
X	B-Operating_System
Window	I-Operating_System
System	I-Operating_System
used	O
to	O
have	O
complete	O
control	O
over	O
graphical	O
mode	O
and	O
input	O
devices	O
.	O
</s>
<s>
would	O
normally	O
be	O
used	O
to	O
reenter	O
GUI	O
mode	O
on	O
a	O
system	O
on	O
which	O
the	O
X	B-Operating_System
server	O
has	O
not	O
crashed	O
.	O
)	O
</s>
<s>
The	O
feature	O
is	O
controlled	O
both	O
by	O
a	O
compile-time	O
option	O
in	O
the	O
kernel	B-Operating_System
configuration	O
,	O
,	O
and	O
a	O
sysctl	B-Application
kernel	B-Operating_System
parameter	O
,	O
.	O
</s>
<s>
On	O
newer	O
kernels	B-Operating_System
(	O
since	O
2.6.12	O
)	O
,	O
it	O
is	O
possible	O
to	O
have	O
more	O
fine-grained	O
control	O
over	O
how	O
the	O
magic	B-Application
SysRq	I-Application
key	I-Application
can	O
be	O
used	O
.	O
</s>
<s>
On	O
Ubuntu	O
this	O
is	O
set	O
at	O
boot	B-Operating_System
time	I-Operating_System
to	O
the	O
value	O
defined	O
in	O
.	O
</s>
<s>
While	O
the	O
magic	B-Application
SysRq	I-Application
key	I-Application
was	O
originally	O
implemented	O
as	O
part	O
of	O
the	O
kernel	B-Operating_System
's	O
keyboard	O
handler	O
for	O
debugging	O
,	O
the	O
functionality	O
has	O
been	O
also	O
exposed	O
via	O
the	O
proc	B-Application
filesystem	I-Application
and	O
is	O
commonly	O
used	O
to	O
provide	O
extended	O
management	O
capabilities	O
to	O
headless	O
and	O
remote	O
systems	O
.	O
</s>
<s>
From	O
user	O
space	O
programs	O
(	O
such	O
as	O
a	O
command	O
line	O
shell	O
)	O
,	O
SysRq	B-Device
may	O
be	O
accessed	O
by	O
writing	O
to	O
(	O
e.g.	O
,	O
)	O
.	O
</s>
<s>
Many	O
embedded	O
systems	O
have	O
no	O
attached	O
keyboard	O
,	O
but	O
instead	O
use	O
a	O
serial	B-Device
console	I-Device
for	O
text	O
input/output	O
to	O
the	O
running	O
system	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
invoke	O
a	O
Magic	B-Application
SysRq	I-Application
feature	O
over	O
a	O
serial	B-Device
console	I-Device
by	O
sending	O
a	O
serial	O
break	O
signal	O
,	O
followed	O
by	O
the	O
desired	O
key	O
.	O
</s>
<s>
The	O
method	O
of	O
sending	O
a	O
break	O
is	O
dependent	O
on	O
the	O
terminal	O
program	O
or	O
hardware	O
used	O
to	O
connect	O
to	O
the	O
serial	B-Device
console	I-Device
.	O
</s>
<s>
A	O
sysctl	B-Application
option	O
needs	O
to	O
be	O
set	O
to	O
enable	O
this	O
function	O
.	O
</s>
<s>
The	O
Linux	B-Operating_System
daemons	O
and	O
provide	O
a	O
method	O
of	O
accessing	O
SysRq	B-Device
features	O
over	O
a	O
TCP	O
connection	O
after	O
authenticating	O
with	O
a	O
plain-text	O
password	O
.	O
</s>
<s>
The	O
daemon	O
will	O
invoke	O
pre-configured	O
SysRq	B-Device
triggers	O
when	O
system	B-Operating_System
load	I-Operating_System
average	I-Operating_System
exceeds	O
a	O
certain	O
threshold	O
.	O
</s>
<s>
The	O
Xen	B-Operating_System
hypervisor	I-Operating_System
has	O
functionality	O
to	O
send	O
magic	O
commands	O
to	O
hosted	O
domains	O
via	O
its	O
command	O
.	O
</s>
<s>
Additionally	O
,	O
a	O
SysRq	B-Device
command	O
can	O
be	O
invoked	O
from	O
a	O
Xen	B-Operating_System
paravirtual	O
console	O
by	O
sending	O
a	O
break	O
sequence	O
followed	O
by	O
the	O
desired	O
key	O
.	O
</s>
<s>
Chromebooks	B-Operating_System
have	O
a	O
keyboard	O
but	O
no	O
dedicated	O
SysRq	B-Device
key	I-Device
.	O
</s>
<s>
IBM	B-Device
Power	I-Device
Systems	I-Device
servers	O
can	O
invoke	O
the	O
Magic	B-Application
SysRq	I-Application
feature	O
using	O
followed	O
by	O
the	O
desired	O
key	O
from	O
the	O
Hardware	B-Device
Management	I-Device
Console	I-Device
.	O
</s>
<s>
IBM	O
mainframe	O
partitions	O
can	O
invoke	O
the	O
Magic	B-Application
SysRq	I-Application
feature	O
using	O
followed	O
by	O
the	O
desired	O
key	O
on	O
3270	B-Operating_System
or	O
HMC	O
console	O
.	O
</s>
