* How do I use the magic SysRQ key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On x86 - You press the key combo 'ALT-SysRQ-<command key>'.
* What are the 'command' keys?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'r' - Turns off keyboard raw mode and sets it to XLATE.
'k' - Kills all programs on the current virtual console.
'b' - Will immediately reboot the system without syncing or
unmounting
your disks.
'o' - Will shut your system off via APM (if configured and
supported).
's' - Will attempt to sync all mounted filesystems.
'u' - Will attempt to remount all mounted filesystems read-only.
'p' - Will dump the current registers and flags to your console.
't' - Will dump a list of current tasks and their information to
your
console.
'm' - Will dump current memory info to your console.
'0'-'9' - Sets the console log level, controlling which kernel messages
will be printed to your console. ('0', for example would make
it so that only emergency messages like PANICs or OOPSes would
make it to your console.)
'e' - Send a SIGTERM to all processes, except for init.
'i' - Send a SIGKILL to all processes, except for init.
'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system
will be non-functional after this.)
and ...
re'B'oot is good when you're unable to shut down. But you should also
'S'ync
and 'U'mount first.
'S'ync is great when your system is locked up, it allows you to sync
your
disks and will certainly lessen the chance of data loss and fscking.
Note
that the sync hasn't taken place until you see the "OK" and "Done"
appear
on the screen. (If the kernel is really in strife, you may not ever get
the
OK or Done message...)
'U'mount is basically useful in the same ways as 'S'ync. I generally
'S'ync,
'U'mount, then re'B'oot when my system locks. It's saved me many a fsck.
Again, the unmount (remount read-only) hasn't taken place until you see
the
"OK" and "Done" message appear on the screen.
After that you can reboot into single-user mode. It would be nice to
able to
change the init level using the magic sysrq key, though.
Donnchadh
--
// Donnchadh Ó Donnabháin mailto:d_odonnabhain at vistech.ie
// Vistech Software http://www.vistechsoftware.com
// Inchvale House, Douglas West, Cork, Ireland
// Ph. +353-21-918166 Fax +353-21-896142
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!