Monday, May 17, 2021

Magic Tricks With the Sysreq Key

Juliet Kemp

The SysReq key is hidden up the top right of your keyboard, and looks a bit
like a relic from a former era of computing. (Which, indeed, it is.) But
there’s a bunch of things you can still do with it that may come in
handy. Note that this is documented only on i386 on Linux, and you need your kernel to
have been compiled with the “Magic SysRq Key” option. Find out if it has been
by looking at /proc/sys/kernel/sysrq — if it exists and contains
the value 1, all possible requests are allowed.

Press Alt-Sysreq, then one of the following letters:

r Unraw: Restores the keyboard after an X crash or
0 Changes console loglevel to 0 and so reduces
error messages.

System attention key: Kills all processes on the current

virtual console.

e Terminate: Kills all processes except init on the current


Kill: Kills all processes except init, everywhere.
s Sync: Attempts to sync all mounted filesystems. Outputs OK
and Done when it’s managed. This can reduce the chances of needing to
run fsck at a later stage so it can be useful if you’re having
disk problems.
u Umount: Attempts to remount all mounted filesystems
b Reboot: immediately reboots the system without syncing or
unmounting disks. Not a good idea unless in extremis! This may
lead to data loss.
p Dumps current registers and flags to the console.
m Dumps current memory info to the console.

If this doesn’t work, check the documentation at
/usr/share/doc/linux-doc-2.6.18/Documentation/sysrq.txt.gz for some
suggestions (including checking the keycode being sent).

This article was first published on

Similar articles

Latest Articles

How IBM has Changed...

Think is IBM’s big annual conference, and again this year, it was digital. I’m noticing a sharp quality difference in shows like this where...

Database-Tuning Platform Launches and...

PITTSBURGH — A team out of Carnegie Mellon University is launching its automatic database-tuning product today with the help of $2.5 million in funding.   OtterTune,...

Top 10 Professional Services...

Professional services automation (PSA) software aims to offer service-based companies most of the software they will need to run their businesses in one package....

What is Data Aggregation?

Data aggregation is the process where raw data is gathered and presented in a summarized format for statistical analysis. The data may be gathered...