Mandriva

Magic Key

If your computer freeze or seems to stop responding, you can try to use magic keys to restart properly. For that you have to go to a tty (ctrl-alt-F1) then you can type the following shortcuts :

  • Alt-Sys-R : put the keyboard into raw mode
  • Alt-Sys-S : instantly sync all hards disks
  • Alt-Sys-E : send the terminate signal to all process
  • Alt-Sys-I : stop all process (kill signal)
  • Alt-Sys-U : put filesystems into 'read only' mode
  • Alt-Sys-B : Reboot
  • Alt-Sys-O : Switch off
The [Sys] key is upper right of your keyboard with the "print screen" key.

If you compile your own kernel, you should activate the "Magic SysRq Key" option.

KB - AdminKey > Magic Key
Version 1.48 last modified by nickkeen on 01/11/2007 at 03:24

Comments (18)

Visionary | 30.08.2005 at 04:32 PM
Should this be a blank page?

Are there no "magic keys for an emergancy reboot"?


purpurea | 30.08.2005 at 06:52 PM
Alt+SysReq+r to put the keyboard into 'raw' mode Alt+SysReq+s to sync the discs Alt+SysReq+e to send 'terminate' Alt+SysReq+i to send 'kill' Alt+SysReq+s to sync again (a Good Idea) Alt+SysReq+u to put filesystems into 'read only' Alt+SysReq+b to reboot or Alt+SysReq+o to switch off

That sort of magic....? ;-)


Diwann | 31.08.2005 at 10:31 AM
yes, thank you.

As my english is not so good, I just wrote the french version and hoped that someone would have translated it…


sydhancock | 31.08.2005 at 10:36 AM
More detailed description: http://mandrivausers.org/index.php?showtopic=993&st=0&p=7001&#entry7001

Note the advice to kill the X-server (CTRL-ALT-BACKSPACE) after putting keyboard into 'raw' mode.


sydhancock | 31.08.2005 at 10:37 AM
Also, may need to use Alt-Graphics key instead of left-ALT

yoho | 01.09.2005 at 02:28 AM
Le moyen mnémotechnique pour s'en rappeler est : "Rasing Skinny Elephant Is Utterly Boring"

idiallo | 03.09.2005 at 06:08 PM
I don't know if the above comment is right from a technical point of view, but the way to say it is certainly not right. In my opinion, if you don't understand that, or don't care, you're the DUMB one, sp1.

kassad | 03.09.2005 at 09:29 PM
As Idiallo as noticed, for sure the way sp1 spoke his mind is certainly not right. Now for the technical point of view : 1/ At times doing a "proper" shutdown by going down all the runlevel may be a bad idea since some process may lock during their termination or worse in case of emergency the machine may die before they are done. There is need to avoid these steps in certain cases an nevertheless attempt to do some cleanup to save the day on your system. 2/ Now for the core point of the dumb naming, I fear you may have overlooked the Alt-Sys-R combination that puts your keyboard in raw mode, thus bypassing the X server cooked input and allowing you the Ctrl-Alt-Del to kill the X server or Alt-Ctrl-F1 to switch to VT1 and then the other sequences will be able to take place.

So far from being DUMB, this emergency features are a possible solution for the lockup problem that you point out. Sure there is cases were all is dead, motherboard fried and proc melted where no Magic Keys will save you but it gives us in some cases another chance to save a system. DUMB you say ? Maybe you should review your definition of dumb, or think twice before flaming out ?


sp1 | 03.09.2005 at 09:21 AM
Dumbest thing I have ever heard of. Any kind of serious lockup you could have will lock up the keyboard anyway rendering this absurd "fix" irrelevant. If your keyboard is still active a Cntl-Alt-Bkspace will kill your X-session allowing a Cntl-Alt-Del reboot which will be clean thereby avoiding the disk check because of the horrible improper shutdown. In short, if the keyboard works, you don't need it, if it doesn't, just hit the power switch and answer yes to the disk check questions. JUST DUMB.

Richard_Neill | 06.09.2005 at 03:02 AM
The kernel directly handles the SysRQ keys. So, usually, you can manage the Alt-Sysrq-RSEIUB trick. However, it depends what kind of keyboard you have. If you have an older (PS/2) keyboard, it is much more likely to respond than if you have a newer (USB) keyboard.

Personally, I find that USB is the cause of most lockups, so I have a PS/2 mouse connected, and a shell script on the desktop to shutdown.

What would be really nice is a SysRQ key which does (in one step)

*Take me to the console. Log me in as root (or give me a password prompt). Take keyboard focus (restarting the usb system if necessary). Stop all other tasks. (eg so that a 100%CPU process, or a fork-bomb can be stopped)

At any rate, I'd really like to see "kill -STOP" in addition to "kill -15" and "kill -9".


rolfp | 11.09.2005 at 02:33 PM
I am remembering the keystroke sequence to be E-I-S-U-B. That has worked for me. Not knowing the necessity of putting the keyboard in 'Raw' mode, I would, logically, wonder why you would not put the Sync after killing processes (E-I), instead of before, since running processes might be performing disk operations.

yoho | 13.09.2005 at 03:49 AM
I think R-S in the beginning is to recover your keyboard. The correct sequence should be :
  • Alt + SysRq + R
  • Alt + SysRq + S
  • Ctrl + Alt + F1
  • Ctrl + Alt + Backspace
  • Ctrl + Alt + Del
  • Then, AltSysReq + E,I,S,U,B

sergei | 22.09.2005 at 11:36 PM
I do not know about other people experience, but I have been keeping a sheet of paper with this "Raising Skinny Elephant Is Utterly Boring" (BTW, how many non-English native speakers can remember this crap?) in my laptop case for 3 years at least. I cannot remember how many times I had a lockup, for sure no less than 20, but I do remember that UNIQUE experience when this magic sequence worked. Linux is stable in general, but if it locks it lock reeeally hard…

ptyxs | 08.09.2006 at 03:53 PM
Note that all of the above comments are relative to a preceding version of this page, which has been recently replaced by a new - yet to be translated - version in French.


freda2999 | 12.10.2006 at 07:52 AM
huh???? Your explanation makes no sense to me at all. Neither do the magic key controls. Why, for example, would one want the raw mode? What does this accomplish? What is syncing hard drives? What does this accomplish? And so on.

Dexatron | 10.02.2007 at 03:26 AM
Wow I like this TIP should come in handy

Jim Whitby | 31.10.2007 at 11:40 PM
The flames remind me of a school-yard bully, always looking for a fight over anything.

As for freda2999:

Raw mode on the keyboard is to prevent the "locked" process from stealing your keyboard commands. Example: to be able to switch to VT1 and login, then stopping the "hung" process or doing a "clean" reboot.

Syncing the HD is to write out any cached data to disk ( so it isn't lost! ).

There are many more reasons for being able to access the kernel directly. Most of which are beyond my knowledge.

Let it suffice to say, you'll be glad you could do these things when you have that 100,000 word novel in a word processor that you just got locked out of.


niloch Hammond | 01.11.2007 at 03:24 AM
I think a sticker or a fridge magnet should be made of the most useful or essentual keys needs to be made could be useful to those loosing their minds

 


en es ca sv zh_TW nb pt nl fr

RSS

Creator: Diwann on 2005/08/29 17:45
(c) Mandriva 2007
18888888