Servers Magic Tricks With the Sysreq Key

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.

Tip of the Trade: Remember the Sysreq key? It’s in the same spot it’s always been. Get reacquainted with it, and rediscover all the useful things it can do.

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

r Unraw: Restores the keyboard after an X crash or
similar.
0 Changes console loglevel to 0 and so reduces
error messages.
k System attention key: Kills all processes on the current
virtual console.
e Terminate: Kills all processes except init on the current
terminal.
i 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
read-only.
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).

Latest Posts

How to Convert a Physical Computer to a Virtual Machine

Many organizations are implementing virtualization technology into their networks to convert physical computers to virtual machines (VM). This helps reduce overall physical hardware costs,...

HPE ProLiant DL380 Gen10: Rack Server Overview and Insight

The HPE ProLiant DL380 series has consistently been a market leader in the server space. The Gen10 released in 2017 further increased HPE's market...

Best Server Management Software & Tools 2021

Finding the best server management software tools for your organization can have a major impact on the success of your business operations. Manually handling...

IBM AS/400: Lasting the Test of Time

Some server operating systems (OS) were built to survive the test of time – the IBM AS/400 is one such system.  The AS/400 (Application System/400)...

What is Disaster Recovery?

The modern organization's heavy dependence on using data to drive their business has made having a Disaster Recovery (DR) plan in place a necessity....

Related Stories