Categories: GeneralTipsTutorials

What You Need To Know About Linux’s Magic SysRq Key

The magic SysRq key can help you deal with a frozen and unresponsive system. It avoids doing a hard reboot along with, hopefully, avoiding potential loss of data. The SysRq key is actually a handy bit of knowledge to keep handy.

NOTE: The information in this article is for those who use the QWERTY keyboard. If you use Dvorak, AZERTY, etc., be sure to click the link in the opening paragraph because it will be different for you.

There are times when your system appears frozen but it actually isn’t. You can test this situation with the Shift Lock key. If the light (assuming you have one) comes on, the system isn’t technically frozen – it’s probably just not accepting inputs. But, if it’s so far gone that the light doesn’t change then it’s possible that this will not work.

There are all sorts of reasons why your system may appear to have halted. This article has nothing to do with that, nor is it about preventing a frozen session. It’s about using the magic SysRq key to get out of a situation where your system has stopped responding. 

The purpose, at least as far as this article is concerned, is to reboot without corrupting your data. This gives you a tidier reboot that reduces the risk of data loss. It’s quick and easy to learn and memorize.

The SysRq Key:

Look at your keyboard. Look carefully. The key we’re looking for is the ‘SysRq‘ key. You may not know why it is there, and may think it has no purpose, but it’s there and there for a reason.

The key is often doubled with the PrtScr (print screen) and doesn’t get used often. It’s used in combination with the Alt. If you’re using a keyboard with an Fn, you don’t normally need to use it to perform this keyboard function. Look around your keyboard and you should find the SysRq key. It’s bound to be there somewhere!

What you’re going to learn and is ‘REISUB’. This is easy to remember, because it’s ‘BUSIER’ backwards. When your computer is no longer responding, press (and hold) Alt, while holding SysRq, and then press R E I S U B in order shut everything down properly and reboot without (or with less chance of) data loss.

You can try it right now. However, you’re going to reboot if you do so. Leave about a second between each keypress.

You don’t actually need to use all the letters. If you give zero poops about data loss, you can go straight to Alt + SysRq +​ B​. But, that’s not giving the system the chance to perform all the shutdown processes.

If you want to (hopefully) not lose data, use REISUB. This is what those letters do:

R puts keyboard in raw mode.
E sends SIGTERM (except init).
I sends SIGKILL (except init).
S syncs mounted filesystems.
U (read-only) remount of mounted filesystems.
B reboots the system immediately.

Those should reboot the system for you, after sending all the other commands. Again, it’s easily remembered as being ‘BUSIER’ backwards and you should press them immediately after one another, allowing a second between each.

Closure:

This makes yet another article in the books, and now you know how to reboot your system when it is frozen. The magic SysRq key works well enough, even though there are some situations where it won’t work. A computer can be so frozen that it’s no longer accepting any input at all. It works well up until you’ve reached that point.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Enable/Disable Your Network Interface

Today we'll cover one way to enable or disable your network interface in the Linux…

5 months ago

Check Your NIC Speed In The Terminal

Today's exercise is a nice and simple exercise where we check your NIC speed in…

5 months ago

Easily Monitor Your Wireless Connection

Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…

6 months ago

Count The Files In A Directory

I think I've covered this before with the ls command but this time we'll count…

6 months ago

Get System Information With The ‘uname’ Command In Linux

Today we'll be learning about a basic Linux command that's known as 'uname' and it…

6 months ago

hardinfo Has Been Rebooted As hardinfo2

If you've used hardinfo in the past, it may interest you to know that hardinfo…

6 months ago