Monday, January 14, 2008

How to not really kill your frozen computer

The Magic SysRq comes to the rescue! When you have one, that is. On a macbook, alas...
Anyway:
- Hold Alt+SysRq (aka PrintScreen)
- then successively press r, e, i, s, u, b
(No, that's not a joke, it almost worked for me an hour ago. Then of course it definitely hung).


Make sure to wait a bit between key presses, as some of these events are supposed to stop services, sync the disks etc... There are apparently other funny combinations, like Alt+SysRq+f that kills the most mem hungry process. Also some flag has to be appropriately set in the kernel conf.

More details there, and thanks to google, as usual.

2 comments:

pimbert said...

A linux guru at work once explained me this, I was very very impressed.

And then forgot exactly which awkward key combination to use. (if you don't have a spare computer at hand, that means just going to the button anyway).

What I do wonder is, normally all communication from the keyboard hangs at well, can this be overridden? What does SysReq do? Directly enter into your bios?

tombert said...

No, apparently these calls go to the kernel directly. When the computer is frozen, chances are the system's still mostly fine except for the X server, which is ugly enough since that's pretty much how you interact with the stupid system. The SysRq things kind of bypass X. There's apparently a more sophisticated version that goes via the network, for cases when a bit more than just X is broken i suppose... Ah, i wish i was/had a linux guru... (sigh)