This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
using_magic_sysreq_keys_in_an_emergency [2016/11/25 22:38] 127.0.0.1 external edit |
using_magic_sysreq_keys_in_an_emergency [2025/08/08 17:06] (current) adam Specified reisub |
||
---|---|---|---|
Line 10: | Line 10: | ||
Enable sysrq keys | Enable sysrq keys | ||
- | By default it is not enabled on many Linux distributions. Add or modify following line (as soon as new Linux system installed) /etc/systctl.conf: | + | By default it is not enabled on many Linux distributions. Add or modify following line (as soon as new Linux system installed) /etc/sysctl.conf: |
kernel.sysrq=1 | kernel.sysrq=1 | ||
- | Save and close the file and reboot system to take effect | + | Save and close the file and reboot system to take effect. |
How do I use the magic SysRq keys in emergency? | How do I use the magic SysRq keys in emergency? | ||
You need to use following key combination in order to reboot/ | You need to use following key combination in order to reboot/ | ||
+ | |||
ALT+SysRq+COMMAND-KEY | ALT+SysRq+COMMAND-KEY | ||
The ‘SysRq’ key is also known as the ‘Print Screen’ key. COMMAND-KEY can be any one of the following (all keys need to hit simultaneously) : | The ‘SysRq’ key is also known as the ‘Print Screen’ key. COMMAND-KEY can be any one of the following (all keys need to hit simultaneously) : | ||
+ | * ‘r’ : Grab keyboard input in XLATE mode, so that only the terminal is using it. | ||
+ | * ‘e’ : Send a SIGTERM to all processes, except for init. | ||
+ | * ‘i’ : Send a SIGKILL to all processes, except for init. | ||
+ | * ’s’ : Will attempt to sync all mounted filesystems. | ||
+ | * ‘u’ : Will attempt to remount all mounted filesystems read-only. | ||
* ‘b’ : Will immediately reboot the system without syncing or unmounting your disks. | * ‘b’ : Will immediately reboot the system without syncing or unmounting your disks. | ||
* ‘o’ : Will shutdown your system off (if configured and supported). | * ‘o’ : Will shutdown your system off (if configured and supported). | ||
- | | + | * ‘h’ : Show help, indeed this the one you need to remember. |
- | * ‘u’ : Will attempt to remount all mounted filesystems read-only. | + | |
- | * ‘e’ : Send a SIGTERM to all processes, except for init. | + | |
- | | + | |
So whey you need to tell your Linux computer to reboot or when your X server is crashed or you don’t see anything going across the screen then just press: | So whey you need to tell your Linux computer to reboot or when your X server is crashed or you don’t see anything going across the screen then just press: | ||
Line 37: | Line 40: | ||
If you wish to shutdown the system instead of reboot then press following key combination: | If you wish to shutdown the system instead of reboot then press following key combination: | ||
ALT+SysRQ+o | ALT+SysRQ+o | ||
+ | |||
+ | Typically you will want: | ||
+ | |||
+ | ALT+SysRQ+reisub | ||
+ | |||
+ | with a pause between each command letter. | ||
ipt_sysrq is a new iptables target that allows you to do the same as the magic sysrq key on a keyboard does, but over the network. Sometimes a remote server hangs and only responds to icmp echo request (ping). Every administrator of such machine is very unhappy because (s)he must go there and press the reset button. It takes a long time and it’s inconvenient. So use the Network Magic SysRq and you will be able to do more than just pressing a reset button. You can remotely sync disks, remount them read-only, then do a reboot. And everything comfortably and only in a few seconds. Please see Marek Zelem page to enableIP Tables network magic SysRq function. | ipt_sysrq is a new iptables target that allows you to do the same as the magic sysrq key on a keyboard does, but over the network. Sometimes a remote server hangs and only responds to icmp echo request (ping). Every administrator of such machine is very unhappy because (s)he must go there and press the reset button. It takes a long time and it’s inconvenient. So use the Network Magic SysRq and you will be able to do more than just pressing a reset button. You can remotely sync disks, remount them read-only, then do a reboot. And everything comfortably and only in a few seconds. Please see Marek Zelem page to enableIP Tables network magic SysRq function. | ||
For more information read official Documentation for sysrq.c version 1.15 stored in / | For more information read official Documentation for sysrq.c version 1.15 stored in / |