It doesn't get much faster than using the System Request (SysRq) functionality and then triggering an immediate reboot
.
This is a key combination understood by the kernel.
Enable SysRq:
echo 1 > /proc/sys/kernel/sysrq
Now, send it into reboot.
echo b > /proc/sysrq-trigger
b
- Immediately reboot the system, without unmounting or syncing filesystems.
Note:
Although this is a reboot
it will behave like the power has been cut off, which is not recommended.
If you want to sync
and umount
the filesystems before hand then use:
echo s > /proc/sysrq-trigger
echo u > /proc/sysrq-trigger
or if you just want to power off the system then:
echo o > /proc/sysrq-trigger
Magic key combinations
There are also key combinations to use that are interpreted by the kernel:
Alt+SysRq / Print Screen+Command Key
Command Keys:
R - Take control of keyboard back from X.
E - Send SIGTERM to all processes, allowing them to terminate gracefully.
I - Send SIGKILL to all processes, forcing them to terminate immediately.
S - Flush data to disk.
U - Remount all filesystems read-only.
B - Reboot.
Quoting from the Magic SysRq Key Wiki:
A common use of the magic SysRq key is to perform a safe reboot of a Linux computer which has otherwise locked up.
- Hold down the Alt and SysRq (Print Screen) keys.
- While holding those down, type the following keys in order, several seconds apart: REISUB.
- Computer should reboot.
A way to remember these are:
"Reboot Even If System Utterly Broken" or simply the word "BUSIER" read backwards.
References
Magic SysRq Key Wiki
Fedora SysRq
sudo shutdown -P 0
I use that and it starts the shutdown process right away, no matter what apps are open – gkmohit Oct 21 '14 at 15:02