OpenSUSE Linux Tips, tricks, how-tos, opinions, and news
My Resume - My LinkedIn Profile - twitter: @scottmmorrisI ran across this rather informative Wikipedia page about something called the “Magic SysRq key.” It is a mechanism built into the kernel that allows you to reboot a machine without having to hold in the Power button. Because your disks don’t have a chance to sync, and other complications that can occur with such a shutdown, this is a great alternative. If your system becomes completely unresponsive, this is a forceful way to reboot the machine, but more graceful than the 6-second power button charade.
First, to see if your machine is set up to do this, run this command:
cat /proc/sys/kernel/sysrq
If you see a “0″, it is disabled. If you see a “1″, it is enabled.
To enable it, do this:
echo 1 > /proc/sys/kernel/sysrq
To disable it, do this:
echo 0 > /proc/sys/kernel/sysrq
Once you have it enabled, you can proceed to perform the operation.
To do this, you will need to hold down the ALT and SYSRQ (or PRINT SCREEN) buttons while typing the following key sequence:
(taken from wikipedia)
Alt + SysRq + R – takes the keyboard out of raw mode.
Alt + SysRq + E – terminates all processes (except init).
Alt + SysRq + I – kills all processes (except init).
Alt + SysRq + S – synchronizes the disk.
Alt + SysRq + U – remounts all filesystems read-only.
Alt + SysRq + B – reboots the machine.
One thing to keep in mind, however, is that you will want to give the machine time to complete each command, especially time between the last three commands. You want to make sure that the machine syncs the disk before remounting the filesystems, and you want to wait a moment to reboot the machine after it performs the remount.
If you enjoyed this post, make sure you subscribe to my RSS feed!| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| « Jan | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | ||||||
51 queries. 0.705 seconds
September 11th, 2007 at 10:24 pm
The nicest thing about SysRq is Alt + SysRq + K, which kills all prgrams at the current virtual console.
Sadly, we still lack a real SAK.
September 11th, 2007 at 11:40 pm
[...] Scott’s Article Wikipedia Entry [...]
September 12th, 2007 at 1:22 am
[...] OpenSUSE Linux Rants » Blog Archive » Reboot a locked Linux box with the Magic SysRq Keys – suse linux opensuse (tags: sysrq keys how to) [...]
September 24th, 2007 at 5:30 am
[...] habe kürzlich im suseblog gelesen, wie man ein abgestürztes Linuxsystem sicher und ohne Datenverlust neu starten kann. [...]