How to close down GNU/Linux safely after a system freeze with the SysRq key

Short URL:


Despite jeering at Windows for the infamous system freezes and blue screens of death, there are and will be times when your computer just locks up: the cursor is frozen and even invoking a console by Ctrl + Alt + [F2, F3, ...] to close down the X windows session running on F7 is non-functional.

My fellow blogger, Andrew Min, has given excellent tips on this website when faced with stubborn processes and applications that just refuse to terminate. This tip may be of assistance to those whose entire system has frozen and aren’t happy to just do a hard power off and trust to luck that data will not be corrupted. Fortunately GNU/Linux has journalled filesystems so the chances of this happening are reduced and you will not suffer the indignity of being told that you performed an illegal operation or having to drum your fingers waiting impatiently for scandisk to complete.

Like Ctrl + Alt + Delete this tip is a three fingered Vulcan neck pinch. It consists of Alt + SysRq and a selection of one other key (of which there are thirteen!), the choice of which will determine what operation is performed. This has been described as a way to communicate with the Kernel. It used to be that you had to enable this “magic key combo" when compiling a kernel but this is no longer necessary. (If your computer does not have a SysRq key then look for the “Print Screen" key—usually abbreviated to Prt Scr Normally, after certain key combos you will see “OK" and “Done". If your kernel is really locked up you might not see them at all. If you have a file called /proc/sys/kernel/sysrq then you are okay and man proc should list it and it will be enabled if there is a “1" in it.

Alt + SysRq + B

If you’re not running any crucial, scheduled tasks or in the middle of composing a letter or an e-mail then this key combination may be the one to use. It will reboot the system immediately without bothering to sync or unmount disks.

Alt + SysRq + R

If you cannot get to a terminal window by using Ctrl + Alt + F2 then use this key combination (pressed altogether) to get a keyboard (this is because this key combination turns off what is called keyboard raw mode. Pressing these keys allows keyboard input even after your X-Windows session has crashed/frozen). Now, try Ctrl + Alt + F2 again and you can close down from the terminal. If that fails move on to the next option.

Alt + SysRq + S

This key combo does just what it says on the tin: it (S)ync’s all filesystems which reduces the possibility of loosing any data and possibly obviating the need for the system to run fsck upon reboot.

Alt + SysRq + U

As you might guess, this one tries to unmount disks and remount them as read only.

Alt + SysRq + O

Not so obvious, but this will power off your machine without syncing or unmounting disks (but it won’t reboot. See above).

If in doubt use a mnemonic

If you are not sure about the sequence to use or just can’t remember, why not use a memory aid like: Raising Elephants Is So Utterly Boring (REISUB) or Everything Is Superb (EISUB) or So Everything Is Unusual - Boot (SEIUB). If even that was too much effort for you, just do Alt + SysRq + H which will bring up a helpful list of the command above.



sonoftheclayr's picture

I found this article very useful as I sometimes find myself in a situation such as this and am forced to turn the computer off manually. I have on problem though. On my laptop SysRq is a function key and there is no key on my laptop to lock the function key down, if that makes sense. Is there some way I can change the combination or another solution?

mark541's picture
Submitted by mark541 (not verified) on

I've got a laptop with the same limitation. I've found that you can do it with the Function key with a little experimentation (and very flexible fingers). On my laptop I did it with this combination:

Alt + Function + SysRq + x (where x is one of R S E I U B etc.)

You may need to experiment if, for example, your laptop prefers it to be entered as:

Function + SysRq + Alt + x

I don't have my laptop with me at the moment, so I'm not sure if it works both ways (When it worked the first way, I didn't try the other).

Felipe Alvarez's picture

I use a HP laptop (nx7400) with opensuse 10.2 My keyboard has PRTSC, SYSRQ, Fn (function) and of course the letters. The only thing that usually comes up is "HELP" menu in Firefox (alt + Fn + sysrq + H) or ksnapshot (K desktop). I tried it on my desktop PC with same OS and KDE, and only ksnapshot opens up. Any ideas?

John Beisley's picture

If you enter the following into a terminal after you've done an Alt-SysRq-S, for example, you should see that in fact it *has* done something (well, it does for me):

$ dmesg | tail -n2
[ 4065.874162] SysRq : Emergency Sync
[ 4066.451217] Emergency Sync complete

Although in my case it also brings up the GNOME screenshot program, but the kernel *also* catches the SysRq, and does what is required.

Gonz's picture
Submitted by Gonz (not verified) on

Somebody's on crack ALT+SyRq+AnyKey will give you a nice screen shot and thats about it.

Anonymous visitor's picture
Submitted by Anonymous visitor (not verified) on

Incorrect. Press one of the desired screens and then read your dmesg output (as pointed out above). Try ALT+SysRQ+H for example.
Your dmesg should put out something like this:

SysRq : HELP : loglevel0-8 reBoot Crashdump tErm Full kIll saK showMem Nice powerOff showPc unRaw Sync showTasks Unmount shoW-blocked-tasks

Works fine, but it does take a screenshot as well (or at least open up the dialog box)

Anonymous visitor's picture
Submitted by Anonymous visitor (not verified) on

Sadly, on my laptop, the kernel sysreq handler seems to interpret all the UIOPJKL;M,./ keys as part of the number pad, so this mostly just changes the log level. (more complex than that, because I use dvorak, so these keys are actually GCRLHTNSMWVZ).

Btw, to turn off the screen capture, you just need to edit your key bindings in X windows. Makes it much easier to test. Do a tail -f /var/log/messages to see what its doing.

Anonymous visitor's picture
Submitted by Anonymous visitor (not verified) on

If the numeric keypad as well as the SysRq key is accessed by pressing a 'Fn' key, try to release the 'Fn' key (while holding Alt/AltGr) after you have pressed the SysRq key. And - AltGr instead of Alt doesn't give me a screenshot ... :-)

Andrew Min's picture

I for one am thrilled. Kubuntu occasionally freezes, and I've just been holding down on the power button. Now, I finally can avoid that!

Andrew Min

Author information

Gary Richmond's picture


A retired but passionate user of free and open source for nearly ten years, novice Python programmer, Ubuntu user, musical wanabee when "playing" piano and guitar. When not torturing musical instruments, rumoured to be translating Vogon poetry into Swahili.