How to recover from a Frozen System

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Absolutis

Re: How to recover from a Frozen System

Post by Absolutis »

Great trick. But does it work on mac keyboards, with f14, f15, f16 instead of print screen, scroll lock and pause/break?
spacer

Re: How to recover from a Frozen System

Post by spacer »

D'oh! I pressed ctrl+alt+backspace to see what it did while i was updating my computer. I thought it was gonna open up system monitor or something
rdanner3

Re: How to recover from a Frozen System

Post by rdanner3 »

Thinker wrote:Is this recovery? All data will be lost. This is of no use for a common user. "Safe way to restart" is better name for this article.
Tend to agree here.
Thinker wrote:Pressing Alt+Print Scr + K will cause logout by Killing X-server. Although this will not save any data but it is much better and time saving than REISUB
Also note that CTRL-ALT+BKSP will also do that. Have had both fail, though, forcing use of REISUB anyway. (BTW: REISUO will (IIRC) shut the machine off, not restart. Sometimes, if you're just this side of throwing the machine out the window, that might be the wiser choice.)
Shredded

Re: How to recover from a Frozen System

Post by Shredded »

Thank you, i force restarted the pc yesterday and it completely broke ny mint. Definitely saving this on my tablet.
SilverNexus

Re: How to recover from a Frozen System

Post by SilverNexus »

Used this handy trick to restart my computer when Banshee froze my whole computer upon me unmounting a USB disk (I haven't recreated it yet, so I'll not create a post for this issue). I probably could have gotten away with killing X server, but I had Ctrl-Alt-Bksp disabled (as is default), so along came this shutdown method. Worked like a charm, I must say.
deminted

Re: How to recover from a Frozen System

Post by deminted »

I see this is rather an old post, but I thought it might save some people puzzlement & angst if I add an update.

Firstly
NOTE: 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]

use gedit to edit 10-magic-sysrq.conf
change the last line from " kernel.sysrq = 176 " (which disables all the useful emergency commands)
to

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
...unraw (take control of keyboard back from X),
.... terminate (send SIGTERM to all processes, allowing them to terminate gracefully),
.. ..kill (send SIGKILL to all processes, forcing them to terminate immediately),
......sync (flush data to disk),
_ _ _ _ _ wait!
......unmount (remount all filesystems read-only),
....reboot

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.
Locked

Return to “Tutorials”