I see this is rather an old post, but I thought it might save some people puzzlement & angst if I add an update.
FirstlyNOTE: for 'magic keys', recent versions of Mint no longer use SysRq with Alt (left), they use: SysRq with Alt (right) plus whatever (lower case)
A while back, some joker decided to disable the 'magic keys' by default, preventing orderly recovery in a stuck emergency.
I have no idea what the logic of this was, if any. What would I know? Probably a very wise person.
I expect there's a discussion somewhere saying how uttrerly pointless it would be to disable these key features by default if someone is going to have access to the main keyboard anyway
, but no doubt there are other wiser views prevailing.
One doesn't really notice until one gets into problems, and finds sysrq-ralt isn't available, then starts muttering curses.
When I start a new system I use the following steps to inject some common sense.
(Just after going to System Settings > Regional settings > options > set 'sequence to kill X-server' , presumably disbabled by default by the same wiseperson
Maybe not the most elegant way, but it works for me.
enable the whole idea:
Code: Select all
echo 1 | sudo tee /proc/sys/kernel/sysrq
which one might think was enough, but it seems one must also edit /etc/sysctl.d
use file manager
nemo, go to 'Filesystem' then select /etc/sysctl.d
(or Filesystem > /etc > sysctl.d ... heading there directly from /home/mint seems not to work)
right-click, [open as root]
to edit 10-magic-sysrq.conf
change the last line from " kernel.sysrq = 176 " (which disables all the useful emergency commands)
Code: Select all
# kernel.sysrq = 176
kernel.sysrq = 1
Now the 'magic keys ' will work when you need them.
(Remember to close the priviledged panels before something silly happens.)
If you use magic commands
from a terminal screen ( ctl+alt+F2, say), you will see them respond. Some give interesting if not useful info.
Some are pretty weird and seem to take for ever, or flood the console (not useful!), but SysRq+Alt(rt)+ r e i s u b
(typed in slowly with circumspection) often allows an orderly stop & reboot.
It will not work if there is kernel panic.
In a 'live' system, it will ensure that most files are 'sync'd to disc before stopping (if one waits or that to complete), but it will not restart one's live system as tinkered-with; instead it will take you back to a new live install base menu so you can start all over again. Oh, joy.
to quote WikiPedia http://en.wikipedia.org/wiki/Magic_SysRq_key
aw (take control of keyboard back from X),
rminate (send SIGTERM to all processes, allowing them to terminate gracefully),
ll (send SIGKILL to all processes, forcing them to terminate immediately),
ync (flush data to disk),
_ _ _ _ _ wait!
nmount (remount all filesystems read-only),
I hope that's helpful.
If someone has a better way (especially with regard to a live system), I would be interested to hear it.