Skip to content

SysRq

SysRq

Disable

Check Current SysRq Value:

>>> cat /proc/sys/kernel/sysrq
16

0 - disable sysrq completely
1 - enable all functions of sysrq
2 - enable control of console logging level
4 - enable control of keyboard (SAK, unraw)
8 - enable debugging dumps of processes etc.
16 - enable sync command
32 - enable remount read-only
64 - enable signaling of processes (term, kill, oom-kill)
128 - allow reboot/poweroff
256 - allow nicing of all RT tasks

Temp Enable All SysRq settings:

echo "1" > /proc/sys/kernel/sysrq

Temp Disable All SysRq settings:

echo "0" > /proc/sys/kernel/sysrq

Persistent Enable all SysRq settings:

echo "kernel.sysrq = 1" >> /etc/sysctl.d/99-sysctl.conf

Commands

Action QWERTY
Set the console log level, which controls the types of kernel messages that are output to the console 0 - 9
Immediately reboot the system, without unmounting or syncing filesystems b
Perform a system crash. A crashdump will be taken if it is configured. c
Display all currently held Locks (CONFIG_LOCKDEP kernel option is required) d
Send the SIGTERM signal to all processes except init (PID 1) e
Call oom_kill, which kills a process to alleviate an OOM condition f
If the in-kernel debugger kdb is present, enter the debugger. g
Any key which is not bound to a command should also perform this action h
Send the SIGKILL signal to all processes except init i
Forcibly "Just thaw it" – filesystems frozen by the FIFREEZE ioctl. j
Kill all processes on the current virtual console (can kill X and SVGAlib programs, see below) k
Shows a stack backtrace for all active CPUs. l
Output current memory information to the console m
Reset the nice level of all high-priority and real-time tasks n
Shut off the system o
Output the current registers and flags to the console p
Display all active high-resolution timers and clock sources. q
Switch the keyboard from raw mode, used by programs such as X11 and SVGAlib, to XLATE mode r
Sync all mounted filesystems s
Output a list of current tasks and their information to the console t
Remount all mounted filesystems in read-only mode u
Forcefully restores framebuffer console. For ARM processors, cause ETM buffer dump instead. v
Display list of blocked (D state) tasks w
Used by xmon interface on PowerPC platforms. Dump all TLB entries on MIPS. x
Show global CPU registers (SPARC-64 specific) y
Dump the ftrace buffer z